Jump to content
  • Advertisement
Sign in to follow this  
Max_Payne

Photon Mapping : Direct Illumination

This topic is 4879 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

So far I have been doing direct visualisation of the photon map. I am wondering how to go about using it only for indirect illumination. I will be using distributed raytracing to randomly sample light sources with shadow rays for direct illumination. This will give me a value for the direct lighting contribution of each light... But how about indirect illumination? Jensen seems to be suggesting that there are no modifications to make to the photon map. It would seem to me, however, that one would want to store only photons from the second hit and up, to actually filter the direct illumination *out* of the photon map, no? Also, about direct illumination. Supposing I have a rectangular light source, and I sample it at 30 random points. Do I simply take the number X of points that deliver light to the current surface point, and say that the light power received by the surface point is X/30 * LightPower , or do I have to account, for each point, of the probability of emitting a ray in that direction, by multiplying the ray's power by the cosine of the ray direction and light surface normal. If so, is it still necessary to multiply the light power by the cosine of the ray direction and the surface normal (for the lambertian radiance).

Share this post


Link to post
Share on other sites
Advertisement
If you followed Jensen correctly, you will have three separate photon maps: A direct map, an indirect map, and a caustic map. To use regular whitted style raytracing for direct illumination, simply don't use your direct photon map.

Quote:

Also, about direct illumination. Supposing I have a rectangular light source, and I sample it at 30 random points. Do I simply take the number X of points that deliver light to the current surface point, and say that the light power received by the surface point is X/30 * LightPower , or do I have to account, for each point, of the probability of emitting a ray in that direction, by multiplying the ray's power by the cosine of the ray direction and light surface normal. If so, is it still necessary to multiply the light power by the cosine of the ray direction and the surface normal (for the lambertian radiance).


I suggest brushing up on the theory of Monte Carlo integration. If your samples are uniformly distributed, then it is simply X/30 * LightPower. If your samples are pulled from a cosine weighted distribution, then you need to account for that in your integration. Here's the best reference I could find doing a quick google run:

Monte Carlo Integration and Importance Sampling

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!