Jump to content
  • Advertisement
Sign in to follow this  
ChickenMcOwnage

Lighting help with display lists

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

I'm currently writing a game set exclusively in dark dungeons. The maps and walls are simple, basically orthogonal, although I have heightmaps for floors and ceilings as well as things like staircases, ramps, arches, and cliffs. The maps are randomly generated at the start of the level, and smallish chunks are loaded into display lists. Since the player can't see very far in front of him, only the display lists very near him are drawn. At the moment, I'm using black fog to simulate lighting (like the player is holding a torch or something) and I'm really wishing that it looked better. I was thinking that bump mapping would be a good way to make the simplistic maps look more realistic, however I don't know how to incorporate bump mapped lighting with display lists like this. Another thing I'd really like to have is lightsources other than the player's, for example, lava flows, torches carried by goblins, or candles/torches randomly placed around the map. I'd like lightsources to be colored and able to flicker. Specular lighting (for slimy surfaces) and bump mapping would be wonderful features, but not necessary. So on to the question: what kind of lighting should I use? What are my options? I've tried the standard ogl lighting, but I just couldn't get things to look right. I've considered faking the lighting by coloring each wall, floor, and ceiling vertex, but as far as I know, that can't be done if the quads are called from display lists. What options do I have to acheive the dynamic lighting I'm looking for? Thanks very much, ~Mark

Share this post


Link to post
Share on other sites
Advertisement
if u want to use bump mapping, or better, any kind of lighting algo for dynamic lights, try using vertex/fragment programs, maybe with glsl or cg. There're a lot of tutorials and sources on the net.. try on www.lighthouse3d.com, there's a section on glsl,explainig everything from basis.

when you build the display list, you could compute the tbn matrix for every poly and pass tangent and binomial as 3d coords for texture1 and texture2 (using glMultiTexCoord3f() ), then compute the lighting equation in a vertex program :)

Share this post


Link to post
Share on other sites
I think that if you set the material values right and do it right, the STD OpenGL lighting could probably be just fine. Also remember, if you have small display lists as chunks of the level, then you are going to have to draw around the other light sources as well, not only the player. I recommend drawing it like that. I have never used shaders, but they definetly can be used for this purpose and probably will look better than any standard lighting algorthm.

Share this post


Link to post
Share on other sites
Okay so I've been using glsl to write vertex and pixel shaders, and my program can finally recognize and use the shaders. At this point, however, I'm really not sure how to pass the textures (the texture as well as its normal map: both stored in the display list) into the shaders. If I use glActiveTextureARB to get the 2 textures into the display list, how can the shaders pick them out and process them? Also, if anybody has any good links on glsl tutorials or whatnot, that would be great. The only decent one I found was at lighthouse3d (thanks b3rs3rk) but those are very thin in parts.
Thanks very much,
~Mark

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!