use glBlendFuncSeparate for 50% correct dest alpha
This commit is contained in:
@@ -1596,6 +1596,7 @@ void RageDisplay_OGL::SetBlendMode( BlendMode mode )
|
|||||||
}
|
}
|
||||||
|
|
||||||
int iSourceRGB, iDestRGB;
|
int iSourceRGB, iDestRGB;
|
||||||
|
int iSourceAlpha = GL_ONE, iDestAlpha = GL_ONE_MINUS_SRC_ALPHA;
|
||||||
switch( mode )
|
switch( mode )
|
||||||
{
|
{
|
||||||
case BLEND_NORMAL:
|
case BLEND_NORMAL:
|
||||||
@@ -1615,10 +1616,14 @@ void RageDisplay_OGL::SetBlendMode( BlendMode mode )
|
|||||||
break;
|
break;
|
||||||
case BLEND_NO_EFFECT:
|
case BLEND_NO_EFFECT:
|
||||||
iSourceRGB = GL_ZERO; iDestRGB = GL_ONE;
|
iSourceRGB = GL_ZERO; iDestRGB = GL_ONE;
|
||||||
|
iSourceAlpha = GL_ZERO; iSourceAlpha = GL_ONE;
|
||||||
break;
|
break;
|
||||||
DEFAULT_FAIL( mode );
|
DEFAULT_FAIL( mode );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( GLExt.glBlendFuncSeparate != NULL )
|
||||||
|
GLExt.glBlendFuncSeparate( iSourceRGB, iDestRGB, iSourceAlpha, iDestAlpha );
|
||||||
|
else
|
||||||
glBlendFunc( iSourceRGB, iDestRGB );
|
glBlendFunc( iSourceRGB, iDestRGB );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -129,6 +129,9 @@ void GLExt_t::Load( LowLevelWindow *pWind )
|
|||||||
LoadAllOrNothing( funcs, pWind);
|
LoadAllOrNothing( funcs, pWind);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( HasExtension("GL_EXT_blend_func_separate") )
|
||||||
|
glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC) pWind->GetProcAddress("glBlendFuncSeparate");
|
||||||
|
|
||||||
if( HasExtension("GL_EXT_blend_subtract") )
|
if( HasExtension("GL_EXT_blend_subtract") )
|
||||||
glBlendEquation = (PFNGLBLENDEQUATIONPROC) pWind->GetProcAddress("glBlendEquation");
|
glBlendEquation = (PFNGLBLENDEQUATIONPROC) pWind->GetProcAddress("glBlendEquation");
|
||||||
|
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ struct GLExt_t
|
|||||||
|
|
||||||
PWSWAPINTERVALEXTPROC wglSwapIntervalEXT;
|
PWSWAPINTERVALEXTPROC wglSwapIntervalEXT;
|
||||||
PFNGLCOLORTABLEPROC glColorTableEXT;
|
PFNGLCOLORTABLEPROC glColorTableEXT;
|
||||||
|
PFNGLBLENDFUNCSEPARATEPROC glBlendFuncSeparate;
|
||||||
PFNGLBLENDEQUATIONPROC glBlendEquation;
|
PFNGLBLENDEQUATIONPROC glBlendEquation;
|
||||||
PFNGLCOLORTABLEPARAMETERIVPROC glGetColorTableParameterivEXT;
|
PFNGLCOLORTABLEPARAMETERIVPROC glGetColorTableParameterivEXT;
|
||||||
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB;
|
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB;
|
||||||
|
|||||||
Reference in New Issue
Block a user