提交 5c09a439 编写于 作者: M Matt Pharr

Fix NaN bugs when sigma_n rounds to zero.

Fixes #179, via @shadeops.
上级 dcd00a34
......@@ -1055,6 +1055,7 @@ SampledSpectrum VolPathIntegrator::Li(RayDifferential ray, SampledWavelengths &l
ClampZero(sigma_maj - mp.sigma_a - mp.sigma_s);
Float pdf = T_maj[0] * sigma_n[0];
beta *= T_maj * sigma_n / pdf;
if (pdf == 0) beta = SampledSpectrum(0.f);
r_u *= T_maj * sigma_n / pdf;
r_l *= T_maj * sigma_maj / pdf;
return beta && r_u;
......
......@@ -128,6 +128,7 @@ void WavefrontPathIntegrator::SampleMediumInteraction(int wavefrontDepth) {
Float pr = T_maj[0] * sigma_n[0];
beta *= T_maj * sigma_n / pr;
if (pr == 0) beta = SampledSpectrum(0.f);
inv_w_u *= T_maj * sigma_n / pr;
inv_w_l *= T_maj * sigma_maj / pr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册