Jump to content
  • Advertisement
Sign in to follow this  
Wembley

Photon Map Power Scaling

This topic is 4547 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In my photon mapper, I am having problems with the scaling of photons. In Jensen's book it says to scale each photon by 1.0/number_of_photons_emitted_for_the_light, however, this makes the direct visualization of the photon map completely black. I have the lights in my renderer stored as an RGB color in the range 0 to 1 and an intensity stored with the range 0-infinity. The only way that I can get the direct visualization to show up correctly is if I scale the irradiance estimate back up to the number photons emitted. Does anyone have any ideas as of what I am doing wrong?

Share this post


Link to post
Share on other sites
Advertisement
It's all a matter of units and scale. If you divided the intensity of each photon by the number of photons and you didn't see anything, then it indicates that your original light source simply wasn't intense enough to light the scene in the given units of scale. However if you get a better visualization with the current per-photon intensity, then you can just reverse the equation to show that an appropriate light intensity is on the scale of number_of_photons * photon_intensity.

Share this post


Link to post
Share on other sites
I had a problem like this, but I'm not sure if it was caused by the same thing that is causing your problem. Basically, in my direct lighting, I had forgotten to divide the power of the light by 4 PI, so the direct lighting was 12 times too bright and the photon map was correct, but I spent many weeks trying to figure out what was wrong with the photon map (nothing was wrong with it).

Share this post


Link to post
Share on other sites
I think I may have found what was making the results off. In the direct lighting, I was multiplying the result by the surface area of the light instead of using the solid angle. The scene I'm rendering is the Cornell Box using the data from http://www.graphics.cornell.edu/online/box/data.html. What sort of range would the intensity of the lights for that scene be? The scene seems to be rather large (~550 units in all directions) compared to the 9" real box they made. Thanks for the help.

Share this post


Link to post
Share on other sites
550mm ~ 1.8'

That page doesn't mention any other physical measurement, and I can't find the figure 9" anywhere.

However this page mentiones another physical Cornell box model that has the dimensions 9". Perhaps you have confused those two?

Share this post


Link to post
Share on other sites
I just use trial and error. ;)

Before I'm accused of being a lamer, sometimes I do find it's useful to have an intensity value that you can change per-scene. I occasionally find that when entering photon intensity values for a light source that the light doesn't propagate into an area as much as I'd like, yet a different source will be quite bright, so I generally like to try and balance these out.

I spent ages trying different ways of scaling the final value, but I ended up going with what looked nicest. This happened to be Jensen's way for me, but it could be different depending on the way you're casting/gathering your photons.

Share this post


Link to post
Share on other sites
Quote:
Original post by WembleyThe only way that I can get the direct visualization to show up correctly is if I scale the irradiance estimate back up to the number photons emitted. Does anyone have any ideas as of what I am doing wrong?


Yes, the only reason you want the photon intensity to be linearly dependant to 1/number of photons is so that the total intensity stored in your scene is constant no matter how many photons you sent.

It doesn't tell you what intensity is suitable in your scene and that is NOT a problem with photon mapping but a general problem with lighting. If you use a point light and do direct lighting, you should take into account the decay in 1/r2 of the light intensity (that is already nicely taken care of in photon mapping). That means that a surface at a distance of 1 will be 100 more bright that a surface at a distance of 10. And so : you either need to scale your light at the source so that for your scene the observed intensity fits nicely inside your fixed range (without too much saturation or without dark areas). Or go for a more advanced tone mapping function (trying to represent a range that changes radically from one part of the image to the other).

LeGreg

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!