Jump to content
  • Advertisement

Archived

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

iNsAn1tY

OpenGL Multi-texturing in OpenGL...

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

Merry Christmas to everyone!!! I was just wondering if anyone knew how to do multi-texturing in OpenGL? I know Quake III uses multi-texturing when you put it in Lightmap mode, because when you shoot something like a rocket across a surface, the circular lighting map for the rocket is superimposed on top of the surface''s texture, but in a specific position (try it yourself). I''m writing a 3D engine, and I''d like this to be my primary kind of lighting. I can create the lightmaps before hand, when I make the actual maps, and it really does give a good sense of realism. I know it may have something to do with OpenGL extensions, but any suggestions would be helpful...And again, Merry Christmas! iNsAn1tY - the place where imagination and the real world merge... Try http://uk.geocities.com/mentalmantle

Share this post


Link to post
Share on other sites
Advertisement
one possible method (there are a lot of possibilities)

glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, texture0);

glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, texture1);

glBegin(GL_QUADS);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0,0);glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0,0); glVertex3fv(corner1);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1,0);glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1,0); glVertex3fv(corner2);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1,1);glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1,1); glVertex3fv(corner3);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0,1);glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0,1); glVertex3fv(corner4);
glEnd();

there are a lot of examples on the net use google also download the opengl1.3spec from www.opengl.org it has a thorough description

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You don''t necessarily need multitexturing to do lightmapping. You can also do it with a single texture unit, using two passes.

Share this post


Link to post
Share on other sites

  • 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!