🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

LightMaps

Started by
1 comment, last by AngryLlama 24 years ago
Ok...I know WHAT a light map is. I understand the theory. However.. i don''t know anything about multipass texturizing in OpenGL. Some source would be nice. -Paul
Advertisement
Multi-pass texturing is when you first draw the original texture (say a brick wall) and then after that you draw the lightmap on top of it, using blending to make the first look all nice and pretty. Here''s some OpenGL pseudo source for you:
glBindTexture(GL_TEXTURE_2d,texture[0]); // the original glBegin(GL_QUADS);   // draw the quad with texture coordinatesglEnd();glEnable(GL_BLEND);  // enable blending for lighmapglBlendFunc(GL_DST_COLOR,GL_ZERO);  // set blend functionglBindTexture(GL_TEXTURE_2D,lightmap[0]); // the lightmapglBegin(GL_QUADS);   // Draw the lightmap in the same place as the first quadglEnd();glDisable(GL_BLEND); 


There is the psedo code to do multi-pass texturing with OpenGL. Some video cards (most of the new ones) support single pass multi-texturing through extensions which you should look over since it will increase the speed quite a bit. Hope this helps!
Oops, forgot to log in, last post was from me if anyone cares. Cheers!

This topic is closed to new replies.

Advertisement