From daa07b9e55c1f6a40deb19dfe173540f62741189 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 1 Jan 2022 20:01:36 +0100 Subject: [PATCH] - an attempt to render "reflection" floor sprites by lifting them up to the floor and drawing them with 33% alpha. --- source/core/rendering/scene/hw_flats.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/core/rendering/scene/hw_flats.cpp b/source/core/rendering/scene/hw_flats.cpp index 35ff7aa91..d31d28b58 100644 --- a/source/core/rendering/scene/hw_flats.cpp +++ b/source/core/rendering/scene/hw_flats.cpp @@ -399,6 +399,12 @@ void HWFlat::ProcessFlatSprite(HWDrawInfo* di, tspritetype* sprite, sectortype* { int tilenum = sprite->picnum; texture = tileGetTexture(tilenum); + bool belowfloor = false; + if (sprite->pos.Z > sprite->sectp->floorz) + { + belowfloor = true; + sprite->pos.Z = sprite->sectp->floorz; + } z = sprite->pos.Z * (1 / -256.f); if (z == di->Viewpoint.Pos.Z) return; // looking right at the edge. dynlightindex = -1; @@ -423,6 +429,7 @@ void HWFlat::ProcessFlatSprite(HWDrawInfo* di, tspritetype* sprite, sectortype* fade = lookups.getFade(sector->floorpal); // fog is per sector. SetSpriteTranslucency(sprite, alpha, RenderStyle); + if (belowfloor) alpha *= 0.33f; PutFlat(di, z > di->Viewpoint.Pos.Z); }