Add debug stats

This commit is contained in:
Jarrod Doyle 2024-12-09 20:49:00 +00:00
parent ed1b95af35
commit 9fd33efeed
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 31 additions and 1 deletions

View File

@ -159,6 +159,8 @@ public class LightMapper
worldRep.LightingTable.Reset();
// TODO: Calculate the actual effective radius of infinite lights
// potentially do the same for all lights and lower their radius if necessary?
foreach (var brush in brList.Brushes)
{
switch (brush.media)
@ -171,6 +173,12 @@ public class LightMapper
break;
}
}
var infinite = _lights.Count(light => light.Radius == float.MaxValue);
if (infinite > 0)
{
Console.WriteLine($"WARNING: Infinite radius lights found: {infinite}/{_lights.Count}");
}
}
// TODO: Check if this works (brush is a record type)
@ -361,9 +369,31 @@ public class LightMapper
if (cell.LightIndexCount > 97)
{
Console.WriteLine($"Too many lights in cell at ({cell.SphereCenter}): {cell.LightIndexCount - 1} / 96");
Console.WriteLine($"WARNING: Too many lights in cell at ({cell.SphereCenter}): {cell.LightIndexCount - 1} / 96");
}
});
{
var overLit = 0;
var maxLights = 0;
foreach (var cell in worldRep.Cells)
{
if (cell.LightIndexCount > 97)
{
overLit++;
}
if (cell.LightIndexCount > maxLights)
{
maxLights = cell.LightIndexCount - 1;
}
}
if (overLit > 0)
{
Console.WriteLine($"WARNING: Overlit cells detected: {overLit}/{worldRep.Cells.Length}, MaxLights: {maxLights} / 96");
}
}
}
private void TraceScene(Settings settings)