Jump to content
  • Advertisement
Sign in to follow this  
jocasa

GLSL and glTexEnv

This topic is 2641 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!