matthias_buehlmann
matthias_buehlmann

Reputation: 5081

OpenGL blend function that multiplies by srcAlpha AND dstAlpha (and its inverse)

Basically I want the following blend function:

newFragColor = SrcColor * SrcAlpha * DstAlpha + DstColor * (1-(SrcAlpha * DstAlpha))

Can I achieve that somehow using glBlendFunc and glBlendEquation?

The left side of the addition is easy - for that I just need to premultiply the fragment color with the fragment alpha and then use GL_DST_ALPHA as the first parameter to glBlendFunc. But how can I achieve the right side of the addition?

Upvotes: 0

Views: 343

Answers (0)

Related Questions