- fixed: When changing enhanced nightvision mode the shaders need to have their fixed colormap state reset to ensure that the new settings get used.

- fixed: The shader code for handling special fixed colormaps did not use the color vertex attribute which was most evident with the 'shadow' render style on the spectre.
This commit is contained in:
Christoph Oelckers 2014-10-05 09:40:36 +02:00
parent ee09f8c72d
commit fd3128a164
3 changed files with 19 additions and 3 deletions

View File

@ -67,7 +67,12 @@ CUSTOM_CVAR (Int, gl_light_ambient, 20, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
}
CVAR(Int, gl_weaponlight, 8, CVAR_ARCHIVE);
CVAR(Bool,gl_enhanced_nightvision,true,CVAR_ARCHIVE)
CUSTOM_CVAR(Bool, gl_enhanced_nightvision, true, CVAR_ARCHIVE|CVAR_NOINITCALL)
{
// The fixed colormap state needs to be reset because if this happens when
// a shader is set to CM_LITE or CM_TORCH it won't register the change in behavior caused by this CVAR.
GLRenderer->mShaderManager->ResetFixedColormap();
}
CVAR(Bool, gl_brightfog, false, CVAR_ARCHIVE);

View File

@ -269,6 +269,18 @@ public:
return mActiveShader;
}
void ResetFixedColormap()
{
for (unsigned i = 0; i < mTextureEffects.Size(); i++)
{
mTextureEffects[i]->currentfixedcolormap = -1;
}
for (unsigned i = 0; i < mTextureEffectsNAT.Size(); i++)
{
mTextureEffectsNAT[i]->currentfixedcolormap = -1;
}
}
FShader *Get(unsigned int eff, bool alphateston)
{
// indices 0-2 match the warping modes, 3 is brightmap, 4 no texture, the following are custom

View File

@ -313,8 +313,7 @@ void main()
case 2:
{
frag = frag * uFixedColormapStart;
frag.a *= vColor.a;
frag = vColor * frag * uFixedColormapStart;
break;
}