Archived

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

PmanC

radiosity

Recommended Posts

hey again... i was researching radiosity and i understand the concept, but when i went to code it i ran into a problem. When you create the ''patches'', do you break up the geometry, or do you make lightmaps? -PmanC

Share this post


Link to post
Share on other sites
Radiosity takes as input a set of geometry, so you want to start by tessalating your geometry to the point until it''s reasonably smooth and the patches are small enough, otherwise you get jagged shadows and such.

The output, however, is a stable camera-independent diffuse solution, so you can project the lit patches back into the original untesselated geometry and save the lighting to texture.

You can use the concept of a lightmap if you want to treat each pixel in the map as a patch, but be aware that you have to store not only the lighting information for each patch but also its Form Factor coefficients to all the other patches, which forms a nice NxN matrix, where N is the number of patches.

Good luck coding! It took me two years to get a (modified) radiosity algorithm to run in under an hour. Check it out:

http://sky.prohosting.com/levinier/gamedev/radiosity.html

Tom

Share this post


Link to post
Share on other sites
quote:

You can use the concept of a lightmap if you want to treat each pixel in the map as a patch, but be aware that you have to store not only the lighting information for each patch but also its Form Factor coefficients to all the other patches, which forms a nice NxN matrix, where N is the number of patches.


That''s a very naive version of radiosity (matrix radiosity), and is pretty much unusable on any realworld geometry (takes way to much memory). You should look into progressive refinement radiosity instead.

For a quick introduction, take a look at this site. Note that that tutorial uses progressive gathering, for better quality you can convert it to shooting, if you want.

Share this post


Link to post
Share on other sites
another question... when i import the geometry from some model file, do i subdivide and create a lightmap for each face, or for each wall. and if it is for each wall, how do i know the difference between a face and a wall? -PmanC

Share this post


Link to post
Share on other sites