diff --git a/include/mitsuba/hw/gputexture.h b/include/mitsuba/hw/gputexture.h index 0026cb31..c1d91f7b 100644 --- a/include/mitsuba/hw/gputexture.h +++ b/include/mitsuba/hw/gputexture.h @@ -214,7 +214,7 @@ public: inline void setSize(const Point3i &size) { m_size = size; } /// Get the maximal anisotropy - inline float getMaxAnisotropy() const { return m_maxAnisotropy; } + inline Float getMaxAnisotropy() const { return m_maxAnisotropy; } /** \brief Set the maximal anisotropy. * @@ -222,7 +222,7 @@ public: * texture filtering. A value of 0 (default) will * use the global max. anisotropy value */ - inline void setMaxAnisotropy(float maxAnisotropy) { m_maxAnisotropy = maxAnisotropy; } + inline void setMaxAnisotropy(Float maxAnisotropy) { m_maxAnisotropy = maxAnisotropy; } /// Return whether mipmapping is enabled inline bool isMipMapped() const { return m_mipmapped; } @@ -363,7 +363,7 @@ protected: EDepthMode m_depthMode; bool m_mipmapped; mutable PrimitiveThreadLocal > m_textureUnits; - float m_maxAnisotropy; + Float m_maxAnisotropy; int m_samples; std::vector m_bitmaps; Point3i m_size; diff --git a/src/integrators/photonmapper/sppm.cpp b/src/integrators/photonmapper/sppm.cpp index f95858e1..8d8c764a 100644 --- a/src/integrators/photonmapper/sppm.cpp +++ b/src/integrators/photonmapper/sppm.cpp @@ -293,7 +293,7 @@ public: Spectrum flux, contrib; if (gp.depth != -1) { - M = photonMap->estimateRadianceRaw( + M = (Float) photonMap->estimateRadianceRaw( gp.its, gp.radius, flux, m_maxDepth-gp.depth); } else { M = 0; @@ -305,7 +305,7 @@ public: } else { Float ratio = (N + m_alpha * M) / (N + M); gp.flux = (gp.flux + gp.weight * (flux + - gp.emission * proc->getShotParticles() * M_PI * gp.radius*gp.radius)) * ratio; + gp.emission * (Float) proc->getShotParticles() * M_PI * gp.radius*gp.radius)) * ratio; gp.radius = gp.radius * std::sqrt(ratio); gp.N = N + m_alpha * M; contrib = gp.flux / ((Float) m_totalEmitted * gp.radius*gp.radius * M_PI); diff --git a/src/libhw/gltexture.cpp b/src/libhw/gltexture.cpp index f1388620..2ae35b61 100644 --- a/src/libhw/gltexture.cpp +++ b/src/libhw/gltexture.cpp @@ -242,7 +242,7 @@ void GLTexture::refresh() { //Assert(m_size.x == m_size.y); /* Anisotropic texture filtering */ - float anisotropy = getMaxAnisotropy(); + float anisotropy = (float) getMaxAnisotropy(); if (anisotropy > 1.0f) { if (isMipMapped() && m_filterType == EMipMapLinear) { /* Only use anisotropy when it makes sense - otherwise some diff --git a/src/luminaires/spot.cpp b/src/luminaires/spot.cpp index 72f49fc7..c27b602a 100644 --- a/src/luminaires/spot.cpp +++ b/src/luminaires/spot.cpp @@ -34,7 +34,7 @@ public: SpotLuminaire(const Properties &props) : Luminaire(props) { m_intensity = props.getSpectrum("intensity", Spectrum(1.0f)); m_cutoffAngle = props.getFloat("cutoffAngle", 20); - m_beamWidth = props.getFloat("beamWidth", m_cutoffAngle * 3.0/4.0); + m_beamWidth = props.getFloat("beamWidth", m_cutoffAngle * 3.0f/4.0f); m_beamWidth = degToRad(m_beamWidth); m_cutoffAngle = degToRad(m_cutoffAngle); Assert(m_cutoffAngle >= m_beamWidth); @@ -57,7 +57,7 @@ public: m_cosCutoffAngle = std::cos(m_cutoffAngle); m_position = m_luminaireToWorld(Point(0, 0, 0)); m_uvFactor = std::tan(m_beamWidth/2); - m_invTransitionWidth = 1.0 / (m_cutoffAngle - m_beamWidth); + m_invTransitionWidth = 1.0f / (m_cutoffAngle - m_beamWidth); } void serialize(Stream *stream, InstanceManager *manager) const { @@ -91,8 +91,8 @@ public: if (m_texture->getClass() != MTS_CLASS(ConstantTexture)) { Intersection its; its.hasUVPartials = false; - its.uv.x = .5+localDir.x / (localDir.z / m_uvFactor); - its.uv.y = .5+localDir.y / (localDir.z / m_uvFactor); + its.uv.x = 0.5f + localDir.x / (localDir.z / m_uvFactor); + its.uv.y = 0.5f + localDir.y / (localDir.z / m_uvFactor); result *= m_texture->getValue(its); } diff --git a/src/shapes/sphere.cpp b/src/shapes/sphere.cpp index 8231e81f..555592f5 100644 --- a/src/shapes/sphere.cpp +++ b/src/shapes/sphere.cpp @@ -141,7 +141,7 @@ public: if (phi < 0) phi += 2*M_PI; - its.uv.x = phi * (0.5 * INV_PI); + its.uv.x = phi * (0.5f * INV_PI); its.uv.y = theta * INV_PI; its.dpdu = m_objectToWorld(Vector(-local.y, local.x, 0) * (2*M_PI)); its.geoFrame.n = normalize(its.p - m_center); diff --git a/src/textures/ldrtexture.cpp b/src/textures/ldrtexture.cpp index fceb9f37..1906023a 100644 --- a/src/textures/ldrtexture.cpp +++ b/src/textures/ldrtexture.cpp @@ -293,7 +293,7 @@ public: m_gpuTexture->setWrapType(GPUTexture::ERepeat); else m_gpuTexture->setWrapType(GPUTexture::EClampToEdge); - m_gpuTexture->setMaxAnisotropy((int) maxAnisotropy); + m_gpuTexture->setMaxAnisotropy(maxAnisotropy); m_gpuTexture->init(); /* Release the memory on the host side */ m_gpuTexture->setBitmap(0, NULL);