diff --git a/KeepersCompound.Lightmapper/LightMapper.cs b/KeepersCompound.Lightmapper/LightMapper.cs index 63df56c..85cff24 100644 --- a/KeepersCompound.Lightmapper/LightMapper.cs +++ b/KeepersCompound.Lightmapper/LightMapper.cs @@ -481,9 +481,14 @@ public class LightMapper } } }); + + var pvs = new PotentiallyVisibleSet(worldRep.Cells); + Parallel.ForEach(lightCellMap, i => + { + pvs.ComputeVisibility(i); + }); var visibleCellMap = new List(_lights.Count); - var pvs = new PotentiallyVisibleSet(worldRep.Cells); for (var i = 0; i < _lights.Count; i++) { var cellIdx = lightCellMap[i];