fixed a minor sampling issue in roughglass.cpp

metadata
Wenzel Jakob 2010-09-21 03:41:12 +02:00
parent b5903a1425
commit 6bedfb611e
1 changed files with 3 additions and 2 deletions

View File

@ -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);
}