- an attempt to render "reflection" floor sprites by lifting them up to the floor and drawing them with 33% alpha.

This commit is contained in:
Christoph Oelckers 2022-01-01 20:01:36 +01:00
parent 8c9b810b16
commit daa07b9e55

View file

@ -399,6 +399,12 @@ void HWFlat::ProcessFlatSprite(HWDrawInfo* di, tspritetype* sprite, sectortype*
{ {
int tilenum = sprite->picnum; int tilenum = sprite->picnum;
texture = tileGetTexture(tilenum); 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); z = sprite->pos.Z * (1 / -256.f);
if (z == di->Viewpoint.Pos.Z) return; // looking right at the edge. if (z == di->Viewpoint.Pos.Z) return; // looking right at the edge.
dynlightindex = -1; dynlightindex = -1;
@ -423,6 +429,7 @@ void HWFlat::ProcessFlatSprite(HWDrawInfo* di, tspritetype* sprite, sectortype*
fade = lookups.getFade(sector->floorpal); // fog is per sector. fade = lookups.getFade(sector->floorpal); // fog is per sector.
SetSpriteTranslucency(sprite, alpha, RenderStyle); SetSpriteTranslucency(sprite, alpha, RenderStyle);
if (belowfloor) alpha *= 0.33f;
PutFlat(di, z > di->Viewpoint.Pos.Z); PutFlat(di, z > di->Viewpoint.Pos.Z);
} }