handle some rare/odd cases where a medium surrounds the camera and a distant environment map

metadata
Wenzel Jakob 2013-01-24 20:06:31 -05:00
parent 50501fc154
commit 6021ee09f9
2 changed files with 13 additions and 4 deletions

View File

@ -186,8 +186,13 @@ public:
if (!its.isValid()) {
/* If no intersection could be found, possibly return
attenuated radiance from a background luminaire */
if (rRec.type & RadianceQueryRecord::EEmittedRadiance)
Li += throughput * scene->evalEnvironment(ray);
if (rRec.type & RadianceQueryRecord::EEmittedRadiance) {
Spectrum value = throughput * scene->evalEnvironment(ray);
if (rRec.medium)
value *= rRec.medium->evalTransmittance(ray);
Li += value;
}
break;
}

View File

@ -165,8 +165,12 @@ public:
if (!its.isValid()) {
/* If no intersection could be found, possibly return
attenuated radiance from a background luminaire */
if (rRec.type & RadianceQueryRecord::EEmittedRadiance)
Li += throughput * scene->evalEnvironment(ray);
if (rRec.type & RadianceQueryRecord::EEmittedRadiance) {
Spectrum value = throughput * scene->evalEnvironment(ray);
if (rRec.medium)
value *= rRec.medium->evalTransmittance(ray);
Li += value;
}
break;
}