summaryrefslogtreecommitdiff
path: root/src/renderergl2/tr_shader.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderergl2/tr_shader.c')
-rw-r--r--src/renderergl2/tr_shader.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/renderergl2/tr_shader.c b/src/renderergl2/tr_shader.c
index 36e159b4..4c2832fd 100644
--- a/src/renderergl2/tr_shader.c
+++ b/src/renderergl2/tr_shader.c
@@ -2283,7 +2283,7 @@ static qboolean CollapseStagesToGLSL(void)
{
// if 2+ stages and first stage is lightmap, switch them
// this makes it easier for the later bits to process
- if (stages[0].active && stages[0].bundle[0].isLightmap && stages[1].active)
+ if (stages[0].active && stages[0].bundle[0].tcGen == TCGEN_LIGHTMAP && stages[1].active)
{
int blendBits = stages[1].stateBits & ( GLS_DSTBLEND_BITS | GLS_SRCBLEND_BITS );
@@ -2320,7 +2320,7 @@ static qboolean CollapseStagesToGLSL(void)
break;
}
- if (pStage->bundle[0].isLightmap)
+ if (pStage->bundle[0].tcGen == TCGEN_LIGHTMAP)
{
int blendBits = pStage->stateBits & ( GLS_DSTBLEND_BITS | GLS_SRCBLEND_BITS );
@@ -2371,7 +2371,7 @@ static qboolean CollapseStagesToGLSL(void)
continue;
// skip lightmaps
- if (pStage->bundle[0].isLightmap)
+ if (pStage->bundle[0].tcGen == TCGEN_LIGHTMAP)
continue;
diffuse = pStage;
@@ -2413,7 +2413,7 @@ static qboolean CollapseStagesToGLSL(void)
break;
case ST_COLORMAP:
- if (pStage2->bundle[0].isLightmap)
+ if (pStage2->bundle[0].tcGen == TCGEN_LIGHTMAP)
{
lightmap = pStage2;
}
@@ -2455,7 +2455,7 @@ static qboolean CollapseStagesToGLSL(void)
if (!pStage->active)
continue;
- if (pStage->bundle[0].isLightmap)
+ if (pStage->bundle[0].tcGen == TCGEN_LIGHTMAP)
{
pStage->active = qfalse;
}
@@ -2521,7 +2521,7 @@ static qboolean CollapseStagesToGLSL(void)
if (pStage->adjustColorsForFog)
continue;
- if (pStage->bundle[TB_DIFFUSEMAP].isLightmap)
+ if (pStage->bundle[TB_DIFFUSEMAP].tcGen == TCGEN_LIGHTMAP)
{
pStage->glslShaderGroup = tr.lightallShader;
pStage->glslShaderIndex = LIGHTDEF_USE_LIGHTMAP;
@@ -2551,6 +2551,9 @@ static qboolean CollapseStagesToGLSL(void)
{
pStage->glslShaderGroup = tr.lightallShader;
pStage->glslShaderIndex = LIGHTDEF_USE_LIGHT_VECTOR;
+
+ if (pStage->bundle[0].tcGen != TCGEN_TEXTURE || pStage->bundle[0].numTexMods != 0)
+ pStage->glslShaderIndex |= LIGHTDEF_USE_TCGEN_AND_TCMOD;
}
}
}