Implement additive colour on walls and sprites

Also, don't modify the alpha channel when adding the additive colour.

# Conflicts:
#	src/hwrenderer/scene/hw_sprites.cpp
#	src/hwrenderer/scene/hw_walls.cpp
#	src/hwrenderer/scene/hw_weapon.cpp

# Conflicts:
#	src/gl/scene/gl_weapon.cpp
This commit is contained in:
Kevin Caccamo 2018-12-19 11:44:45 -05:00 committed by drfrag
parent edb3f8a448
commit 16a52cd8c8
4 changed files with 7 additions and 1 deletions

View file

@ -363,6 +363,7 @@ void GLSprite::Draw(int pass)
: ThingColor.Modulate(cursec->SpecialColors[sector_t::sprites]);
gl_RenderState.SetObjectColor(finalcol);
gl_RenderState.SetAddColor(cursec->SpecialColors[sector_t::add]);
}
mDrawer->SetColor(lightlevel, rel, Colormap, trans);
}
@ -501,6 +502,7 @@ void GLSprite::Draw(int pass)
}
gl_RenderState.SetObjectColor(0xffffffff);
gl_RenderState.SetAddColor(0);
gl_RenderState.EnableTexture(true);
gl_RenderState.SetDynLight(0,0,0);
}

View file

@ -368,6 +368,7 @@ void GLWall::RenderTextured(int rflags)
PalEntry color2 = side->GetSpecialColor(tierndx, side_t::wallbottom, frontsector);
gl_RenderState.SetObjectColor(color1);
gl_RenderState.SetObjectColor2(color2);
gl_RenderState.SetAddColor(seg->frontsector->SpecialColors[sector_t::add]);
if (color1 != color2)
{
// Do gradient setup only if there actually is a gradient.
@ -432,6 +433,7 @@ void GLWall::RenderTextured(int rflags)
}
gl_RenderState.SetObjectColor(0xffffffff);
gl_RenderState.SetObjectColor2(0);
gl_RenderState.SetAddColor(0);
gl_RenderState.SetTextureMode(tmode);
gl_RenderState.EnableGlow(false);
gl_RenderState.EnableGradient(false);

View file

@ -447,6 +447,7 @@ void GLSceneDrawer::DrawPlayerSprites(sector_t * viewsector, bool hudModelStep)
}
SetColor(ll, 0, cmc, trans, true);
}
// gl_RenderState.SetAddColor(0);
if (psp->firstTic)
{ // Can't interpolate the first tic.
@ -475,6 +476,7 @@ void GLSceneDrawer::DrawPlayerSprites(sector_t * viewsector, bool hudModelStep)
}
}
gl_RenderState.SetObjectColor(0xffffffff);
gl_RenderState.SetAddColor(0);
gl_RenderState.SetDynLight(0, 0, 0);
gl_RenderState.EnableBrightmap(false);
glset.lightmode = oldlightmode;

View file

@ -93,7 +93,7 @@ vec4 getTexel(vec2 st)
if (uObjectColor2.a == 0.0) texel *= uObjectColor;
else texel *= mix(uObjectColor, uObjectColor2, gradientdist.z);
texel += uAddColor;
texel.rgb += uAddColor.rgb;
return desaturate(texel);
}