Archived

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

NotTaxes

Lightmaps?

Recommended Posts

I am trying to get smooth-shaped lighting effects working. For example, when I have a torch burning, I would like to light-up a circular area of the ground around it. If I use dx lighting, it doesn''t look too good because polygons around the light are comparatively large, and instead of looking like lighting it looks like triangles with a color faded across them. Apparently I can get the required result by using a lightmap but I can''t get my mind around the idea properly, based on the tuts and resources I''ve found. Anyone know where I can find a really simple example or top-down explanation? ''Doing the impossible is kind of fun'' - Walt Disney

Share this post


Link to post
Share on other sites
A lightmap is just a multitexture, set with certain texture stage states. You probably have seen light-maps before, but incase you haven''t, its just a texture with a white blob in the middle. The very center pixel is perfectly white and the borders are perfectly black. All the other pixels are just the fading from the center white pixel to the outer black pixel.

Just place these textures as multitextures around where your fire is. So if your fire was the the very center of a square room, place these multi-textures on the ceiling, floor and all four walls. You also have to set certain texture stage states so that where the second texture is of a lighter color of white, it brightens up the first texture. Check out the MFC Multitexture example in the SDK to see which tss''s to set

Share this post


Link to post
Share on other sites
Cool. Thanks Psionic. That''s exactly the info I was looking for.

''Doing the impossible is kind of fun'' - Walt Disney

Share this post


Link to post
Share on other sites