Jump to content
  • Advertisement
Sign in to follow this  
goznik

a question about VBOs

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

Hi, I just changed my game engine to work with vbos instead of glBegin.. and I use: glEnableClientState( GL_VERTEX_ARRAY ); glEnableClientState( GL_TEXTURE_COORD_ARRAY ); glEnableClientState( GL_NORMAL_ARRAY ); glDrawArrays( GL_TRIANGLES, 0, this->VerticesCount ); and it works perfectly. My problem is that I want to change the texture of some triangles in the model. Is there a way to send via glEnableClientState() a texture array?

Share this post


Link to post
Share on other sites
Advertisement
Basically no.
Each pipeline state change requires another render call.
But you can get away using some multi-texturing and possibly shaders.

Share this post


Link to post
Share on other sites
hey

I think it is actually recommended that you use glDrawRangeElements, rather than glDrawElements or glDrawArray, for reasons mentioned somewhere in THIS document.

As for drawing models with different textures on faces, what I do is I have different vertex indices for each texture used on the model. Ohh, and I store all these indices together in a single VBO.

So for each texture used, I just call glDrawRangeElements, specifying the relevent vertex indices.

I hope that made sense :).

cyas

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.

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!