From 920aedafb8498abb1399af1bc9918f961ae1c3e6 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Thu, 31 Jan 2013 19:16:28 -0500 Subject: [PATCH] minor restructuring --- src/bsdfs/plastic.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bsdfs/plastic.cpp b/src/bsdfs/plastic.cpp index 4f11f242..5c1999f6 100644 --- a/src/bsdfs/plastic.cpp +++ b/src/bsdfs/plastic.cpp @@ -339,7 +339,7 @@ public: Spectrum diff = m_diffuseReflectance->eval(bRec.its); if (m_nonlinear) - diff /= Spectrum(1.0f) - m_fdrInt*diff; + diff /= Spectrum(1.0f) - diff*m_fdrInt; else diff /= 1 - m_fdrInt; @@ -357,6 +357,7 @@ public: bRec.sampledType = EDiffuseReflection; Spectrum diff = m_diffuseReflectance->eval(bRec.its); + diff /= Spectrum(1.0f) - m_fdrInt*diff; if (m_nonlinear) diff /= Spectrum(1.0f) - diff*m_fdrInt; else @@ -424,14 +425,14 @@ public: bRec.wo = Warp::squareToCosineHemisphere(sample); Float Fo = fresnelDielectricExt(Frame::cosTheta(bRec.wo), m_eta); - pdf = Warp::squareToCosineHemispherePdf(bRec.wo); - Spectrum diff = m_diffuseReflectance->eval(bRec.its); if (m_nonlinear) diff /= Spectrum(1.0f) - diff*m_fdrInt; else diff /= 1 - m_fdrInt; + pdf = Warp::squareToCosineHemispherePdf(bRec.wo); + return diff * (m_invEta2 * (1-Fi) * (1-Fo)); } }