Skip to main content
gamedev.net
🔒 Locked

Multitexturing and Vertex Pointers

Started by skyfire360 Jun 11, 2004 at 8:37 AM 2 replies 650+ views
Original Post
skyfire360
skyfire360
How would one go about multitexturing with vertex pointers? As far as I can tell, you can only have one texture active when you have a textcoord pointer O.o
I do real things with imaginary numbers
mrbastard
mrbastard
something like

glClientActiveTextureARB(GL_TEXTURE1_ARB);
glTexCoordPointer(blah);

the only hard bit is remembering that you need to change the glActiveTexture to change the texture unit''s tex env, but change glClientActiveTexture to change the tex coord pointer.
[size="1"]
skyfire360
skyfire360
Wouldn''t that take multiple passes though?

Say, for instance if you were trying to have three textures on one set of elements...

glClientActiveTextureARB(GL_TEXTURE0_ARB);
glTexCoordPointer(...);
glDrawElements(...);
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glTexCoordPointer(...);
glDrawElements(...);
glClientActiveTextureARB(GL_TEXTURE2_ARB);
glTexCoordPointer(...);
glDrawElements(...);

Is it possible to do something along the lines of...

glClientActiveTextureARB(GL_TEXTURE0_ARB);
glTexCoordPointer(...);
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glTexCoordPointer(...);
glClientActiveTextureARB(GL_TEXTURE2_ARB);
glTexCoordPointer(...);
glDrawElements(...);
I do real things with imaginary numbers
mrbastard
mrbastard
???

yes, you set them ALL before calling drawelements or whatever.
[size="1"]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.