From 8d9d56c339c5ac0b9efdee583b684498e74e531b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 5 Oct 2021 13:57:31 +0200 Subject: [PATCH] - push sprite shadows a little back for distance sorting They always need to be behind sprites with the same distance. --- src/rendering/hwrenderer/scene/hw_sprites.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rendering/hwrenderer/scene/hw_sprites.cpp b/src/rendering/hwrenderer/scene/hw_sprites.cpp index c31ae60d05..d53e9ee1e4 100644 --- a/src/rendering/hwrenderer/scene/hw_sprites.cpp +++ b/src/rendering/hwrenderer/scene/hw_sprites.cpp @@ -976,6 +976,7 @@ void HWSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t } depth = (float)((x - vp.Pos.X) * vp.TanCos + (y - vp.Pos.Y) * vp.TanSin); + if (isSpriteShadow) depth += 1.f/65536.f; // always sort shadows behind the sprite. // light calculation