Jump to content
  • Advertisement


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


glDrawElements with multitexturing

This topic is 5823 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 need to render a textured object then apply envirnment mapping. I can`t use multitexturing because I use glTexCoordPointer(). help me please. thanks.

Share this post

Link to post
Share on other sites
Use two tex coord arrays and set pointers for each texture unit:

glTexCoordPointer(3, GL_FLOAT, 0, @texturearray1);
glTexCoordPointer(3, GL_FLOAT, 0, @texturesarray2);

That should do it

Share this post

Link to post
Share on other sites
1. this question has been answered several times before. Please search the forums before asking the question.
2. the answer already resides in OpenGL specifications - the very least document you should have if you want to work with OpenGL.
3. there is a reply on your topic at opengl.org forums
4. yes BlueCat solution works even though I would add glEnableClientState(GL_TEXTURE_COORD_ARRAY) for each texture unit
5. for environment mapping, there is another solution that does not use the glTexCoordPointer for the second texture unit : map the texture coordinates 'automatically' using GL_SPHERE_MAP.

For the fifth point, you can do something like this :
glClientActiveTextureARB(GL_TEXTURE0_ARB); // or glActiveTextureARB(GL_TEXTURE0_ARB) if all your texture coordinate pointers are used in the first texture unit.

[edited by - vincoof on October 16, 2002 1:11:16 PM]

Share this post

Link to post
Share on other sites
The search feature is temporarily disabled while we patch some security holes in it. We apologize for any inconvenience.

Please don''t email us asking when the search will be back up. It will be restored "when it''s done"


Share this post

Link to post
Share on other sites
It will be restored "when it''s done"


''k, then you can skip my point #1 even though this is still a good suggestion for forums where the search feature is available (like at opengl.org)

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!