diff --git a/KeepersCompound.Lightmapper/LightMapper.cs b/KeepersCompound.Lightmapper/LightMapper.cs index ddcaf92..ac66f55 100644 --- a/KeepersCompound.Lightmapper/LightMapper.cs +++ b/KeepersCompound.Lightmapper/LightMapper.cs @@ -564,8 +564,8 @@ public class LightMapper } var visibleSet = settings.FastPvs switch { - true => pvs.ComputeVisibilityFast(lightCellMap[i]), - false => pvs.ComputeVisibilityExact(_lights[i].Position, lightCellMap[i], _lights[i].Radius) + true => pvs.ComputeVisibilityFast(cellIdx), + false => pvs.ComputeVisibilityExact(_lights[i].Position, cellIdx, _lights[i].Radius) }; // Log.Information("Light {i} sees {c} cells", i, visibleSet.Count); diff --git a/KeepersCompound.Lightmapper/PotentiallyVisibleSet.cs b/KeepersCompound.Lightmapper/PotentiallyVisibleSet.cs index e436886..74e6c5f 100644 --- a/KeepersCompound.Lightmapper/PotentiallyVisibleSet.cs +++ b/KeepersCompound.Lightmapper/PotentiallyVisibleSet.cs @@ -154,7 +154,7 @@ public class PotentiallyVisibleSet return []; } - var visibleCells = new HashSet(); + var visibleCells = new HashSet { cellIdx }; foreach (var edgeIdx in _graph[cellIdx].EdgeIndices) { var edge = _edges[edgeIdx];