mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 06:53:58 +00:00
- 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:
parent
ee09f8c72d
commit
fd3128a164
3 changed files with 19 additions and 3 deletions
|
@ -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);
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -313,8 +313,7 @@ void main()
|
|||
|
||||
case 2:
|
||||
{
|
||||
frag = frag * uFixedColormapStart;
|
||||
frag.a *= vColor.a;
|
||||
frag = vColor * frag * uFixedColormapStart;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue