Jump to content
  • Advertisement
Sign in to follow this  
RPTD

OpenGL glBlendFunc drives me nuts

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

simple problem. i've got color in the screenbuffer. now i wanna render a lighting ontop of it using glBlend(GL_DST_COLOR, GL_ZERO), which should multiply what is on the screen with my lighting output. if i do not use glDisable(GL_BLEND) then the lighting overwrites the screen like expected and shows that the output is correct. if i do glEnable(GL_BLEND) i end up with a black screen. i tested with glBlendFunc(GL_ONE, GL_ZERO) which should be the same as glDisable(GL_BLEND) but again a black screen. anybody got an idea how it comes that opengl ignores my color value and always uses black???

Share this post


Link to post
Share on other sites
Advertisement
Shouldn't GL_ZERO as the destination function just ignore the pixels onscreen?
Try GL_ONE.

Delphi3D has an utility called "blender" 4th on that page that will let you choose blend modes interactively and test the result:

Share this post


Link to post
Share on other sites
thx for the link. looks more like the fragment shader somehow produced a result in a strange way that it worked without blending but not with. could correct it now but it's not the blast yet performance wise.

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!