medium handling fixes in photonmapper.cpp
parent
94ea62495c
commit
14ce675ebb
|
@ -390,6 +390,9 @@ public:
|
|||
|
||||
rRec2.recursiveQuery(rRec, RadianceQueryRecord::ERadiance);
|
||||
RayDifferential bsdfRay(its.p, its.toWorld(bRec.wo), ray.time);
|
||||
if (its.isMediumTransition())
|
||||
rRec2.medium = its.getTargetMedium(bsdfRay.d);
|
||||
|
||||
LiSurf += bsdfVal * m_parentIntegrator->Li(bsdfRay, rRec2);
|
||||
}
|
||||
}
|
||||
|
@ -426,7 +429,7 @@ public:
|
|||
|
||||
for (int i=0; i<numLuminaireSamples; ++i) {
|
||||
/* Estimate the direct illumination if this is requested */
|
||||
if (scene->sampleAttenuatedLuminaire(its.p, ray.time, rRec.medium,
|
||||
if (scene->sampleAttenuatedLuminaire(its, rRec.medium,
|
||||
lRec, sampleArray[i], rRec.sampler)) {
|
||||
/* Allocate a record for querying the BSDF */
|
||||
BSDFQueryRecord bRec(its, its.toLocal(-lRec.d));
|
||||
|
@ -477,9 +480,12 @@ public:
|
|||
rRec2.recursiveQuery(rRec,
|
||||
RadianceQueryRecord::ERadianceNoEmission);
|
||||
|
||||
if (its.isMediumTransition())
|
||||
rRec2.medium = its.getTargetMedium(bsdfRay.d);
|
||||
|
||||
bool indexMatchedMediumTransition = false;
|
||||
Spectrum transmittance;
|
||||
scene->attenuatedRayIntersect(bsdfRay, rRec.medium, bsdfIts,
|
||||
scene->attenuatedRayIntersect(bsdfRay, rRec2.medium, bsdfIts,
|
||||
indexMatchedMediumTransition, transmittance, rRec.sampler);
|
||||
rRec2.type ^= RadianceQueryRecord::EIntersection;
|
||||
|
||||
|
@ -520,7 +526,6 @@ public:
|
|||
scene->rayIntersect(bsdfRay, bsdfIts);
|
||||
}
|
||||
|
||||
|
||||
LiSurf += bsdfVal * m_parentIntegrator->Li(bsdfRay, rRec2) * weightBSDF;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue