Jump to content
  • Advertisement
Sign in to follow this  
thedigga007

OpenGL Multi-stage rendering and texture matrices

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

So I am using the glActiveTexture(GLenum texture) function for multiple texture stages in my current OpenGL app, however I am some what confused as to setup texture matrices for each of those stages. I've read the documentation and there is no information on how texture matrices are handled for each stage. I guess my question is would something like this be legal:
glActiveTexture(GL_TEXTURE0);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, textureID);
glMatrixMode(GL_TEXTURE);
glLoadMatrixf((GLfloat*)&textureMatrixOne);

glActiveTexture(GL_TEXTURE1);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, textureID);
glMatrixMode(GL_TEXTURE);
glLoadMatrixf((GLfloat*)&textureMatrixTwo);
If not how would I do something like that?

Share this post


Link to post
Share on other sites
Advertisement
Yup, that should do what you're intending. Although I don't think you need to specify the glMatrixMode(GL_TEXTURE) more than once at the start in the example you have there (I guess it does help with clarity, though).

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!