mmp / pbrt-v4

Source code to pbrt, the ray tracer described in the forthcoming 4th edition of the "Physically Based Rendering: From Theory to Implementation" book.
https://pbrt.org
Apache License 2.0
2.83k stars 440 forks source link

Function Film.ToOutputRGB seems to output negative values in the photon mapper. #398

Open MaherRayes opened 11 months ago

MaherRayes commented 11 months ago

I'm trying to output indirect illumination separately on the photon mapper. However printing pixel.tau / (np * Pi * Sqr(pixel.radius)) gives negative values for some of the RGB channels. I tried to trace the value back and it seem like RGB Phi_i = film.ToOutputRGB(pixel.vp.beta * Phi, photonLambda) is returning negative values.

Is this expected behavior? The final images still look correct to me so I'm a bit confused.