Expose Zyphos fractal resource plan
This commit is contained in:
parent
7fbff66f7b
commit
11737febc1
4 changed files with 55 additions and 0 deletions
|
|
@ -71,6 +71,7 @@ public static class ZyphosFractalTerrain
|
|||
var plan = new ZyphosFractalRenderPlan(
|
||||
brushes,
|
||||
selectedCut,
|
||||
resourcePlan,
|
||||
bucketPixelsPerWorld,
|
||||
$"{selectedCut.Length}/{Summaries.Value.Length} cuts / {brushes.Length}/{OwnershipTree.Claims.Count} brushes / {resourcePlan.UpdateNodes.Length}/{DefaultBudget.MaxCpuUpdates} cpu updates / {resourcePlan.GpuEstimatedCost:0.0}/{DefaultBudget.MaxGpuEstimatedCost:0.0} gpu cost / {resourcePlan.Residency.ResidentNodes.Count}/{DefaultBudget.MaxResidentPayloads} resident / {resourcePlan.Residency.RequestedNodes.Count}/{DefaultBudget.MaxSsdRequests} ssd requests / {bucketPixelsPerWorld:0.00} px-wu");
|
||||
|
||||
|
|
@ -85,6 +86,39 @@ public static class ZyphosFractalTerrain
|
|||
public static string Summary =>
|
||||
$"{Path.GetFileName(PatchPath)} / {OwnershipTree.Claims.Count} DSL claims / {OwnershipTree.Nodes.Count} tile nodes / {SelectedCut.Value.Length} cuts / {HeightBrushes.Length} shaped brushes";
|
||||
|
||||
public static string BuildPlanDebugDump(ZyphosFractalRenderPlan plan)
|
||||
{
|
||||
var budget = plan.ResourcePlan.Budget;
|
||||
var lines = new List<string>
|
||||
{
|
||||
"Zyphos fractal resource plan",
|
||||
$" pixelsPerWorld: {plan.PixelsPerWorld:0.000}",
|
||||
$" selectedCut: {plan.SelectedCuts.Length}/{Summaries.Value.Length}",
|
||||
$" brushes: {plan.HeightBrushes.Length}/{OwnershipTree.Claims.Count}",
|
||||
$" cpuUpdates: {plan.ResourcePlan.UpdateNodes.Length}/{budget.MaxCpuUpdates}",
|
||||
$" gpuEstimatedCost: {plan.ResourcePlan.GpuEstimatedCost:0.000}/{budget.MaxGpuEstimatedCost:0.000}",
|
||||
$" ramResident: {plan.ResourcePlan.Residency.ResidentNodes.Count}/{budget.MaxResidentPayloads}",
|
||||
$" ssdRequests: {plan.ResourcePlan.Residency.RequestedNodes.Count}/{budget.MaxSsdRequests}",
|
||||
"selected:",
|
||||
};
|
||||
|
||||
foreach (var cut in plan.SelectedCuts)
|
||||
{
|
||||
lines.Add($" {cut.NodeKey.Value} score={cut.Score:0.000} fade={cut.Fade:0.000} requestChildren={cut.RequestedChildren}");
|
||||
}
|
||||
|
||||
if (plan.ResourcePlan.UpdateNodes.Length > 0)
|
||||
{
|
||||
lines.Add("updates:");
|
||||
foreach (var key in plan.ResourcePlan.UpdateNodes)
|
||||
{
|
||||
lines.Add($" {key.Value}");
|
||||
}
|
||||
}
|
||||
|
||||
return string.Join(Environment.NewLine, lines);
|
||||
}
|
||||
|
||||
private static float ScoreForState(AquariumContributionState state, float pixelsPerWorld)
|
||||
{
|
||||
foreach (var summary in Summaries.Value)
|
||||
|
|
@ -116,5 +150,6 @@ public static class ZyphosFractalTerrain
|
|||
public readonly record struct ZyphosFractalRenderPlan(
|
||||
AquariumHeightFieldBrush[] HeightBrushes,
|
||||
AquariumSelectedCut[] SelectedCuts,
|
||||
FractalResourcePlan ResourcePlan,
|
||||
float PixelsPerWorld,
|
||||
string Summary);
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@ public sealed class ZyphosRuntime : IAquariumRuntime
|
|||
})
|
||||
.Command("zyphos", _ => $"Zyphos: {ZyphosFractalTerrain.Summary}", "Report Zyphos demo status.")
|
||||
.Command("zyphos-fractal", _ => ZyphosFractalTerrain.DebugDump, "Dump the compiled Zyphos fractal terrain grammar.")
|
||||
.Command("zyphos-fractal-plan", _ => ZyphosFractalTerrain.BuildPlanDebugDump(ZyphosFractalTerrain.BuildRenderPlan(CurrentShot())), "Dump the current Zyphos fractal selected cut and resource budget.")
|
||||
.Command("zyphos-system", _ => $"Zyphos-Umbros: separation {ZyphosUmbrosSystem.SeparationInZyphosRadii:0.0} Zyphos radii, Umbros radius {ZyphosUmbrosSystem.UmbrosRadiusRatio:0.00} Zyphos, apparent diameter {ZyphosUmbrosSystem.UmbrosAngularDiameterDegrees:0.0} degrees.", "Report the modeled Zyphos/Umbros/star baseline.");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue