Apply AnimlightCutoff

This commit is contained in:
Jarrod Doyle 2024-12-26 14:04:47 +00:00
parent 196f739afd
commit 42daa8a048
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
2 changed files with 9 additions and 2 deletions

View File

@ -55,7 +55,7 @@ public class Light
SpotlightDir = Vector3.Normalize(Vector3.Transform(vhotLightDir, scale * rotate));
}
public float StrengthAtPoint(Vector3 point, Plane plane)
public float StrengthAtPoint(Vector3 point, Plane plane, uint lightCutoff)
{
// Calculate light strength at a given point. As far as I can tell
// this is exact to Dark (I'm a genius??). It's just an inverse distance
@ -72,6 +72,13 @@ public class Light
strength *= (Radius - len) / (Radius - InnerRadius);
}
// Anim lights have a (configurable) minimum light cutoff. This is checked before
// spotlight multipliers are applied so we don't cutoff the spot radius falloff.
if (Anim && strength * Brightness < lightCutoff)
{
return 0f;
}
// This is basically the same as how inner radius works. It just applies
// a linear falloff to 0 between the inner angle and outer angle.
if (Spotlight)

View File

@ -597,7 +597,7 @@ public class LightMapper
if (TraceRay(light.Position, point))
{
strength += targetWeights[idx] * light.StrengthAtPoint(point, plane);
strength += targetWeights[idx] * light.StrengthAtPoint(point, plane, settings.AnimLightCutoff);
}
}