mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 21:21:04 +00:00
Implement additive colour on walls and sprites
Also, don't modify the alpha channel when adding the additive colour.
This commit is contained in:
parent
80bcac48ef
commit
33723e8904
4 changed files with 7 additions and 1 deletions
|
@ -159,6 +159,7 @@ void GLSprite::DrawSprite(HWDrawInfo *di, FRenderState &state, bool translucent)
|
|||
: ThingColor.Modulate(cursec->SpecialColors[sector_t::sprites]);
|
||||
|
||||
state.SetObjectColor(finalcol);
|
||||
state.SetAddColor(cursec->SpecialColors[sector_t::add]);
|
||||
}
|
||||
state.SetColor(lightlevel, rel, di->isFullbrightScene(), Colormap, trans);
|
||||
}
|
||||
|
@ -295,6 +296,7 @@ void GLSprite::DrawSprite(HWDrawInfo *di, FRenderState &state, bool translucent)
|
|||
}
|
||||
|
||||
state.SetObjectColor(0xffffffff);
|
||||
state.SetAddColor(0);
|
||||
state.EnableTexture(true);
|
||||
state.SetDynLight(0, 0, 0);
|
||||
}
|
||||
|
|
|
@ -174,6 +174,7 @@ void GLWall::RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags)
|
|||
PalEntry color2 = side->GetSpecialColor(tierndx, side_t::wallbottom, frontsector);
|
||||
state.SetObjectColor(color1);
|
||||
state.SetObjectColor2(color2);
|
||||
state.SetAddColor(seg->frontsector->SpecialColors[sector_t::add]);
|
||||
if (color1 != color2)
|
||||
{
|
||||
// Do gradient setup only if there actually is a gradient.
|
||||
|
@ -238,6 +239,7 @@ void GLWall::RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags)
|
|||
}
|
||||
state.SetObjectColor(0xffffffff);
|
||||
state.SetObjectColor2(0);
|
||||
state.SetAddColor(0);
|
||||
state.SetTextureMode(tmode);
|
||||
state.EnableGlow(false);
|
||||
state.EnableGradient(false);
|
||||
|
|
|
@ -72,6 +72,7 @@ void HWDrawInfo::DrawPSprite(HUDSprite *huds, FRenderState &state)
|
|||
state.SetRenderStyle(huds->RenderStyle);
|
||||
state.SetTextureMode(huds->RenderStyle);
|
||||
state.SetObjectColor(huds->ObjectColor);
|
||||
// state.SetAddColor(0);
|
||||
state.SetDynLight(huds->dynrgb[0], huds->dynrgb[1], huds->dynrgb[2]);
|
||||
state.EnableBrightmap(!(huds->RenderStyle.Flags & STYLEF_ColorIsFixed));
|
||||
|
||||
|
@ -94,6 +95,7 @@ void HWDrawInfo::DrawPSprite(HUDSprite *huds, FRenderState &state)
|
|||
state.SetTextureMode(TM_NORMAL);
|
||||
state.AlphaFunc(Alpha_GEqual, gl_mask_sprite_threshold);
|
||||
state.SetObjectColor(0xffffffff);
|
||||
state.SetAddColor(0);
|
||||
state.SetDynLight(0, 0, 0);
|
||||
state.EnableBrightmap(false);
|
||||
}
|
||||
|
|
|
@ -114,7 +114,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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue