From a4b57c5fbe83239a6f73fd6fc1b3e0cb1cf63f33 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sun, 25 Aug 2024 14:54:58 +0200 Subject: [PATCH] Also apply the alpha scale to sprites --- src/rendering/hwrenderer/scene/hw_spritelight.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/rendering/hwrenderer/scene/hw_spritelight.cpp b/src/rendering/hwrenderer/scene/hw_spritelight.cpp index 4cc36e1a9..031262daf 100644 --- a/src/rendering/hwrenderer/scene/hw_spritelight.cpp +++ b/src/rendering/hwrenderer/scene/hw_spritelight.cpp @@ -186,6 +186,15 @@ void HWDrawInfo::GetDynSpriteLight(AActor *self, float x, float y, float z, FLig lr = light->GetRed() / 255.0f; lg = light->GetGreen() / 255.0f; lb = light->GetBlue() / 255.0f; + + if (light->target) + { + float alpha = (float)light->target->Alpha; + lr *= alpha; + lg *= alpha; + lb *= alpha; + } + if (light->IsSubtractive()) { float bright = (float)FVector3(lr, lg, lb).Length();