Archived

This topic is now archived and is closed to further replies.

Blaster

Radiosity - Prog. refinement - Emissive patches getting more energy

Recommended Posts

I have a lightmap generation tool working fine. It uses phong shading. Now I've been trying to implement a simple radiosity system to replace the phong shading. I'm using the progressive refinement technique and no hemicube, only form factor. I'm also not using the patch/element method, I only have patches. So each lightmap pixel is a patch, they all have the same area. Imagine this. Patch A, B and C initially emit light at the same intensity and color and they are very near each other. Patch A is thus the patch with the most energy, so it emits first. Lets say all 3 patches started with an energy of 1. After the patch has emitted its energy, patch B and C have lets say an energy of 1.1 (0.1 from patch A plus their initial energy 1.0). So now the one with the most energy is patch B, which emits light to patch A and C. Patch A now has 0.1 and patch C has 1.2 (1.0 from itself, 0.1 from A and 0.1 from B). Patches are always getting more and more energy. Since I have a very big object that emits light, I have lots of emitting patches. So after a while the patch with the most energy has more and more energy and everything just keeps growing very fast. Is this normal? What should I do? Thanks. Edit : I have read Paul Nettle's Radiosity in English 1 and 2. I've also read a PDF from the guy behind the Fly3D engine. I read Hugo Elias's acticle, and tons of others. ---------------- Blaster Computer game programmer and part time human being Strategy First - http://www.strategyfirst.com Blastersoft - http://www.blastersoft.com [edited by - Blaster on August 12, 2003 12:19:13 PM]

Share this post


Link to post
Share on other sites
I see where your problem (probably) lies. It''s adding the 0.1 from A to the 1.0 at B and C. Each patch needs TWO energy levels, one for energy coming in, the other for energy going out. Thus, after distributing energy from A, this would leave:

A: in = 0, out = 0.
B: in = 0.1, out = 1.0
C: in = 0.1, out = 1.0

Then you distribute from B:
A: in = 0.1, out = 0
B: in = 0.1, out = 0
C: in = 0.2, out = 1.0

Then C:
A: in = 0.2, out = 0
B: in = 0.2, out = 0
C: in = 0.2, out = 0

Note: this doesn''t take into account any other surfaces/patches.

When all the patches have had their ''out'' energy distributed:

for (all patches)
{
patch.out = patch.in;
patch.in = 0;
}

and then continue looping through the passes.
Setting patch.in = 0 each time prevents the energy from increasing each pass. By distributing it around, the energy that starts in the emitters is slowly spread around the surfaces, until it settles as near as required to zero. This would be the point where the loop would end.

Hope that helps, and hope I''m correct, I haven''t had the chance to implement the theory as yet, my lightmapper''s dead in that water at the mo.


Share this post


Link to post
Share on other sites
Cool!

I tried something like that before, but I was putting the ''in'' in the ''out'' anytime ''out'' was empty, not when all the ''out'' were empty.

I hope it works.

----------------
Blaster
Computer game programmer and part time human being
Strategy First - http://www.strategyfirst.com
Blastersoft - http://www.blastersoft.com

Share this post


Link to post
Share on other sites