masking blend modes
This commit is contained in:
@@ -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. */
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user