handle some rare/odd cases where a medium surrounds the camera and a distant environment map
parent
50501fc154
commit
6021ee09f9
|
@ -186,8 +186,13 @@ public:
|
||||||
if (!its.isValid()) {
|
if (!its.isValid()) {
|
||||||
/* If no intersection could be found, possibly return
|
/* If no intersection could be found, possibly return
|
||||||
attenuated radiance from a background luminaire */
|
attenuated radiance from a background luminaire */
|
||||||
if (rRec.type & RadianceQueryRecord::EEmittedRadiance)
|
if (rRec.type & RadianceQueryRecord::EEmittedRadiance) {
|
||||||
Li += throughput * scene->evalEnvironment(ray);
|
Spectrum value = throughput * scene->evalEnvironment(ray);
|
||||||
|
if (rRec.medium)
|
||||||
|
value *= rRec.medium->evalTransmittance(ray);
|
||||||
|
Li += value;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -165,8 +165,12 @@ public:
|
||||||
if (!its.isValid()) {
|
if (!its.isValid()) {
|
||||||
/* If no intersection could be found, possibly return
|
/* If no intersection could be found, possibly return
|
||||||
attenuated radiance from a background luminaire */
|
attenuated radiance from a background luminaire */
|
||||||
if (rRec.type & RadianceQueryRecord::EEmittedRadiance)
|
if (rRec.type & RadianceQueryRecord::EEmittedRadiance) {
|
||||||
Li += throughput * scene->evalEnvironment(ray);
|
Spectrum value = throughput * scene->evalEnvironment(ray);
|
||||||
|
if (rRec.medium)
|
||||||
|
value *= rRec.medium->evalTransmittance(ray);
|
||||||
|
Li += value;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue