mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-04-25 00:11:03 +00:00
- better fix for shadow rendering.
This commit is contained in:
parent
f4ec9a1921
commit
5c306c61d6
2 changed files with 5 additions and 9 deletions
|
@ -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.
|
// Fog must be done before the texture so that the texture selector can override it.
|
||||||
bool foggy = (GlobalMapFog || (fade & 0xffffff));
|
bool foggy = (GlobalMapFog || (fade & 0xffffff));
|
||||||
auto ShadeDiv = lookups.tables[palette].ShadeFactor;
|
auto ShadeDiv = lookups.tables[palette].ShadeFactor;
|
||||||
|
bool shadow = orgshade >= numshades;
|
||||||
int shade = clamp(orgshade, 0, numshades - 1);
|
int shade = clamp(orgshade, 0, numshades - 1);
|
||||||
|
|
||||||
|
if (shadow) state.SetObjectColor(0xff000000);
|
||||||
|
else state.SetObjectColor(0xffffffff);
|
||||||
|
|
||||||
// Disable brightmaps if non-black fog is used.
|
// Disable brightmaps if non-black fog is used.
|
||||||
if (ShadeDiv >= 1 / 1000.f && foggy)
|
if (ShadeDiv >= 1 / 1000.f && foggy)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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.
|
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);
|
SetLightAndFog(state, fade, palette, shade, visibility, alpha, this->shade <= numshades);
|
||||||
|
|
||||||
if (modelframe == 0)
|
if (modelframe == 0)
|
||||||
|
|
Loading…
Reference in a new issue