Discussion about photon mapping.

Practical and theoretical implementation discussion.
Post Reply
shiqiu1105
Posts: 138
Joined: Sun May 27, 2012 4:42 pm

Discussion about photon mapping.

Post by shiqiu1105 » Thu Jul 05, 2012 4:56 am

Lately I have been trying to add photon mapper to my own ray tracer.

I have been taking pbrt and Jensen's book <Realistic Image Synthesis using Photon Mapping> as my primary references.
In the progress of reading, I have generated a few questions.

1. I have noticed that pbrt's PM implementation differs very much from that of Jensen's. For example, in Jensen's implementation, 2 photon maps (caustic and global illumination) were built, and in pbrt's version, 3 photon maps (caustic, indirect lighting and radiance) were built. They also differ in the way they partition the light transport equation, and the way to approximate lighting.

2. The way photons were shot is also different, in pbrt, photons were shot was a uniform distribution in the hemisphere along the normal, while in jensen's version, a cosine-weighted distribution was used. I understand that in this case jensen's method wins, (importance sampling issue) I just don't understand why pbrt sample light source with a uniform distribution.

3. The way photons are scattered are also very different. Jensen used russian roulette to decide whether particles are diffusely reflected, specularly reflected or terminated, whose probability depends on surface's reflectance(which I don't know how to compute, somebody pls help). And pbrt uses a total different technique.

4. pbrt doesn't use techniques like "projection map".

So I want to discuss with your folks before I start coding, which are the best strategies to choose when implementing my own PM.

graphicsMan
Posts: 167
Joined: Mon Nov 28, 2011 7:28 pm

Re: Discussion about photon mapping.

Post by graphicsMan » Sat Jul 07, 2012 4:34 pm

Whether you are better off shooting photons based on uniform or diffuse depends on your emission distribution. Choose what is right for your light sources.

I don't know about PBRT's implementation, as I haven't read that chapter, but when I implemented photon mapping a (long) while back, I used Jensen's book as a reference, and it worked fine. How is the radiance map used? Choosing Russian roulette probabilities is somewhat of an art form. I don't know if anyone has developed a really good heuristic for choosing these probabilities. Just don't choose the probability too low, as you'll get sparkles :)

What is the projection map? I don't remember this.

shiqiu1105
Posts: 138
Joined: Sun May 27, 2012 4:42 pm

Re: Discussion about photon mapping.

Post by shiqiu1105 » Sun Jul 08, 2012 6:35 am

graphicsMan wrote:Whether you are better off shooting photons based on uniform or diffuse depends on your emission distribution. Choose what is right for your light sources.

I don't know about PBRT's implementation, as I haven't read that chapter, but when I implemented photon mapping a (long) while back, I used Jensen's book as a reference, and it worked fine. How is the radiance map used? Choosing Russian roulette probabilities is somewhat of an art form. I don't know if anyone has developed a really good heuristic for choosing these probabilities. Just don't choose the probability too low, as you'll get sparkles :)

What is the projection map? I don't remember this.
Radiance map is basically to precompute the out going radiance for a small fraction of photons stored, and use the closest radiance photon's out-going radiance during the final gathering pass.
Projection map is a technique to rule the directions in which photons are shot from the light source, so to help the situation where objects in the scene are sparse and a lot of photons shot will hit nothing.

What do you mean by saying " depends on my emission distribution"? What's the correct distribution for a regular diffuse area light then?

graphicsMan
Posts: 167
Joined: Mon Nov 28, 2011 7:28 pm

Re: Discussion about photon mapping.

Post by graphicsMan » Sun Jul 08, 2012 1:03 pm

A regular diffuse area light will have a uniform distribution. However, due to the projected solid angle calculation, there is a cosine term, which means that you'll converge faster if you draw samples on a cosine distribution.

shiqiu1105
Posts: 138
Joined: Sun May 27, 2012 4:42 pm

Re: Discussion about photon mapping.

Post by shiqiu1105 » Sun Jul 08, 2012 3:21 pm

graphicsMan wrote:A regular diffuse area light will have a uniform distribution. However, due to the projected solid angle calculation, there is a cosine term, which means that you'll converge faster if you draw samples on a cosine distribution.
Okay, I guess I will modify that.
I wonder why pbrt doesn't do this though :)

ingenious
Posts: 282
Joined: Mon Nov 28, 2011 11:11 pm
Location: London, UK
Contact:

Re: Discussion about photon mapping.

Post by ingenious » Sun Jul 08, 2012 7:56 pm

shiqiu1105 wrote:I wonder why pbrt doesn't do this though :)
This actually has been a bug in PBRT since version 1, which I have reported but hasn't been fixed yet. PBRT's area light source does not account for the cosine neither when illuminating a shading point, nor for emission. I haven't tested personally, but due to this bug a path tracer with and without explicit direct lighting should output different results. The one without explicit direct lighting would be the correct one.
Image Click here. You'll thank me later.

Post Reply