- better fix for shadow rendering.

This commit is contained in:
Christoph Oelckers 2021-04-14 00:45:35 +02:00
parent f4ec9a1921
commit 5c306c61d6
2 changed files with 5 additions and 9 deletions

View file

@ -405,7 +405,12 @@ __forceinline void SetLightAndFog(FRenderState& state, PalEntry fade, int palett
// Fog must be done before the texture so that the texture selector can override it.
bool foggy = (GlobalMapFog || (fade & 0xffffff));
auto ShadeDiv = lookups.tables[palette].ShadeFactor;
bool shadow = orgshade >= numshades;
int shade = clamp(orgshade, 0, numshades - 1);
if (shadow) state.SetObjectColor(0xff000000);
else state.SetObjectColor(0xffffffff);
// Disable brightmaps if non-black fog is used.
if (ShadeDiv >= 1 / 1000.f && foggy)
{

View file

@ -109,15 +109,6 @@ void HWSprite::DrawSprite(HWDrawInfo* di, FRenderState& state, bool translucent)
else RenderStyle.BlendOp = STYLEOP_Fuzz; // subtractive with models is not going to work.
}
// Fog must be done before the texture so that the texture selector can override it.
// Disable brightmaps if non-black fog is used.
int shade = this->shade;
if (this->shade > numshades) // handling of SW's shadow hack using a shade of 127.
{
shade = sector[sprite->sectnum].floorshade;
state.SetColor(0, 0, 0, alpha);
}
SetLightAndFog(state, fade, palette, shade, visibility, alpha, this->shade <= numshades);
if (modelframe == 0)