diff --git a/stepmania/src/RageDisplay_OGL.cpp b/stepmania/src/RageDisplay_OGL.cpp index dab70b95c4..f5186c4ae8 100644 --- a/stepmania/src/RageDisplay_OGL.cpp +++ b/stepmania/src/RageDisplay_OGL.cpp @@ -1637,6 +1637,14 @@ void RageDisplay_OGL::SetBlendMode( BlendMode mode ) iSourceRGB = GL_ONE; iDestRGB = GL_ZERO; iSourceAlpha = GL_ONE; iDestAlpha = GL_ZERO; break; + case BLEND_ALPHA_MASK: + iSourceRGB = GL_ZERO; iDestRGB = GL_ONE; + iSourceAlpha = GL_ZERO; iDestAlpha = GL_SRC_ALPHA; + break; + case BLEND_ALPHA_KNOCK_OUT: + iSourceRGB = GL_ZERO; iDestRGB = GL_ONE; + iSourceAlpha = GL_ZERO; iDestAlpha = GL_ONE_MINUS_SRC_ALPHA; + break; case BLEND_WEIGHTED_MULTIPLY: /* output = 2*(dst*src). 0.5,0.5,0.5 is identity; darker colors darken the image, * and brighter colors lighten the image. */ diff --git a/stepmania/src/RageTypes.cpp b/stepmania/src/RageTypes.cpp index 38bd4d4a88..8e6fa22526 100644 --- a/stepmania/src/RageTypes.cpp +++ b/stepmania/src/RageTypes.cpp @@ -74,7 +74,33 @@ static const char *BlendModeNames[] = { "Normal", "Add", + + /* + * Copy the source directly to the destination. Alpha is not premultiplied. + * + * Co = Cs + * Ao = As + */ "CopySrc", + + /* + * Leave the color alone, and apply the source alpha on top of the existing alpha. + * Transparent areas in the source become transparent in the destination. + * + * Be sure to disable alpha test with this blend mode. + * + * Co = Cd + * Ao = Ad*As + */ + "AlphaMask", + + /* + * Leave the color alone, and apply the source alpha on top of the existing alpha. + * Transparent areas in the source become transparent in the destination. + * Co = Cd + * Ao = Ad*(1-As) + */ + "AlphaKnockOut", "WeightedMultiply", "InvertDest", "NoEffect" diff --git a/stepmania/src/RageTypes.h b/stepmania/src/RageTypes.h index f22ebd3154..cd380c3cce 100644 --- a/stepmania/src/RageTypes.h +++ b/stepmania/src/RageTypes.h @@ -10,6 +10,8 @@ enum BlendMode BLEND_NORMAL, BLEND_ADD, BLEND_COPY_SRC, + BLEND_ALPHA_MASK, + BLEND_ALPHA_KNOCK_OUT, BLEND_WEIGHTED_MULTIPLY, BLEND_INVERT_DEST, BLEND_NO_EFFECT,