diff options
Diffstat (limited to 'src/renderergl2')
-rw-r--r-- | src/renderergl2/tr_shader.c | 27 |
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; + } } } |