Sign in to follow this  

a question about VBOs

Recommended Posts

goznik    122
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
yosh64    100

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 :).


Share this post

Link to post
Share on other sites

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