Bias depth values when drawing in BLEND_NO_EFFECT.

This commit is contained in:
Glenn Maynard
2003-11-18 04:03:58 +00:00
parent b328a93e24
commit 0d1966c2f6
2 changed files with 11 additions and 0 deletions
+6
View File
@@ -859,6 +859,7 @@ void RageDisplay_D3D::SetTextureFiltering( bool b )
void RageDisplay_D3D::SetBlendMode( BlendMode mode )
{
g_pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
g_pd3dDevice->SetRenderState( D3DRS_ZBIAS, 0 );
switch( mode )
{
case BLEND_NORMAL:
@@ -872,6 +873,11 @@ void RageDisplay_D3D::SetBlendMode( BlendMode mode )
case BLEND_NO_EFFECT:
g_pd3dDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_ZERO );
g_pd3dDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_ONE );
/* This is almost exclusively used to draw masks to the Z-buffer. Make sure
* masks always win the depth test when drawn at the same position. */
g_pd3dDevice->SetRenderState( D3DRS_ZBIAS, 1 );
break;
default:
ASSERT(0);
+5
View File
@@ -1023,6 +1023,7 @@ void RageDisplay_OGL::SetBlendMode( BlendMode mode )
{
glEnable(GL_BLEND);
glDepthRange( 0.05, 1.0 );
switch( mode )
{
case BLEND_NORMAL:
@@ -1033,6 +1034,10 @@ void RageDisplay_OGL::SetBlendMode( BlendMode mode )
break;
case BLEND_NO_EFFECT:
glBlendFunc( GL_ZERO, GL_ONE );
/* This is almost exclusively used to draw masks to the Z-buffer. Make sure
* masks always win the depth test when drawn at the same position. */
glDepthRange( 0.0, 0.95 );
break;
default:
ASSERT(0);