diff --git a/KeepersCompound.Lightmapper/Program.cs b/KeepersCompound.Lightmapper/Program.cs index b4ef1f6..271d986 100644 --- a/KeepersCompound.Lightmapper/Program.cs +++ b/KeepersCompound.Lightmapper/Program.cs @@ -571,10 +571,7 @@ class Program var cellSphere = new MathUtils.Sphere(cell.SphereCenter, cell.SphereRadius); foreach (var light in lights) { - // Lights should only get added if their radius intersects with the cell - // 0 radius (infinite) lights are a special case with max float - if (light.radius == float.MaxValue || - MathUtils.Intersects(cellSphere, new MathUtils.Sphere(light.position, light.radius))) + if (MathUtils.Intersects(cellSphere, new MathUtils.Sphere(light.position, light.radius))) { cell.LightIndexCount++; cell.LightIndices.Add((ushort)light.lightTableIndex); diff --git a/KeepersCompound.Lightmapper/Utils.cs b/KeepersCompound.Lightmapper/Utils.cs index 0b4de94..fe256bc 100644 --- a/KeepersCompound.Lightmapper/Utils.cs +++ b/KeepersCompound.Lightmapper/Utils.cs @@ -76,6 +76,7 @@ public static class MathUtils return d2 < r2; } + // Should automagically handle max float radii public static bool Intersects(Sphere sphere, Sphere other) { var rsum = sphere.Radius + other.Radius;