Jump to content
  • Advertisement
Sign in to follow this  
MarcusMaximus

Changing Blending for color subtraction

This topic is 5151 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 making a water demo and cant figure out how to make the blending function to make it so when 2 pieces overlap it does color subtraction instead of color addition, any1 know how to do this?

Share this post


Link to post
Share on other sites
Advertisement
Assuming you're doing this in multipass using blending and your implementation supports GL_EXT_blend_subtract simply use glBlendFunc(GL_FUNC_SUBTRACT_EXT). To set it back to normal use glBlendFunc(GL_FUNC_ADD_EXT).

Enigma

Share this post


Link to post
Share on other sites
Learn to use opengl extensions for functions after opengl 1.1, there are several librarys, and examples on how to do it with win32 or SDL.

Share this post


Link to post
Share on other sites
bahhh found 2 library loaders, 1 crashed everytime i try to use it and the other gives me a link error. the 1 that gave me a link error is glew which seems to be the 1 every1 uses. Maybe i need to link the library to the project? But i cant remember how to link libraries in VC++7

Share this post


Link to post
Share on other sites
ok nevermind, figured out how to link the library but it's still crashing everytime i run it with the call to glBlendEquationEXT(). that is the function im supposed to be using right?

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!