Sign in to follow this  
Daivuk

Texture in VertexArray

Recommended Posts

Ok, i'M drawing my map using vertex array. (indoor map, stored in a octree for drawing) TexCoordArray, ColorArray and NormalArray. But, in my array, I can have more than one texture. So, hhow to specify the texture to be use for each? Like a texturePointer Array? thanks

Share this post


Link to post
Share on other sites
I think have to set a new texture before each rendering call. So you have to set a texture, render polygons corresponding to the texture using the buffer, set another texture, render again, and so on.

Share this post


Link to post
Share on other sites
you can multi-texture and render more than one at once.

todo so you have to set the current client state to the texture unit you want and then supply a pointer to the texture coords as you would normally

Share this post


Link to post
Share on other sites
No need to render multiple times, as phantom said, you can use multitexturing to render multiple textures in one pass:

for( int a = 0; a < max_textures; a++ ) {
glClientActiveTexture(GL_TEXTURE0 + a);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(...stuff...);
}

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