Jump to content


Photon Mapping artifact


8 replies to this topic

#1 rockster8

    New Member

  • Members
  • Pip
  • 4 posts

Posted 01 April 2006 - 04:22 AM

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:

Posted Image

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:

#2 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 01 April 2006 - 05:25 AM

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.
If Prolog is the answer, what is the question ?

#3 Reedbeta

    DevMaster Staff

  • Administrators
  • 4782 posts
  • LocationBellevue, WA

Posted 01 April 2006 - 08: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.
reedbeta.com - developer blog, OpenGL demos, and other projects

#4 rockster8

    New Member

  • Members
  • Pip
  • 4 posts

Posted 03 April 2006 - 04:11 PM

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.

#5 davepermen

    Senior Member

  • Members
  • PipPipPipPip
  • 1306 posts

Posted 03 April 2006 - 04:33 PM

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
davepermen.net
-Loving a Person is having the wish to see this Person happy, no matter what that means to yourself.
-No matter what it means to myself....

#6 rockster8

    New Member

  • Members
  • Pip
  • 4 posts

Posted 03 April 2006 - 08: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?

#7 Reedbeta

    DevMaster Staff

  • Administrators
  • 4782 posts
  • LocationBellevue, WA

Posted 03 April 2006 - 11: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).
reedbeta.com - developer blog, OpenGL demos, and other projects

#8 bramz

    Valued Member

  • Members
  • PipPipPip
  • 189 posts

Posted 04 April 2006 - 10: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
hi, i'm a signature viruz, plz set me as your signature and help me spread :)
Bramz' warehouse | LiAR isn't a raytracer

#9 rockster8

    New Member

  • Members
  • Pip
  • 4 posts

Posted 04 April 2006 - 08: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





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users