Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
OpenGLRenderer: Don't use per-sample color key test + additive blending
Instead modulate the blend factor with alpha.

Fixes: issue #1595 (general case)
  • Loading branch information
dscharrer committed Jan 12, 2022
1 parent adc3ab3 commit 3aa6c0d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/graphics/opengl/OpenGLRenderer.cpp
Expand Up @@ -959,6 +959,9 @@ void OpenGLRenderer::flushState() {
"inverted alpha blending combined with alpha test makes no sense");
if(blendSrc == BlendOne && blendDst == BlendZero) {
alphaTest = useSS ? TestSS : useA2C ? TestA2C : TestStrict;
} else if(blendSrc == BlendOne && blendDst == BlendOne) {
blendSrc = BlendSrcAlpha;
alphaTest = TestConservative; // optimization only, could use TestNone
} else if(blendSrc == BlendSrcAlpha || blendDst == BlendInvSrcAlpha) {
alphaTest = TestConservative;
} else {
Expand Down

0 comments on commit 3aa6c0d

Please sign in to comment.