Sign in to follow this  

a question about VBOs

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

This topic is 3809 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this