evaluate the orientation value when calling 'HeterogeneousMedium::eval' if needed. (#84)

master
Adrien Gruson 2018-08-10 17:54:21 +09:00 committed by Wenzel Jakob
parent 3c7da2b129
commit 450a2b8a25
1 changed files with 4 additions and 0 deletions

View File

@ -668,11 +668,15 @@ public:
Float mintDensity = lookupDensity(ray(ray.mint), ray.d) * m_scale;
Float maxtDensity = 0.0f;
Spectrum maxtAlbedo(0.0f);
Vector orientation(0.0f);
if (ray.maxt < std::numeric_limits<Float>::infinity()) {
Point p = ray(ray.maxt);
maxtDensity = lookupDensity(p, ray.d) * m_scale;
maxtAlbedo = m_albedo->lookupSpectrum(p);
orientation = m_orientation != NULL
? m_orientation->lookupVector(p) : Vector(0.0f);
}
mRec.orientation = orientation;
mRec.transmittance = Spectrum(expVal);
mRec.pdfFailure = expVal;
mRec.pdfSuccess = expVal * maxtDensity;