From 6bedfb611e81109dca812487bf45ed8eb202421b Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Tue, 21 Sep 2010 03:41:12 +0200 Subject: [PATCH] fixed a minor sampling issue in roughglass.cpp --- src/bsdfs/roughglass.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bsdfs/roughglass.cpp b/src/bsdfs/roughglass.cpp index 587a354b..63802bc5 100644 --- a/src/bsdfs/roughglass.cpp +++ b/src/bsdfs/roughglass.cpp @@ -327,7 +327,8 @@ public: Frame mFrame(sampleBeckmannD(bRec.sample)); /* Perfect specular reflection along the microsurface normal */ - refract(mFrame.toLocal(bRec.wi), bRec.wo, bRec.quantity); + if (refract(mFrame.toLocal(bRec.wi), bRec.wo, bRec.quantity) == 0) + return Spectrum(0.0f); bRec.wo = mFrame.toWorld(bRec.wo); bRec.sampledComponent = 1; @@ -335,7 +336,7 @@ public: if (Frame::cosTheta(bRec.wi)*Frame::cosTheta(bRec.wo) >= 0) return Spectrum(0.0f); - + return f(bRec) / pdf(bRec); }