PDA

View Full Version : question about HLSL



www
11-11-2006, 03:29 AM
I understand that shading language has offered the great flexibility to the program. However, for some vertexes I need such flexibility, while for other vertexes the fixed functionality is fine.

My question is in the vertex/fragment shader, how do I differentiate between the vertexes/fragments that needs some special treatment and ones that fixed functionality functions is fine. It seems that all vertex/fragment undergo the same way.

Thanks

dobradusa
11-11-2006, 03:51 AM
In the topic title, you probably meant GLSL, not HLSL. I don't believe anybody would want to discuss DirectX on an OpenGL forum.

About your question - if you need shaders for one object and not for the other, you simply enable/disable shaders (e.g. by using glUseProgram) accordingly. Otherwise, I suppose you could write a shader that accepts some vertex attribute and either does it's thing or simulates the fixed functionality, depending on the attribute value.