summaryrefslogtreecommitdiff
path: root/src/renderergl2/tr_shader.c
diff options
context:
space:
mode:
authorSmileTheory <SmileTheory@gmail.com>2013-08-23 01:35:17 -0700
committerTim Angus <tim@ngus.net>2014-06-17 17:43:34 +0100
commit84638195e09c8e2433eba2ccb0e4b25e81a32ff9 (patch)
tree9852b8bfaedd2ceb309cbe4a2189d11ac3f83c42 /src/renderergl2/tr_shader.c
parentf24780d5fc70ff5cecb680558b194fdde644b2b4 (diff)
#5999: OpenGL2: Don't use lightall shader with deforms or adjustColorsForFog.
Diffstat (limited to 'src/renderergl2/tr_shader.c')
-rw-r--r--src/renderergl2/tr_shader.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/renderergl2/tr_shader.c b/src/renderergl2/tr_shader.c
index 25cf819b..6bf4fa43 100644
--- a/src/renderergl2/tr_shader.c
+++ b/src/renderergl2/tr_shader.c
@@ -2494,7 +2494,7 @@ static qboolean CollapseStagesToGLSL(void)
// convert any remaining lightmap stages to a lighting pass with a white texture
// only do this with r_sunlightMode non-zero, as it's only for correct shadows.
- if (r_sunlightMode->integer)
+ if (r_sunlightMode->integer && shader.numDeforms == 0)
{
for (i = 0; i < MAX_SHADER_STAGES; i++)
{
@@ -2503,6 +2503,9 @@ static qboolean CollapseStagesToGLSL(void)
if (!pStage->active)
continue;
+ if (pStage->adjustColorsForFog)
+ continue;
+
if (pStage->bundle[TB_DIFFUSEMAP].isLightmap)
{
pStage->glslShaderGroup = tr.lightallShader;
@@ -2517,17 +2520,23 @@ static qboolean CollapseStagesToGLSL(void)
}
// convert any remaining lightingdiffuse stages to a lighting pass
- for (i = 0; i < MAX_SHADER_STAGES; i++)
+ if (shader.numDeforms == 0)
{
- shaderStage_t *pStage = &stages[i];
+ for (i = 0; i < MAX_SHADER_STAGES; i++)
+ {
+ shaderStage_t *pStage = &stages[i];
- if (!pStage->active)
- continue;
+ if (!pStage->active)
+ continue;
- if (pStage->rgbGen == CGEN_LIGHTING_DIFFUSE)
- {
- pStage->glslShaderGroup = tr.lightallShader;
- pStage->glslShaderIndex = LIGHTDEF_USE_LIGHT_VECTOR;
+ if (pStage->adjustColorsForFog)
+ continue;
+
+ if (pStage->rgbGen == CGEN_LIGHTING_DIFFUSE)
+ {
+ pStage->glslShaderGroup = tr.lightallShader;
+ pStage->glslShaderIndex = LIGHTDEF_USE_LIGHT_VECTOR;
+ }
}
}