use the improved sampling routines

metadata
Wenzel Jakob 2011-07-03 03:02:22 +02:00
parent 1cef7172cd
commit 5bcd47fba4
1 changed files with 3 additions and 1 deletions

View File

@ -103,7 +103,8 @@ public:
scene->sampleLuminaire(its.p, ray.time, lRec, rRec.nextSample2D())) { scene->sampleLuminaire(its.p, ray.time, lRec, rRec.nextSample2D())) {
/* Allocate a record for querying the BSDF */ /* Allocate a record for querying the BSDF */
const Vector wo = -lRec.d; const Vector wo = -lRec.d;
const BSDFQueryRecord bRec(its, its.toLocal(wo)); BSDFQueryRecord bRec(its, its.toLocal(wo));
bRec.sampler = rRec.sampler;
/* Evaluate BSDF * cos(theta) */ /* Evaluate BSDF * cos(theta) */
const Spectrum bsdfVal = bsdf->fCos(bRec); const Spectrum bsdfVal = bsdf->fCos(bRec);
@ -131,6 +132,7 @@ public:
/* Sample BSDF * cos(theta) */ /* Sample BSDF * cos(theta) */
BSDFQueryRecord bRec(its); BSDFQueryRecord bRec(its);
bRec.sampler = rRec.sampler;
Float bsdfPdf; Float bsdfPdf;
Spectrum bsdfVal = bsdf->sampleCos(bRec, bsdfPdf, rRec.nextSample2D()); Spectrum bsdfVal = bsdf->sampleCos(bRec, bsdfPdf, rRec.nextSample2D());
if (bsdfVal.isZero()) if (bsdfVal.isZero())