Jump to content
  • Advertisement
Sign in to follow this  
ff8

MultiTexturing using VA/VBO

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

Hello everyone , i want to make multitexturing for object that i used VA for saving/drawing it can anyone tell me how can i make it for 2 texture or more ^^? thank you . cya,

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by ff8
Hello everyone ,
i want to make multitexturing for object that i used VA for saving/drawing it
can anyone tell me how can i make it for 2 texture or more ^^?
thank you .
cya,
You have to do the same thing you do when multitexturing in immediate mode; pass in more than one texture coordinate for each vertex. To do that you just pass a texture coord array with glTexCoordPointer for each client texture unit. And remember to enable the texture coord array for each one. You will of course have to do more such as binding/enabling a texture on each texture unit, but here's basically what you need for passing the texture coordinates...
glClientActiveTexture(GL_TEXTURE1);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, tex1coords);

glClientActiveTexture(GL_TEXTURE0);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, tex0coords);
Also rememer to disable the texture coord arrays for each texture unit when you don't need it.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!