#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

View file

@ -2493,7 +2493,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++)
{
@ -2502,6 +2502,9 @@ static qboolean CollapseStagesToGLSL(void)
if (!pStage->active)
continue;
if (pStage->adjustColorsForFog)
continue;
if (pStage->bundle[TB_DIFFUSEMAP].isLightmap)
{
pStage->glslShaderGroup = tr.lightallShader;
@ -2516,17 +2519,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];
if (!pStage->active)
continue;
if (pStage->rgbGen == CGEN_LIGHTING_DIFFUSE)
for (i = 0; i < MAX_SHADER_STAGES; i++)
{
pStage->glslShaderGroup = tr.lightallShader;
pStage->glslShaderIndex = LIGHTDEF_USE_LIGHT_VECTOR;
shaderStage_t *pStage = &stages[i];
if (!pStage->active)
continue;
if (pStage->adjustColorsForFog)
continue;
if (pStage->rgbGen == CGEN_LIGHTING_DIFFUSE)
{
pStage->glslShaderGroup = tr.lightallShader;
pStage->glslShaderIndex = LIGHTDEF_USE_LIGHT_VECTOR;
}
}
}