Mixing fixed function and vertex programs (shaders)

Hi,

I want to use fixed functions for first rendering pass (ambient and depth) and VP + FP for other passes. Im not sure what’s to do with glEnableClientState(GL_VERTEX_ARRAY) and glEnableVertexAttribArrayARB(0). Should I call both functions or glEnableVertexAttribArrayARB(0) are enough? This question is also for other attributes (NORMAL, COLOR, TEXCOORD,…).

What happend when I try to use several UV sets, Should glEnableVertexAttribArrayARB(texN_index) replace glClientActiveTextureARB() and glTexCoordPointer() combination?

Maybe is spec clear about this questions and I miss something. It will be nice to someone explain me this.

yooyo

yooyo, you can just use the glEnableClientState(…) flavor if you like. For tex coords, use glClientActiveTextureARB(…) before you set each tex coord pointer:

glClientActiveTextureARB( GL_TEXTUREi );
glTexCoordPointer( numElems, type, stride, texCoords );
glEnableClientState( GL_TEXTURE_COORD_ARRAY );

@portal

You didn’t understood me. Can I use glEnableVertexAttribArrayARB(…) instead of old glEnableClientState() even with a fixed funcition?

yooyo

Haven’t tried it, but it seems unlikely that gl…Attrib were meant to be used with fixed function.