PDA

View Full Version : Q: vertex arrays + multitexturing



kawasakis900
01-22-2003, 05:53 AM
hello.

i want to draw something using vertex arrays.
i have the texture coordinates, but they are not equal for each texture unit. (for each vertex i have 2 texture coordinates for texture unit 0. so far no problem. but when i want to feed glMultiTexCoord2fARB() for texture unit 1, i want another pair of texture coordinates which have to do with the first pair. in other words i have 4 texture coordinates (2 for each texture unit). i use glDrawArrays() for drawing the geometry).
my question is how glDrawArrays() will "understand" that i have 2 texture units with different texture coordinates?

any help would be appreciated.
thanx in advance for your time.

Bob
01-22-2003, 06:08 AM
You set texture coordinate pointer and enable the texture coordinate array for each texture unit.



glClientActiveTexture(GL_TEXTURE0);
glTexCoordPointer(...);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);

glClientActiveTexture(GL_TEXTURE1);
glTexCoordPointer(...);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);

And so on, for each texture unit.

kawasakis900
01-22-2003, 07:27 AM
thanx bob. the code was very helpful. it was just what i was looking for...