diff --git a/KeepersCompound.Lightmapper/Light.cs b/KeepersCompound.Lightmapper/Light.cs index 73cb1ea..6585027 100644 --- a/KeepersCompound.Lightmapper/Light.cs +++ b/KeepersCompound.Lightmapper/Light.cs @@ -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) diff --git a/KeepersCompound.Lightmapper/LightMapper.cs b/KeepersCompound.Lightmapper/LightMapper.cs index 71977e7..7d256a1 100644 --- a/KeepersCompound.Lightmapper/LightMapper.cs +++ b/KeepersCompound.Lightmapper/LightMapper.cs @@ -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); } }