Lighting a dark hallway

Alright, I’ve readup on a lot of lighting techniques… lightmaps, tesselation, per pixel, etc. I’m still not sure the best way to go about lighting my dungeon. The concept I thought of before looking into lighting was to make the whole dungeon dark, and then have the light sources generate the light (imagine that).

After reading a ton of stuff, it seems the best way to go these days is still lightmaps. We all don’t have geforce 3s yet. My problem though… is all the examples of lightmaps I’ve seen are actually shadowmaps… they apply “darkness” not light to the texture.

Now… my basic question is… is there a way to do what I have envisioned before via lightmaps. That is, have the whole dungeon be dark, and apply light. Is there a way to achieve this via blending or multitexturing? It seems to me that if this is possible, it’d be the easiest/fastest way to do lighting in my particular case. That way I don’t have to worry about shadowmaps lining up perfectly, etc.

Any help or criticism is greatly appreciated.

Oh yeah… I am using vertex arrays… though that shouldn’t really matter for anything.

you cvan lighting things using the GL_ADD texture environment mode or using blending with GL_ONE,GL_ONE they both do the same things though the first is quicker

The problem is that multiplying “upwards” suffers from resolution problems. If your intial texture is dark (ranges from 0-15, say) and you want to multiply up to 255, you can multiply by an amount of 17, but that still leaves you with only 16 discrete values.

If you “add” instead, then there will be little to no distinction between the various color components, so they’ll look very washed out.

Full-bright textures and multiplicative light/shadow maps are really the highest-quality way of doing it, and is natively supported as a single-pass operation in all current (and previous) generation hardware. Really, there is no difference between “light maps” and “shadow maps” as one is just the inverse of the other :slight_smile:

Well, before trying lightmaps, I tried out 2-pass rendering with the blend func at (GL_ONE, GL_ONE)… this worked, but the texture was pretty washed out. I tried to fool around with other blending settings, but none of them produced what I wanted.

The multitexturing lightmap looks pretty good… I guess I’ll just have to do it that way. I have a concept question though. Say I have a long hallway with 5 torches in it or something. I’d have to create a single texture that has all 5 of those lights on it, right? I don’t see how else I can do multitexturing if the wall in a hall is one long polygon.

Hmm and this stuff confuses me when it comes to lightmaps created by dynamic objects. Which was the whole reason I wanted to do it the other way around if possible. Sigh.

yes im ( + i guess everyone else ) basically do what jwatte saiz + use very bright textures and just darken them, its the standard way.

Well… after thinking about it a bit… I think I can get everything working as long as I find an answer to this question: how would I go about putting an additional lightmap into a surface. That is to say, I have one static lightmap on a surface, and when a dynamic light source comes along, how do I get the new lightmap to place nice with what is already there? Can I blend the two lightmaps together somehow and then multitexture it onto the surface, or what?

I’ve searched around a bit, and couldn’t really find a satisfying answer.