• Advertisement
Sign in to follow this  

Texture in VertexArray

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

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
Advertisement
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
Sign in to follow this  

  • Advertisement