Jump to content
  • Advertisement
Sign in to follow this  
EiNDouble

glBlendFunc

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

Hi,

I'm having a hard time trying to figure out the correct blend function I want.

I want the source color to be multiplied by the alpha of the destination, and this I already achieved with glBlendFunc(GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA), so this way the source will be painted according to the alpha of the dst.

What I want as well is the source color to be multiplied by the source alpha, for cases where the source is a png texture with transparency. The blend function for this would be glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA).


So, if I want both of them together, multiplying the source color by the destination alpha and the source alpha as well, I think I would want something like glBlendFunc(GL_DST_ALPHA * GL_SRC_ALPHA, ...).


Is there anyway to achieve this?

Thank you :)

Share this post


Link to post
Share on other sites
Advertisement
What version of opengl are you using?

You would be best off doing this in a shader and dropping the fixed function blending.

Share this post


Link to post
Share on other sites
I'm using the v2.0 .

I know, but for this particular situation I wanted to avoid shaders at all costs..

And btw, what I'm trying to do is recursive masking.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!