summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSmileTheory <SmileTheory@gmail.com>2013-12-17 04:08:25 -0800
committerTim Angus <tim@ngus.net>2014-06-17 17:43:38 +0100
commit0605f9d03e791159af04c8f69a26864c187998af (patch)
tree42a23b3fef9274300a79e77ce6181c365a51ae5a /src
parentd6e67ad9d11e3683094f5cca559b79744d3737ef (diff)
#6077: OpenGL2: Add r_ignoreDstAlpha.
Diffstat (limited to 'src')
-rw-r--r--src/renderergl2/tr_init.c2
-rw-r--r--src/renderergl2/tr_local.h1
-rw-r--r--src/renderergl2/tr_shader.c12
3 files changed, 15 insertions, 0 deletions
diff --git a/src/renderergl2/tr_init.c b/src/renderergl2/tr_init.c
index 010603a1..b0120875 100644
--- a/src/renderergl2/tr_init.c
+++ b/src/renderergl2/tr_init.c
@@ -160,6 +160,7 @@ cvar_t *r_shadowMapSize;
cvar_t *r_shadowCascadeZNear;
cvar_t *r_shadowCascadeZFar;
cvar_t *r_shadowCascadeZBias;
+cvar_t *r_ignoreDstAlpha;
cvar_t *r_ignoreGLErrors;
cvar_t *r_logFile;
@@ -1145,6 +1146,7 @@ void R_Register( void )
r_shadowCascadeZNear = ri.Cvar_Get( "r_shadowCascadeZNear", "4", CVAR_ARCHIVE | CVAR_LATCH );
r_shadowCascadeZFar = ri.Cvar_Get( "r_shadowCascadeZFar", "3072", CVAR_ARCHIVE | CVAR_LATCH );
r_shadowCascadeZBias = ri.Cvar_Get( "r_shadowCascadeZBias", "-320", CVAR_ARCHIVE | CVAR_LATCH );
+ r_ignoreDstAlpha = ri.Cvar_Get( "r_ignoreDstAlpha", "1", CVAR_ARCHIVE | CVAR_LATCH );
//
// temporary latched variables that can only change over a restart
diff --git a/src/renderergl2/tr_local.h b/src/renderergl2/tr_local.h
index 3effb9f8..c98ec28e 100644
--- a/src/renderergl2/tr_local.h
+++ b/src/renderergl2/tr_local.h
@@ -1819,6 +1819,7 @@ extern cvar_t *r_shadowMapSize;
extern cvar_t *r_shadowCascadeZNear;
extern cvar_t *r_shadowCascadeZFar;
extern cvar_t *r_shadowCascadeZBias;
+extern cvar_t *r_ignoreDstAlpha;
extern cvar_t *r_greyscale;
diff --git a/src/renderergl2/tr_shader.c b/src/renderergl2/tr_shader.c
index 7edb8309..c5438f6d 100644
--- a/src/renderergl2/tr_shader.c
+++ b/src/renderergl2/tr_shader.c
@@ -204,10 +204,16 @@ static int NameToSrcBlendMode( const char *name )
}
else if ( !Q_stricmp( name, "GL_DST_ALPHA" ) )
{
+ if (r_ignoreDstAlpha->integer)
+ return GLS_SRCBLEND_ONE;
+
return GLS_SRCBLEND_DST_ALPHA;
}
else if ( !Q_stricmp( name, "GL_ONE_MINUS_DST_ALPHA" ) )
{
+ if (r_ignoreDstAlpha->integer)
+ return GLS_SRCBLEND_ZERO;
+
return GLS_SRCBLEND_ONE_MINUS_DST_ALPHA;
}
else if ( !Q_stricmp( name, "GL_SRC_ALPHA_SATURATE" ) )
@@ -244,10 +250,16 @@ static int NameToDstBlendMode( const char *name )
}
else if ( !Q_stricmp( name, "GL_DST_ALPHA" ) )
{
+ if (r_ignoreDstAlpha->integer)
+ return GLS_DSTBLEND_ONE;
+
return GLS_DSTBLEND_DST_ALPHA;
}
else if ( !Q_stricmp( name, "GL_ONE_MINUS_DST_ALPHA" ) )
{
+ if (r_ignoreDstAlpha->integer)
+ return GLS_DSTBLEND_ZERO;
+
return GLS_DSTBLEND_ONE_MINUS_DST_ALPHA;
}
else if ( !Q_stricmp( name, "GL_SRC_COLOR" ) )