Archived

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

Creating Lightmaps

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

Hi, I''m looking for some good articles about _creating_ lightmaps (not about displaying them!). I don''t need something advanced like radiosity. something simple would be great. Has anyone some links? thx, fallen

Share this post


Link to post
Share on other sites
For each lightmap texel, for each light, see if the light is occluded. If it is not, then add a lighting value to the texel corresponding to that light.

The light intensity will be proportional to the dot product of the polygon''s normal and the ray from the texel to the light. It will also be inversely proportional to the square of the distance between the texel and the light.

Red, blue, and green values can be added seperately.

You said you weren''t interested in radiosity. However, if you really do want to try it out after you get your simple lightmap generation code working, it''s pretty simple. Just perform the process repeatedly, treating each texel as a light source.

Share this post


Link to post
Share on other sites
Thx, sounds good. But is there some sample code anywhere in the web? Something like how to get the world coordinate of a texel, etc would be great. Pseudo code would be enough, I think...

Share this post


Link to post
Share on other sites