Hi!
Textures have nothing to do with
vertex-arrays. You still can use as many textures as you want but in an vertex array every vertex can only have ONE texcoord and you cannot change the current texture during the functions used to render vertex-arrays
(glDrawElements(),…).
HTH, XBTC!
[This message has been edited by XBCT (edited 01-23-2001).]
One small correction to XBCT’s answer. You can have one texture co-ordinate per texture per vertex, i.e. when using two texture stages, there are two texture co-ordinate arrays. However, he is correct about not being able to change the textures during a call to glDrawArrays or glDrawElements.
Hi!
Sorry…DFrey is correct.I just forgot to mention the case with multitexturing enabled…
>So i guess the best way to use several textures on a vertex grid is to use a display list?<
It is really no problem doing it with vertex arrays. You just group your faces by texture and render every group in one
glDrawElements() call. Which method is faster for you depends on your app…
If you give us a more detailed description(Is your geometry static?) we might be able to help you…
Read the multitexture spec in the OpenGl 1.2.1 pdf. In short, it says:
-you can use multitexture with vertex arrays
-you can specify as much texcoord arrays as multitexture stages your hardware support (via glClientActiveTextureARB)
-you can have as much current textures as multitexture stages your hardware has (via glActiveTextureARB,GL_TEXTURE0_ARB, GL_TEXTURE1_ARB, etc )
Of course, you cant change states inside a glDrawElements call, but you can break your geometry in various glDrawElemtents calls if you’re not making too much calls.