1 year ago

#298316

test-img

matthias_buehlmann

OpenGL: How exactly does GL_SRC_ALPHA_SATURATE work?

so https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBlendFunc.xhtml has one value that can only be used as source argument, GL_SRC_ALPHA_SATURATE and it is intended to be used as glBlendFunc(GL_SRC_ALPHA_SATURATE, GL_ONE) together with polygon antialiasing (GL_POLYGON_SMOOTH) on front-to-back sorted geometry and if I'm not mistaken it ensures that triangle sides that directly connect to another triangle will not get visible lines between them.

The documentation also states that

Destination alpha bitplanes, which must be present for this blend function to operate correctly, store the accumulated coverage.

So, while I know more or less what this functionality is used for, I'd really like to understand how it works exactly and how the alpha bitplanes are used (and does this mean that the factor depends on both source alpha and dest alpha?). Since this isn't really documented, I hope someone here (looking at @Nicol Bolas) can shed light on the math or implementation magic behind it?

And then one step further - is there any other usecase GL_SRC_ALPHA_SATURATE can be used for?

opengl

blending

alphablending

0 Answers

Your Answer

Accepted video resources