From 0f9b0461414c7d058b642b92e0019ce4b06a2202 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Sat, 6 Aug 2011 22:42:05 -0400 Subject: [PATCH] getting there.. --- data/tests/test_bsdf.xml | 3 --- src/bsdfs/plastic.cpp | 6 ++---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/data/tests/test_bsdf.xml b/data/tests/test_bsdf.xml index f1c15892..9302c0be 100644 --- a/data/tests/test_bsdf.xml +++ b/data/tests/test_bsdf.xml @@ -2,9 +2,6 @@ to be tested for consistency. This is done using the testcase 'test_chisquare' --> - - - diff --git a/src/bsdfs/plastic.cpp b/src/bsdfs/plastic.cpp index a024eec5..2523d46b 100644 --- a/src/bsdfs/plastic.cpp +++ b/src/bsdfs/plastic.cpp @@ -211,7 +211,6 @@ public: return Spectrum(0.0f); Float Fr = fresnel(Frame::cosTheta(bRec.wi), m_extIOR, m_intIOR); - Float probSpecular = (Fr*m_specularSamplingWeight) / (Fr*m_specularSamplingWeight + (1-Fr) * (1-m_specularSamplingWeight)); @@ -282,12 +281,11 @@ public: bRec.sampledComponent = 1; bRec.sampledType = EDiffuseReflection; bRec.wo = squareToHemispherePSA(Point2( - (sample.x - Fr) / (1 - Fr), + (sample.x - probSpecular) / (1 - probSpecular), sample.y )); - pdf = (1-probSpecular) * Frame::cosTheta(bRec.wo) * INV_PI; - + return m_diffuseReflectance->getValue(bRec.its) * (1-Fr) / (1-probSpecular); }