PDA

View Full Version : Photon Mapping artifact


rockster8
03-31-2006, 08:22 PM
Hi guys, I've been trying to solve this prob on my photon mapper. I used Henrik Wann Jensen's version of a photon mapper, modified nothing, and this is what I got:

http://www.ucfsa.com/591/images/photonmap17.png

Notice the dark lines exhibited on the edges of the back wall. Also on the left wall, the bottom part and the far part of the wall is kind of bright. Same as the blue wall.

Question is, what's causing this to happen? Has anyone come across this sort of problem before? Let me know, thanks! :worthy:

anubis
03-31-2006, 09:25 PM
This is a common artifact with photon mapping. Photons are generally gathered on a n closest basis. Close to the corners of walls, this means that photons will be included in the calculation that topologically belong to another wall. There are several solutions to this problem. AFAIK Jensen himself proposes a solution in his paper. Maybe this would be a good starting point for you.

Reedbeta
04-01-2006, 12:21 AM
Also, try removing the two spheres. They will alter the photon distribution in asymmetric ways, so if you're going to try to hunt down artifacts it would probably be best to do so without them.

rockster8
04-03-2006, 09:11 AM
anubis: which solution did jensen propose? maybe i missed it..
reedbeta: i'll try doing that and get back to you later when i work on it. :)

thanks guys, i'll look into it some more and get some results later.

davepermen
04-03-2006, 09:33 AM
i think the thing anubis is thinking off is to not sample a sphere surrounding your point, but an elipse squished in direction of the normal.


damn i can't write english anymore :D

rockster8
04-03-2006, 01:15 PM
is this the part i have to modify?

const float tmp = (1.0f/M_PI)/(np.dist2[0]); // estimate of density 1/(pi*r^2)

as far as i can remember in my highschool math, pi*r^2 is the area of a circle..
the area for an ellipse is pi*A*B, where A is the semi-major axis and B is the semi-minor axis. since we're transforming a sphere to an ellipse, A=B=r, so it will just end up as r^2, won't it?

Reedbeta
04-03-2006, 04:51 PM
It actually doesn't have anything to do with the area of a circle, it just does an inverse square falloff (1/r^2) and the 1/pi is some kind of proportionality factor, probably having to do with measuring things with respect to solid angle and so forth. But yes, it sounds like that's the right area to look in (I can't tell you that's the exact thing to modify or not without looking at the code).

bramz
04-04-2006, 03:09 AM
rockster8, I assume you directly use the photon map for estimating the incoming indirect light on the surface? This typically gives artifacts like yours. AFAIK, Jensen and others no longer do that. Instead, they go for a "final gather". In short, instead of directly using the photon map, they shoot a few rays in random directions, do the photon map trick there, and use that as information on the incoming indirect light.

PS. On the sphere vs ellipsoid thing: when using the final gather thing, this is much less of an issue.

Bramz

rockster8
04-04-2006, 01:47 PM
thanks bramz,
i thought it was a bug in the code. i'll look more into the "final gather" method to make things look better