mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-14 00:21:34 +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]);
|
: ThingColor.Modulate(cursec->SpecialColors[sector_t::sprites]);
|
||||||
|
|
||||||
state.SetObjectColor(finalcol);
|
state.SetObjectColor(finalcol);
|
||||||
|
state.SetAddColor(cursec->SpecialColors[sector_t::add]);
|
||||||
}
|
}
|
||||||
state.SetColor(lightlevel, rel, di->isFullbrightScene(), Colormap, trans);
|
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.SetObjectColor(0xffffffff);
|
||||||
|
state.SetAddColor(0);
|
||||||
state.EnableTexture(true);
|
state.EnableTexture(true);
|
||||||
state.SetDynLight(0, 0, 0);
|
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);
|
PalEntry color2 = side->GetSpecialColor(tierndx, side_t::wallbottom, frontsector);
|
||||||
state.SetObjectColor(color1);
|
state.SetObjectColor(color1);
|
||||||
state.SetObjectColor2(color2);
|
state.SetObjectColor2(color2);
|
||||||
|
state.SetAddColor(seg->frontsector->SpecialColors[sector_t::add]);
|
||||||
if (color1 != color2)
|
if (color1 != color2)
|
||||||
{
|
{
|
||||||
// Do gradient setup only if there actually is a gradient.
|
// 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.SetObjectColor(0xffffffff);
|
||||||
state.SetObjectColor2(0);
|
state.SetObjectColor2(0);
|
||||||
|
state.SetAddColor(0);
|
||||||
state.SetTextureMode(tmode);
|
state.SetTextureMode(tmode);
|
||||||
state.EnableGlow(false);
|
state.EnableGlow(false);
|
||||||
state.EnableGradient(false);
|
state.EnableGradient(false);
|
||||||
|
|
|
@ -72,6 +72,7 @@ void HWDrawInfo::DrawPSprite(HUDSprite *huds, FRenderState &state)
|
||||||
state.SetRenderStyle(huds->RenderStyle);
|
state.SetRenderStyle(huds->RenderStyle);
|
||||||
state.SetTextureMode(huds->RenderStyle);
|
state.SetTextureMode(huds->RenderStyle);
|
||||||
state.SetObjectColor(huds->ObjectColor);
|
state.SetObjectColor(huds->ObjectColor);
|
||||||
|
// state.SetAddColor(0);
|
||||||
state.SetDynLight(huds->dynrgb[0], huds->dynrgb[1], huds->dynrgb[2]);
|
state.SetDynLight(huds->dynrgb[0], huds->dynrgb[1], huds->dynrgb[2]);
|
||||||
state.EnableBrightmap(!(huds->RenderStyle.Flags & STYLEF_ColorIsFixed));
|
state.EnableBrightmap(!(huds->RenderStyle.Flags & STYLEF_ColorIsFixed));
|
||||||
|
|
||||||
|
@ -94,6 +95,7 @@ void HWDrawInfo::DrawPSprite(HUDSprite *huds, FRenderState &state)
|
||||||
state.SetTextureMode(TM_NORMAL);
|
state.SetTextureMode(TM_NORMAL);
|
||||||
state.AlphaFunc(Alpha_GEqual, gl_mask_sprite_threshold);
|
state.AlphaFunc(Alpha_GEqual, gl_mask_sprite_threshold);
|
||||||
state.SetObjectColor(0xffffffff);
|
state.SetObjectColor(0xffffffff);
|
||||||
|
state.SetAddColor(0);
|
||||||
state.SetDynLight(0, 0, 0);
|
state.SetDynLight(0, 0, 0);
|
||||||
state.EnableBrightmap(false);
|
state.EnableBrightmap(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,7 +114,7 @@ vec4 getTexel(vec2 st)
|
||||||
if (uObjectColor2.a == 0.0) texel *= uObjectColor;
|
if (uObjectColor2.a == 0.0) texel *= uObjectColor;
|
||||||
else texel *= mix(uObjectColor, uObjectColor2, gradientdist.z);
|
else texel *= mix(uObjectColor, uObjectColor2, gradientdist.z);
|
||||||
|
|
||||||
texel += uAddColor;
|
texel.rgb += uAddColor.rgb;
|
||||||
|
|
||||||
return desaturate(texel);
|
return desaturate(texel);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue