summaryrefslogtreecommitdiff
path: root/src/renderergl2/tr_glsl.c
diff options
context:
space:
mode:
authorSmileTheory <SmileTheory@gmail.com>2014-07-31 21:01:57 -0700
committerTim Angus <tim@ngus.net>2014-08-28 11:13:04 +0100
commitd2c5e367fcd4a9e1cf39d74638dc80b2af29361a (patch)
treeb470e3e8f16e5102eea02a3c96fb98c295daa64f /src/renderergl2/tr_glsl.c
parent6f6faa4cb4a2be5fc0a30125e44f6dcd74509fd4 (diff)
OpenGL2: Add fourth cascade for sun shadows, and adjust sun shadow cvar defaults.
Diffstat (limited to 'src/renderergl2/tr_glsl.c')
-rw-r--r--src/renderergl2/tr_glsl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/renderergl2/tr_glsl.c b/src/renderergl2/tr_glsl.c
index ed078ddf..cb00e91c 100644
--- a/src/renderergl2/tr_glsl.c
+++ b/src/renderergl2/tr_glsl.c
@@ -79,10 +79,12 @@ static uniformInfo_t uniformsInfo[] =
{ "u_ShadowMap", GLSL_INT },
{ "u_ShadowMap2", GLSL_INT },
{ "u_ShadowMap3", GLSL_INT },
+ { "u_ShadowMap4", GLSL_INT },
{ "u_ShadowMvp", GLSL_MAT16 },
{ "u_ShadowMvp2", GLSL_MAT16 },
{ "u_ShadowMvp3", GLSL_MAT16 },
+ { "u_ShadowMvp4", GLSL_MAT16 },
{ "u_EnableTextures", GLSL_VEC4 },
@@ -1302,7 +1304,8 @@ void GLSL_InitGPUShaders(void)
if (r_shadowFilter->integer >= 2)
Q_strcat(extradefines, 1024, "#define USE_SHADOW_FILTER2\n");
- Q_strcat(extradefines, 1024, "#define USE_SHADOW_CASCADE\n");
+ if (r_shadowCascadeZFar->integer != 0)
+ Q_strcat(extradefines, 1024, "#define USE_SHADOW_CASCADE\n");
Q_strcat(extradefines, 1024, va("#define r_shadowMapSize %d\n", r_shadowMapSize->integer));
Q_strcat(extradefines, 1024, va("#define r_shadowCascadeZFar %f\n", r_shadowCascadeZFar->value));
@@ -1320,6 +1323,7 @@ void GLSL_InitGPUShaders(void)
GLSL_SetUniformInt(&tr.shadowmaskShader, UNIFORM_SHADOWMAP, TB_SHADOWMAP);
GLSL_SetUniformInt(&tr.shadowmaskShader, UNIFORM_SHADOWMAP2, TB_SHADOWMAP2);
GLSL_SetUniformInt(&tr.shadowmaskShader, UNIFORM_SHADOWMAP3, TB_SHADOWMAP3);
+ GLSL_SetUniformInt(&tr.shadowmaskShader, UNIFORM_SHADOWMAP4, TB_SHADOWMAP4);
qglUseProgramObjectARB(0);
GLSL_FinishGPUShader(&tr.shadowmaskShader);