427a764: subtractive blend (OpenGL only for now) [Glenn Maynard]
I was looking into writing the equivalent Direct3D code; still not 100% sure if my code is right, so it stays local for now.
This commit is contained in:
@@ -1715,6 +1715,8 @@ void RageDisplay_OGL::SetBlendMode( BlendMode mode )
|
||||
{
|
||||
if( mode == BLEND_INVERT_DEST )
|
||||
GLExt.glBlendEquation( GL_FUNC_SUBTRACT );
|
||||
else if( mode == BLEND_SUBTRACT )
|
||||
GLExt.glBlendEquation( GL_FUNC_REVERSE_SUBTRACT );
|
||||
else
|
||||
GLExt.glBlendEquation( GL_FUNC_ADD );
|
||||
}
|
||||
@@ -1729,6 +1731,9 @@ void RageDisplay_OGL::SetBlendMode( BlendMode mode )
|
||||
case BLEND_ADD:
|
||||
iSourceRGB = GL_SRC_ALPHA; iDestRGB = GL_ONE;
|
||||
break;
|
||||
case BLEND_SUBTRACT:
|
||||
iSourceRGB = GL_SRC_ALPHA; iDestRGB = GL_ONE_MINUS_SRC_ALPHA;
|
||||
break;
|
||||
case BLEND_MODULATE:
|
||||
iSourceRGB = GL_ZERO; iDestRGB = GL_SRC_COLOR;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user