PDA

View Full Version : Mixing fixed function and vertex programs (shaders)



yooyo
04-22-2004, 02:34 PM
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

plasmonster
04-22-2004, 03:03 PM
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 );

yooyo
04-23-2004, 12:26 AM
@portal...

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

yooyo

Christian Schüler
04-23-2004, 12:38 AM
Haven't tried it, but it seems unlikely that gl...Attrib were meant to be used with fixed function.