- use uAddColor instead of uObjectColor2 for the ending color of a special colormap range.

Unlike uObjectColor2, this is more global state. uObjectColor2 is part of gradient calculation which may later be offloaded to a secondary buffer which already resulted in only conditionally setting it, resulting in broken special colormap application for the software renderer.
This commit is contained in:
Christoph Oelckers 2019-03-07 18:05:07 +01:00
parent cabe0c583e
commit 99c8ba1288
3 changed files with 3 additions and 3 deletions

View file

@ -138,7 +138,7 @@ bool FGLRenderState::ApplyShader()
activeShader->muLightIndex.Set(-1);
activeShader->muClipSplit.Set(mClipSplit);
activeShader->muSpecularMaterial.Set(mGlossiness, mSpecularLevel);
activeShader->muAddColor.Set(mAddColor); // Can this be done without a shader?
activeShader->muAddColor.Set(mAddColor);
if (mGlowEnabled)
{

View file

@ -155,7 +155,7 @@ void Draw2D(F2DDrawer *drawer, FRenderState &state)
{
state.SetTextureMode(TM_FIXEDCOLORMAP);
state.SetObjectColor(cmd.mSpecialColormap[0]);
state.SetObjectColor2(cmd.mSpecialColormap[1]);
state.SetAddColor(cmd.mSpecialColormap[1]);
}
state.SetFog(cmd.mColor1, 0);
state.SetColor(1, 1, 1, 1, cmd.mDesaturate);

View file

@ -588,7 +588,7 @@ void main()
if (uTextureMode == 7)
{
float gray = grayscale(frag);
vec4 cm = (uObjectColor + gray * (uObjectColor2 - uObjectColor)) * 2;
vec4 cm = (uObjectColor + gray * (uAddColor - uObjectColor)) * 2;
frag = vec4(clamp(cm.rgb, 0.0, 1.0), frag.a);
}
frag = frag * ProcessLight(material, vColor);