#5999: OpenGL2: Don't use lightall shader with deforms or adjustColorsForFog.

This commit is contained in:
SmileTheory 2013-08-23 01:35:17 -07:00
parent ebd164deaf
commit d46916082d
1 changed files with 19 additions and 10 deletions

View File

@ -2493,7 +2493,7 @@ static qboolean CollapseStagesToGLSL(void)
// convert any remaining lightmap stages to a lighting pass with a white texture // 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. // 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++) for (i = 0; i < MAX_SHADER_STAGES; i++)
{ {
@ -2502,6 +2502,9 @@ static qboolean CollapseStagesToGLSL(void)
if (!pStage->active) if (!pStage->active)
continue; continue;
if (pStage->adjustColorsForFog)
continue;
if (pStage->bundle[TB_DIFFUSEMAP].isLightmap) if (pStage->bundle[TB_DIFFUSEMAP].isLightmap)
{ {
pStage->glslShaderGroup = tr.lightallShader; pStage->glslShaderGroup = tr.lightallShader;
@ -2516,17 +2519,23 @@ static qboolean CollapseStagesToGLSL(void)
} }
// convert any remaining lightingdiffuse stages to a lighting pass // 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++)
if (!pStage->active)
continue;
if (pStage->rgbGen == CGEN_LIGHTING_DIFFUSE)
{ {
pStage->glslShaderGroup = tr.lightallShader; shaderStage_t *pStage = &stages[i];
pStage->glslShaderIndex = LIGHTDEF_USE_LIGHT_VECTOR;
if (!pStage->active)
continue;
if (pStage->adjustColorsForFog)
continue;
if (pStage->rgbGen == CGEN_LIGHTING_DIFFUSE)
{
pStage->glslShaderGroup = tr.lightallShader;
pStage->glslShaderIndex = LIGHTDEF_USE_LIGHT_VECTOR;
}
} }
} }