mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-21 03:21:28 +00:00
Allow setting a dynamic light's alpha to influence its brightness. This brings it in parity with VKDoom
This commit is contained in:
parent
d3e5cf77ab
commit
a4e527979d
2 changed files with 12 additions and 0 deletions
|
@ -92,6 +92,9 @@ void AddLightToList(FDynLightData &dld, int group, FDynamicLight * light, bool f
|
|||
cs = 1.0f;
|
||||
}
|
||||
|
||||
if (light->target)
|
||||
cs *= (float)light->target->Alpha;
|
||||
|
||||
float r = light->GetRed() / 255.0f * cs;
|
||||
float g = light->GetGreen() / 255.0f * cs;
|
||||
float b = light->GetBlue() / 255.0f * cs;
|
||||
|
|
|
@ -176,6 +176,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();
|
||||
|
|
Loading…
Reference in a new issue