Skip to main content
gamedev.net
🔒 Locked

Lightmaps?

Started by NotTaxes Jul 29, 2001 at 4:23 AM 1 replies 300+ views
Original Post
NotTaxes
NotTaxes
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
'Doing the impossible is kind of fun' - Walt Disney
PSioNiC
PSioNiC
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
"This is stupid. I can't believe this! Ok, this time, there really IS a bug in the compiler."... 20 mins pass ..."I'M AN IDIOT!!!"
NotTaxes
NotTaxes
Cool. Thanks Psionic. That''s exactly the info I was looking for.

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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.