Page 1 of 1

photon mapping + final gather light leaks

Posted: Sun Feb 22, 2015 7:51 am
by MohamedSakr
I understand how final gather works "to some extent" , I'm using PBRT 2 as a reference.
the problem is, light leaks appear at corners!!, any idea of a robust solution?

Re: photon mapping + final gather light leaks

Posted: Mon Feb 23, 2015 2:59 pm
by papaboo
Photon mapping comes with geometric bias and light leaking. There are various ways to reduce it, but you can't remove it without an infinite number of samples and a really really really high precision backbuffer.

That being said you can 'postpone' the light leaking until it's is no longer noticeable.
Instead of doing final gathering at the first non-specular surface, you can wait until the path PDF is less then 1/PI, i.e the path itself is so out of focus that you won't notice the artefacts.
A second check you can make that postpones final gathering to avoid leaking is to continue tracing eye rays until the length of the last bounce is higher than your photon gathering radius. (kernel bandwidth). This check should help your case. Imagine that your primary ray hits a floor and traces a final gather ray to the wall 2mm away. If you gather at the wall, you'll essentially be gathering the same photons that you would on the floor, so you'll see just about the same artefacts that you would by visualizing the photon map directly. If you let the final gather ray bounce an extra time it might hit something further away and the light leaking won't be noticeable.

Re: photon mapping + final gather light leaks

Posted: Mon Feb 23, 2015 11:26 pm
by MohamedSakr
thanks a lot :) , you are correct about the corner case where the ray gathers the near wall "wrong" radiance photon!! , I think I know now how to solve it.
cheers.

Re: photon mapping + final gather light leaks

Posted: Wed Mar 27, 2019 7:47 am
by Igors
Hi, papaboo, All

Sorry for old themes reanimating but I've same prob (but no solutions)

>> A second check you can make that postpones final gathering to avoid leaking is to continue tracing eye rays until the length of the last bounce is higher than your photon gathering radius. (kernel bandwidth). This check should help your case. Imagine that your primary ray hits a floor and traces a final gather ray to the wall 2mm away. If you gather at the wall, you'll essentially be gathering the same photons that you would on the floor, so you'll see just about the same artefacts that you would by visualizing the photon map directly. If you let the final gather ray bounce an extra time it might hit something further away and the light leaking won't be noticeable. <<

Interesting approach, can you please explain/share more details? Imagine we're at final gather phase, cast a ray and found my photon map cannot be used directly at hit point (too small hit distance for example). Ok, what's next? How should I "continue tracing""? How many rays I should cast from hit poinr? Where to?

Thx