Jump to content
  • Advertisement
Sign in to follow this  
Desa

OpenGL GL_ADD substitute for OpenGL 1.1

This topic is 3819 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

I'm using the following code to tint a black and white texture.
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD);
glColor3ub(r, g, b);
Is there a way to accomplish the same thing with OpenGL 1.1? It doesn't support GL_ADD. Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Wouldn't multiply be better than add anyway? That way you would tint the image without changing the brightness and contrast?

If that won't work you could render your object twice, I'm pretty sure 1.1 supported additive framebuffer blending.

Are you sure you need to support 1.1? Are you running this on a windows box without an OGL driver? Maybe you could use Mesa.

Share this post


Link to post
Share on other sites
Could you give me more info about additive framebuffer blending? I haven't done that before. Any examples would be greatly appreciated. Thanks.

Share this post


Link to post
Share on other sites
You'll use two passes. In the first pass render the object with the texture, but don't use color. Then turn off the texture and render the object again with the color you want. For this second pass use blending:


glEnable(GL_BLEND);
glBlendFunc(GL_ONE,GL_ONE);


This will add the colors from the second pass to the colors from the first pass. There are other options as well if you want to use alpha to control the blending. For more details on glBlendFunc, see MSDN.

This wouldn't be the way I would do it on modern hardware, but it should work on 1.1.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!