- properly render geometry that's fully shrouded in fog.

This commit is contained in:
Christoph Oelckers 2021-06-01 21:48:39 +02:00
parent 22364ff2f8
commit 3c5ef9c8e6
2 changed files with 17 additions and 1 deletions

View file

@ -182,6 +182,13 @@ void HWFlat::DrawFlat(HWDrawInfo *di, FRenderState &state, bool translucent)
if (texture && !checkTranslucentReplacement(texture->GetID(), palette)) state.AlphaFunc(Alpha_GEqual, texture->alphaThreshold);
else state.AlphaFunc(Alpha_GEqual, 0.f);
}
else if (shade > numshades && (GlobalMapFog || (fade & 0xffffff)))
{
state.SetObjectColor(fade | 0xff000000);
state.EnableTexture(false);
}
state.SetMaterial(texture, UF_Texture, 0, Sprite == nullptr? CLAMP_NONE : CLAMP_XY, TRANSLATION(Translation_Remap + curbasepal, palette), -1);
state.SetLightIndex(dynlightindex);
@ -192,6 +199,7 @@ void HWFlat::DrawFlat(HWDrawInfo *di, FRenderState &state, bool translucent)
state.EnableBrightmap(true);
state.SetObjectColor(0xffffffff);
state.EnableTexture(true);
//state.SetAddColor(0);
//state.ApplyTextureManipulation(nullptr);
}

View file

@ -248,10 +248,17 @@ void HWWall::RenderMirrorSurface(HWDrawInfo *di, FRenderState &state)
void HWWall::RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags)
{
SetLightAndFog(state, fade, palette, shade, visibility, alpha);
state.SetMaterial(texture, UF_Texture, 0, (flags & (HWF_CLAMPX | HWF_CLAMPY)), TRANSLATION(Translation_Remap + curbasepal, palette), -1);
if (Sprite == nullptr)
{
if (shade > numshades && (GlobalMapFog || (fade & 0xffffff)))
{
state.SetObjectColor(fade | 0xff000000);
state.EnableTexture(false);
}
int h = (int)texture->GetDisplayHeight();
int h2 = 1 << sizeToBits(h);
if (h2 < h) h2 *= 2;
@ -276,6 +283,7 @@ void HWWall::RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags)
state.SetNpotEmulation(0.f, 0.f);
state.SetObjectColor(0xffffffff);
state.EnableTexture(true);
/* none of these functions is in use.
state.SetObjectColor2(0);
state.SetAddColor(0);
@ -960,7 +968,7 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec
#ifdef _DEBUG
if (wal - wall == 788)
if (wal - wall == 6468)
{
int a = 0;
}