# Approximating Diffuse Indirect Illumination

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

## Recommended Posts

Hi,

currently I am working on a new algorithm for realtime indirect illumination for my master thesis but I am not very versed in the mathematics of it. The goal is not to create stunning photorealistic images but rather the development and performance of the algorithm. Nevertheless I would like to generate images which are heading into the right direction in the sense of the math behind it.

At the moment I use phong shading as the illumination model for direct lighting.

The situation in my algorithm is the following:

I have something like photons in my scene. To gather indirect light for one photon I render the scene from its perspective. Assume only those fragments are rendered which are directly illuminated by a light source. To only account for diffuse indirect illumination I thought I could compute the diffuse color value with the phong model for every rendered fragment. Then all this values are summed up and divided by the number of rendered fragments. The resulting values (for every R,G,B channel one value) will be the indirect diffuse lighting part of the photon at its particular position.

Am I correct so far? Is this mathematically wise a reasonable approximation of the inidirect illumination?

The next question is what to do with this photon? Assume I render the scene from the perspective of my camera and a fragment with such a photon at its position is rendered. How do I incorporate the photon's diffuse color value in the lighting computation when using the phong model? My idea so far is to add the photon's diffuse color to the final color value (result of only direct lighting computation) of the fragment . Maybe with an appropriate weight factor to prevent overexposure.

Best Regards,

Stan

##### Share on other sites

If you do not understand the mathematics (and physics?) of indirect illumination, why are you trying to come up with a real-time algorithm for it? The first step to solve any problem (and thus also creating an algorithm for that) is indeed to understand it in depth. You should have at least looked for algorithms doing the same thing!

I find your description very confusing. I am not sure I understand what you mean by "photon" in your algorithm. A photon is simply light, there is no direct or indirect contribution. It also look quite expensive since you probably need to render your scene for a lot of photons and (I guess) store these render buffers in several textures. You will then need to retrieve all these information in some way in the final pass.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 15
• 9
• 11
• 9
• 9
• ### Forum Statistics

• Total Topics
634136
• Total Posts
3015755
×