GLSL and glTexEnv

Started by
2 comments, last by jocasa 12 years, 7 months ago
Isn't it strange that glTexEnv still functions when using GLSL shaders? Shouldn't it be disabled after having called glUseProgram? Specifically, the effect of glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD) for example, affects how pixels are combined independently of what you have coded in your shaders.

Perhaps I am missing something...
Advertisement
Assuming a GL 2.x context, the vertex and fragment processing pipelines can independently be switched from fixed function to shaders. If your shader program contains a vertex shader without a fragment shader, then enabling it will leave the fixed function fragment processing active (and vice-versa).

Except for specific cases, it's generally not considered good practice to do that though.
This may be driver-dependent behaviour. Per the specs, glTexEnv should have no effect whatsoever, but your driver may be taking shortcuts, including not checking if shaders are being used before setting glTexEnv modes.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

I was using fixed functionality in some parts of the program without being aware of this. That's why this command made its effect. Now I wrote shaders, made a program and used it.

Thanks for the info!

This topic is closed to new replies.

Advertisement