I seek help for robustly implementing Veach's correction for shading normals for the adjoint BSDF, i.e. for photon mapping or light tracing.
The problem: According to Veach we should add a correction factor that compensates for using shading normals instead of geometry normals:
However, wo*Ns/wo*Ng can become arbitrary large since the denominator does not cancel and can become very small at grazing angles. I saw this factor go up to 1000. And this introduced ugly fireflies in my render. I clamped the factor to 10 as a band aid fix. But this is certainly not very pretty. It did help though with no noticeable change in the image.
How do production renderers deal with this?
I took a look at PBRT's implementation and found that in BDPT they use the correction straight forwardly
https://github.com/mmp/pbrt-v3/blob/mas ... pt.cpp#L55
To my surprise I did not found the correction in the photon mapping code!
https://github.com/mmp/pbrt-v3/blob/mas ... m.cpp#L403
There ist just the regular
Code: Select all
Spectrum bnew =
beta * fr * AbsDot(wi, isect.shading.n) / pdf;
Did I manage to find a bug? Is it a conscious decision to omit it to prevent fireflies?