Render Zyphos sun and scale domain zoom
This commit is contained in:
parent
2781c62549
commit
9419b2acc2
11 changed files with 126 additions and 14 deletions
53
src/Aquarium.Zyphos/Shaders/D3D12ZyphosStar.hlsl
Normal file
53
src/Aquarium.Zyphos/Shaders/D3D12ZyphosStar.hlsl
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
static const int SDF_INDEX = 2;
|
||||
|
||||
#define SDF_TRACE_STEPS 160
|
||||
#define SDF_TRACE_STEP_SCALE 0.55
|
||||
#define SDF_TRACE_MAX_STEP_RADIUS_SCALE 0.08
|
||||
|
||||
#include "D3D12SdfCommon.hlsli"
|
||||
#include "D3D12SdfMath.hlsli"
|
||||
|
||||
float starGranulation(float3 dir, float phase)
|
||||
{
|
||||
float bands =
|
||||
sin(dir.x * 17.0 + phase * 1.7) * 0.18 +
|
||||
sin(dir.y * 23.0 - phase * 1.1) * 0.14 +
|
||||
sin((dir.x + dir.y + dir.z) * 41.0 + phase * 0.6) * 0.08;
|
||||
return bands;
|
||||
}
|
||||
|
||||
float sdfDistance(float3 p, int sdfIndex)
|
||||
{
|
||||
SdfObject star = sdfObjects[sdfIndex];
|
||||
float3 local = p - star.centerRadius.xyz;
|
||||
float radius = max(star.state.x, 0.001);
|
||||
float3 dir = normalize(local);
|
||||
float coronaLift = starGranulation(dir, timeSeconds) * 0.05;
|
||||
return length(local) - radius * (1.0 + coronaLift);
|
||||
}
|
||||
|
||||
SdfSurface sdfSurface(float3 p, int sdfIndex)
|
||||
{
|
||||
SdfObject star = sdfObjects[sdfIndex];
|
||||
float3 dir = normalize(p - star.centerRadius.xyz);
|
||||
float granulation = starGranulation(dir, timeSeconds);
|
||||
float hot = saturate(0.58 + granulation);
|
||||
|
||||
SdfSurface surface;
|
||||
surface.baseColor = lerp(float3(1.0, 0.34, 0.08), float3(1.0, 0.88, 0.42), hot);
|
||||
surface.metallic = 0.0;
|
||||
surface.roughness = 0.72;
|
||||
surface.emission = surface.baseColor * lerp(3.8, 7.5, hot);
|
||||
return surface;
|
||||
}
|
||||
|
||||
float3 shadeSdf(float2 uv, float travel, float3 p, float3 normal, int sdfIndex, SdfSurface surface)
|
||||
{
|
||||
float3 viewDirection = normalize(cameraPosition - p);
|
||||
float rim = pow(1.0 - saturate(dot(normal, viewDirection)), 2.4);
|
||||
float pulse = sin(timeSeconds * 1.3 + dot(normal, float3(11.0, 7.0, 5.0))) * 0.5 + 0.5;
|
||||
float3 corona = float3(1.0, 0.42, 0.12) * (rim * 5.5 + pow(rim, 8.0) * 12.0) * lerp(0.82, 1.18, pulse);
|
||||
return surface.emission + corona;
|
||||
}
|
||||
|
||||
#include "D3D12SdfProxy.hlsli"
|
||||
|
|
@ -8,6 +8,8 @@ public readonly record struct ZyphosCameraShot(
|
|||
Vector3 ParentAnchor,
|
||||
Vector3 TrackedCenter,
|
||||
float EffectiveDistance,
|
||||
float MinimumDistance,
|
||||
float MaximumDistance,
|
||||
ZyphosSpatialDomainKey DomainKey,
|
||||
ZyphosSpatialDomainKey? ParentDomainKey);
|
||||
|
||||
|
|
@ -26,11 +28,12 @@ public static class ZyphosCameraComposer
|
|||
var parentPose = parentDomain?.Pose(timeSeconds) ?? domainPose;
|
||||
var parent = parentPose.Center;
|
||||
var tracked = domainPose.Center;
|
||||
var subjectSpan = Vector3.Distance(parent, tracked) + domainPose.Radius + (parentDomain is null ? 0.0f : parentPose.Radius * 0.35f);
|
||||
var effectiveDistance = MathF.Max(requestedDistance, MathF.Max(domain.NavigationRadius, subjectSpan * 1.22f));
|
||||
var minimumDistance = MinimumDistanceFor(domainPose);
|
||||
var maximumDistance = MaximumDistanceFor(domainPose, parentPose, parentDomain is not null);
|
||||
var effectiveDistance = Math.Clamp(requestedDistance, minimumDistance, maximumDistance);
|
||||
var orbitDirection = OrbitDirection(yaw, pitch);
|
||||
var cameraPosition = parent + orbitDirection * effectiveDistance;
|
||||
return new ZyphosCameraShot(cameraPosition, parent, parent, tracked, effectiveDistance, domain.Key, domain.ParentKey);
|
||||
return new ZyphosCameraShot(cameraPosition, parent, parent, tracked, effectiveDistance, minimumDistance, maximumDistance, domain.Key, domain.ParentKey);
|
||||
}
|
||||
|
||||
public static string DisplayName(ZyphosSpatialDomainKey domainKey)
|
||||
|
|
@ -47,4 +50,15 @@ public static class ZyphosCameraComposer
|
|||
-MathF.Cos(yaw) * horizontal,
|
||||
MathF.Sin(pitch)));
|
||||
}
|
||||
|
||||
private static float MinimumDistanceFor(ZyphosSpatialDomainPose domainPose)
|
||||
{
|
||||
return Math.Clamp(domainPose.Radius * 1.65f, 0.035f, 8.0f);
|
||||
}
|
||||
|
||||
private static float MaximumDistanceFor(ZyphosSpatialDomainPose domainPose, ZyphosSpatialDomainPose parentPose, bool hasParent)
|
||||
{
|
||||
var parentSpan = hasParent ? Vector3.Distance(parentPose.Center, domainPose.Center) + parentPose.Radius * 0.25f : 0.0f;
|
||||
return MathF.Max(8.0f, MathF.Max(domainPose.Radius * 12.0f, parentSpan + domainPose.Radius * 5.0f));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ public static class ZyphosRenderPlan
|
|||
{
|
||||
public const int PlanetIndex = 0;
|
||||
public const int UmbrosIndex = 1;
|
||||
public const int SdfObjectCount = 2;
|
||||
public const int StarIndex = 2;
|
||||
public const int SdfObjectCount = 3;
|
||||
|
||||
public static AquariumRenderPlan Create()
|
||||
{
|
||||
|
|
@ -14,7 +15,8 @@ public static class ZyphosRenderPlan
|
|||
app.Shaders
|
||||
.Core("D3D12HeightField.hlsl", "D3D12Scene.hlsl", "D3D12Post.hlsl")
|
||||
.SdfShader("D3D12ZyphosPlanet.hlsl")
|
||||
.SdfShader("D3D12ZyphosUmbros.hlsl");
|
||||
.SdfShader("D3D12ZyphosUmbros.hlsl")
|
||||
.SdfShader("D3D12ZyphosStar.hlsl");
|
||||
|
||||
var heightField = app.RenderTargets.Create("height-field")
|
||||
.FixedSize(128, 128)
|
||||
|
|
|
|||
|
|
@ -52,8 +52,12 @@ public sealed class ZyphosRuntime : IAquariumRuntime
|
|||
get
|
||||
{
|
||||
var shot = CurrentShot();
|
||||
var starPose = ZyphosSpatialDomainCatalog.GetRequired(ZyphosSpatialDomainCatalog.Solar).Pose(timeSeconds);
|
||||
var viewRadius = MathF.Max(
|
||||
MathF.Max(32.0f, shot.EffectiveDistance * 1.15f),
|
||||
Vector3.Distance(shot.CameraTarget, starPose.Center) + starPose.Radius * 1.6f);
|
||||
return new AquariumFrame(
|
||||
new ViewFrame(new Vector2(shot.CameraTarget.X, shot.CameraTarget.Y), MathF.Max(32.0f, shot.EffectiveDistance * 1.15f)),
|
||||
new ViewFrame(new Vector2(shot.CameraTarget.X, shot.CameraTarget.Y), viewRadius),
|
||||
shot.CameraPosition,
|
||||
shot.CameraTarget,
|
||||
timeSeconds,
|
||||
|
|
@ -70,9 +74,9 @@ public sealed class ZyphosRuntime : IAquariumRuntime
|
|||
panel.Section("Planetary Demo");
|
||||
panel.Toggle("Auto Orbit", () => autoOrbit, value => autoOrbit = value);
|
||||
panel.Slider("Time Scale", () => timeScale, value => timeScale = value, 0.0f, 4.0f, "0.00");
|
||||
panel.Slider("Orbit Distance", () => orbitDistance, value => orbitDistance = value, 9.0f, 72.0f, "0.0");
|
||||
panel.Slider("Orbit Distance", () => orbitDistance, value => orbitDistance = ClampOrbitDistance(value), 0.04f, 180.0f, "0.00");
|
||||
panel.Readout("Runtime", () => $"{timeSeconds:0.0}s");
|
||||
panel.Readout("Camera", () => $"{ZyphosCameraComposer.DisplayName(selectedDomainKey)} / {orbitDistance:0.0} wu / yaw {orbitYaw:0.00}");
|
||||
panel.Readout("Camera", () => $"{ZyphosCameraComposer.DisplayName(selectedDomainKey)} / {CurrentShot().EffectiveDistance:0.00} wu / yaw {orbitYaw:0.00}");
|
||||
panel.Readout("Terrain DSL", () => ZyphosFractalTerrain.Summary);
|
||||
panel.Readout("Binary", () => $"Umbros {ZyphosUmbrosSystem.UmbrosAngularDiameterDegrees:0.0} deg / {ZyphosUmbrosSystem.SeparationInZyphosRadii:0.0} Rz");
|
||||
panel.Readout("Objects", () => "fractal height DSL, atmosphere, Umbros");
|
||||
|
|
@ -83,6 +87,7 @@ public sealed class ZyphosRuntime : IAquariumRuntime
|
|||
panel.Toggle("Auto Orbit", () => autoOrbit, value => autoOrbit = value);
|
||||
panel.Readout("Mode", () => ZyphosCameraComposer.DisplayName(selectedDomainKey));
|
||||
panel.Readout("Pivot", CurrentPivotLabel);
|
||||
panel.Readout("Zoom", () => $"{CurrentShot().MinimumDistance:0.00}-{CurrentShot().MaximumDistance:0.0} wu");
|
||||
panel.Readout("Mouse", () => "drag orbit / wheel zoom");
|
||||
panel.Section("Spatial Domains");
|
||||
foreach (var domain in ZyphosSpatialDomainCatalog.Domains)
|
||||
|
|
@ -149,7 +154,8 @@ public sealed class ZyphosRuntime : IAquariumRuntime
|
|||
|
||||
if (MathF.Abs(input.WheelDelta) > 0.0f)
|
||||
{
|
||||
orbitDistance = Math.Clamp(orbitDistance - input.WheelDelta * 1.4f, 8.0f, 84.0f);
|
||||
var zoomScale = MathF.Max(CurrentShot().EffectiveDistance * 0.12f, 0.035f);
|
||||
orbitDistance = ClampOrbitDistance(orbitDistance - input.WheelDelta * zoomScale);
|
||||
}
|
||||
|
||||
if (input.LeftMouseDown && input.MouseDelta != Vector2.Zero)
|
||||
|
|
@ -163,7 +169,7 @@ public sealed class ZyphosRuntime : IAquariumRuntime
|
|||
{
|
||||
autoOrbit = false;
|
||||
orbitYaw -= input.MouseDelta.X * 0.0025f;
|
||||
orbitDistance = Math.Clamp(orbitDistance + input.MouseDelta.Y * 0.055f, 8.0f, 84.0f);
|
||||
orbitDistance = ClampOrbitDistance(orbitDistance + input.MouseDelta.Y * MathF.Max(CurrentShot().EffectiveDistance * 0.006f, 0.01f));
|
||||
}
|
||||
|
||||
if (input.IsKeyPressed(KeyCode.Digit1))
|
||||
|
|
@ -206,7 +212,8 @@ public sealed class ZyphosRuntime : IAquariumRuntime
|
|||
{
|
||||
selectedDomainKey = key;
|
||||
var domain = ZyphosSpatialDomainCatalog.GetRequired(key);
|
||||
orbitDistance = Math.Clamp(orbitDistance, 8.0f, MathF.Max(84.0f, domain.NavigationRadius * 2.0f));
|
||||
var shot = CurrentShot();
|
||||
orbitDistance = Math.Clamp(MathF.Min(orbitDistance, domain.NavigationRadius * 2.0f), shot.MinimumDistance, shot.MaximumDistance);
|
||||
while (ZyphosSpatialDomainCatalog.ParentOf(domain) is { } parent)
|
||||
{
|
||||
expandedDomains[parent.Key] = true;
|
||||
|
|
@ -245,6 +252,12 @@ public sealed class ZyphosRuntime : IAquariumRuntime
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
private float ClampOrbitDistance(float value)
|
||||
{
|
||||
var shot = CurrentShot();
|
||||
return Math.Clamp(value, shot.MinimumDistance, shot.MaximumDistance);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class ZyphosRuntimeFactory : IAquariumRuntimeFactory
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ public static class ZyphosSceneBuilder
|
|||
var rotation = ZyphosUmbrosSystem.MutualPhase(timeSeconds);
|
||||
var umbrosCenter = ZyphosUmbrosSystem.UmbrosCenter(timeSeconds);
|
||||
var previousUmbrosCenter = ZyphosUmbrosSystem.UmbrosCenter(previousTimeSeconds);
|
||||
var starCenter = ZyphosUmbrosSystem.PrimaryStarCenter(timeSeconds);
|
||||
var previousStarCenter = ZyphosUmbrosSystem.PrimaryStarCenter(previousTimeSeconds);
|
||||
|
||||
var objects = new AquariumSdfObject[ZyphosRenderPlan.SdfObjectCount];
|
||||
objects[ZyphosRenderPlan.PlanetIndex] = new AquariumSdfObject(
|
||||
|
|
@ -38,6 +40,10 @@ public static class ZyphosSceneBuilder
|
|||
new Vector4(umbrosCenter, ZyphosUmbrosSystem.UmbrosBoundRadius),
|
||||
new Vector4(previousUmbrosCenter, 0.0f),
|
||||
new Vector4(ZyphosUmbrosSystem.UmbrosSurfaceRadius, rotation, ZyphosUmbrosSystem.CenterSeparation, 0.0f));
|
||||
objects[ZyphosRenderPlan.StarIndex] = new AquariumSdfObject(
|
||||
new Vector4(starCenter, ZyphosUmbrosSystem.PrimaryStarVisualRadius),
|
||||
new Vector4(previousStarCenter, 0.0f),
|
||||
new Vector4(ZyphosUmbrosSystem.PrimaryStarVisualRadius, rotation, 0.0f, 0.0f));
|
||||
|
||||
return objects;
|
||||
}
|
||||
|
|
@ -48,7 +54,7 @@ public static class ZyphosSceneBuilder
|
|||
return
|
||||
[
|
||||
new AquariumSdfLight(
|
||||
new Vector4(starCenter, 5.5f),
|
||||
new Vector4(starCenter, ZyphosUmbrosSystem.PrimaryStarVisualRadius),
|
||||
new Vector4(3.2f, 2.5f, 1.8f, -100.0f)),
|
||||
new AquariumSdfLight(
|
||||
new Vector4(ZyphosUmbrosSystem.UmbrosCenter(timeSeconds), ZyphosUmbrosSystem.UmbrosSurfaceRadius),
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public static class ZyphosSpatialDomainCatalog
|
|||
|
||||
private static readonly ZyphosSpatialDomain[] DomainList =
|
||||
[
|
||||
new(Solar, null, "Parent Star", "solar", "Solar", ZyphosUmbrosSystem.CenterSeparation * 5.4f, time => new ZyphosSpatialDomainPose(ZyphosUmbrosSystem.PrimaryStarCenter(time), ZyphosUmbrosSystem.CenterSeparation * 0.28f)),
|
||||
new(Solar, null, "Parent Star", "sun", "Solar", ZyphosUmbrosSystem.CenterSeparation * 0.9f, time => new ZyphosSpatialDomainPose(ZyphosUmbrosSystem.PrimaryStarCenter(time), ZyphosUmbrosSystem.PrimaryStarVisualRadius)),
|
||||
new(Orbital, Solar, "Zyphos-Umbros Orbit", "orbital", "Orbital", ZyphosUmbrosSystem.CenterSeparation * 1.9f, time => new ZyphosSpatialDomainPose(BinaryCenter(time), ZyphosUmbrosSystem.CenterSeparation * 0.5f)),
|
||||
new(Planet, Orbital, "Zyphos", "planet", "Planetary", ZyphosUmbrosSystem.ZyphosBoundRadius * 2.6f, _ => new ZyphosSpatialDomainPose(ZyphosUmbrosSystem.ZyphosCenter, ZyphosUmbrosSystem.ZyphosBoundRadius)),
|
||||
new(Umbros, Orbital, "Umbros", "twin", "Planetary", ZyphosUmbrosSystem.CenterSeparation * 1.35f, time => new ZyphosSpatialDomainPose(ZyphosUmbrosSystem.UmbrosCenter(time), ZyphosUmbrosSystem.UmbrosBoundRadius)),
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ public static class ZyphosUmbrosSystem
|
|||
public const float SeparationInZyphosRadii = 8.0f;
|
||||
public const float SeaLevel = 0.56f;
|
||||
public const float MutualPhaseRate = 0.032f;
|
||||
public const float PrimaryStarVisualRadius = 3.2f;
|
||||
|
||||
public static float UmbrosSurfaceRadius => ZyphosSurfaceRadius * UmbrosRadiusRatio;
|
||||
|
||||
|
|
|
|||
|
|
@ -145,3 +145,4 @@
|
|||
{"timestamp":"2026-05-18T04:50:36+01:00","topic":"zyphos-domain-navigation","lesson":"The Zyphos navigation panel must be a real domain navigator, not toggles masquerading as hierarchy. AquariumUiTreeItem provides generic selectable disclosure rows; Zyphos owns a spatial domain catalog keyed to solar/orbital/planetary/surface/tile domains; the camera composer derives tracked center, parent pivot, and effective distance from the selected domain key. Mouse drag/wheel now drives orbit/zoom for the active spatial frame.","files":["src/Aquarium.Engine.Contracts/Ui/AquariumUi.cs","src/Aquarium.Engine/Render/Ui/DebugUi.cs","src/Aquarium.Zyphos/ZyphosSpatialDomainCatalog.cs","src/Aquarium.Zyphos/ZyphosCameraComposer.cs","src/Aquarium.Zyphos/ZyphosRuntime.cs","tests/Aquarium.Engine.Fractal.Tests/ZyphosCameraComposerTests.cs","state/map.yaml","state/memory.json"],"source":"user rejected undercooked Zyphos navigation panel and demanded selectable domain camera modes plus mouse navigation"}
|
||||
{"timestamp":"2026-05-18T05:13:27+01:00","topic":"zyphos-umbros-fractal-stress-domains","lesson":"Zyphos and Umbros should both be first-class selectable fractal bodies. The `.aquageo` patch now declares Umbros lat/long plus multiple cube-tile children for both bodies and emits 31 shaped brush claims. D3D12 height-field brush constants were expanded to a deliberate 32-entry fixed table so stress data is not silently clipped at 16. Planet and Umbros SDF shaders also add cheap bounded quadtree-style object-space relief for layered geometry independent of the flattened 2D brush backend.","files":["src/Aquarium.Zyphos/Worlds/zyphos-first-fractal-terrain.aquageo","src/Aquarium.Zyphos/ZyphosSpatialDomainCatalog.cs","src/Aquarium.Engine/Render/Features/D3D12HeightFieldBrushConstants.cs","src/Aquarium.Engine/Render/Shaders/D3D12HeightField.hlsl","src/Aquarium.Zyphos/Shaders/D3D12ZyphosPlanet.hlsl","src/Aquarium.Zyphos/Shaders/D3D12ZyphosUmbros.hlsl","tests/Aquarium.Engine.Fractal.Tests/ZyphosFractalTerrainTests.cs","tests/Aquarium.Engine.Fractal.Tests/ZyphosSpatialDomainCatalogTests.cs"],"source":"user asked for Zyphos and Umbros selectable sub-domains plus more quadtree SDF fractals and layered geometry for stress testing"}
|
||||
{"timestamp":"2026-05-18T09:45:34+01:00","topic":"everything-is-a-fractal-recursive-domains","lesson":"The Zyphos world patch now expresses the 'everything is a fractal' idea as explicit recursive domains: planet -> lat/long -> continent -> forest -> tree -> leaf and continent -> coast -> pebble field, plus Umbros -> crater province -> boulder field -> pebble field. The flattened stress backend emits 58 shaped brush claims into a 64-entry D3D12 table, while SDF shaders add bounded leaf/pebble material-relief clusters so the recursion is visible even before true recursive residency and LOD caching exist.","files":["src/Aquarium.Zyphos/Worlds/zyphos-first-fractal-terrain.aquageo","src/Aquarium.Zyphos/ZyphosSpatialDomainCatalog.cs","src/Aquarium.Zyphos/ZyphosRuntime.cs","src/Aquarium.Engine/Render/Features/D3D12HeightFieldBrushConstants.cs","src/Aquarium.Engine/Render/Shaders/D3D12HeightField.hlsl","src/Aquarium.Zyphos/Shaders/D3D12ZyphosPlanet.hlsl","src/Aquarium.Zyphos/Shaders/D3D12ZyphosUmbros.hlsl","tests/Aquarium.Engine.Fractal.Tests/ZyphosCameraComposerTests.cs","tests/Aquarium.Engine.Fractal.Tests/ZyphosFractalTerrainTests.cs","tests/Aquarium.Engine.Fractal.Tests/ZyphosSpatialDomainCatalogTests.cs"],"source":"user asked to see recursive domains everywhere, from continent-scale detail down to pebble, forests down to leaf"}
|
||||
{"timestamp":"2026-05-18T09:58:37+01:00","topic":"zyphos-visible-sun-and-domain-zoom","lesson":"The primary star cannot remain only an SDF light if users need spatial orientation; it is now a rendered SDF object with emission/corona and a Solar navigation target. Camera zoom limits are now derived from the selected domain pose instead of a global 8-unit floor, so leaf and pebble domains can be inspected at their own scale while broad orbital domains still retain safe maximum framing.","files":["src/Aquarium.Zyphos/ZyphosRenderPlan.cs","src/Aquarium.Zyphos/ZyphosSceneBuilder.cs","src/Aquarium.Zyphos/Shaders/D3D12ZyphosStar.hlsl","src/Aquarium.Zyphos/ZyphosCameraComposer.cs","src/Aquarium.Zyphos/ZyphosRuntime.cs","src/Aquarium.Zyphos/ZyphosSpatialDomainCatalog.cs","tests/Aquarium.Engine.Fractal.Tests/ZyphosCameraComposerTests.cs"],"source":"user asked where the sun is and why zoom cannot reach the cool small features"}
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ renderer_state:
|
|||
- The fractal grammar layer validates nested domain topology through FractalDomainGraph: duplicate keys, missing parents, cycles, and root-to-leaf paths are grammar concerns, not renderer folklore.
|
||||
- Aquarium frames now carry a 3D camera target in addition to the legacy 2D ViewFrame center. Zyphos uses a camera composer to separate tracked subject, parent composition anchor, and camera orbit distance.
|
||||
- Zyphos camera navigation is domain-key driven: selecting any solar/orbital/planetary/surface/object/tile domain in the floating Navigation tree changes the active camera mode, derives the parent pivot from the domain hierarchy, and lets mouse drag/wheel orbit or zoom that selected spatial frame. Zyphos and Umbros both expose lat/long surface domains, recursive subdomains, object-scale domains, and cube-tile children.
|
||||
- Zyphos domain zoom is scale-aware: leaf/pebble domains can drive the camera below planetary distances, while larger domains retain broad framing. The parent star is a rendered SDF object as well as a light source, so selecting the Solar domain targets a visible sun instead of an invisible lamp.
|
||||
- The current height-field stress backend uploads a fixed table of 64 shaped 2D brushes to D3D12. The richer Zyphos/Umbros .aquageo patch currently emits 58 brushes across recursive continent/forest/leaf/coast/pebble and Umbros crater/boulder/pebble domains.
|
||||
- Zyphos and Umbros SDF planet shaders include cheap bounded quadtree-style layered relief in object space, separate from the flattened 2D height-brush stress path.
|
||||
- SceneState can disable the legacy height-field surface trace and request a procedural starfield background; Zyphos uses this for space views so the old Grid does not leak into planetary rendering.
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@
|
|||
"IFS LOD should choose a stable hierarchy cut from cached node summaries, not blindly score every leaf. Each node needs bounds, max form/material error, coverage/normal or gradient bounds, estimated cost, online estimator state, residency, and summary/child payload handles. Children fade in when projected contribution exceeds threshold and resident budget allows; parent summaries remain renderable fallbacks.",
|
||||
"The IFS contribution cache must probabilistically refresh node weights under a per-frame update budget. Use online mean/variance/confidence/sample-age state with nonzero exploration for visible or near-threshold nodes so weights converge instead of freezing stale guesses. Learned scoring may later rank update and residency priority from observed high-quality probes, but conservative summaries remain the safety authority for SDF bounds and visibility.",
|
||||
"Zyphos fractal stress data should keep authored topology richer than the first renderer backend: both Zyphos and Umbros expose lat/long, surface, object-scale, and cube-tile domains in `.aquageo`, with explicit continent/forest/tree/leaf/coast/pebble and crater/boulder/pebble recursion. The current D3D12 height-field stress table uploads 64 shaped 2D brushes and the SDF planet shaders carry separate cheap bounded quadtree-style relief.",
|
||||
"Zyphos camera distance limits belong to the selected spatial domain, not one global planetary clamp. Leaf/pebble domains must be able to zoom below whole-body distances, and the parent star must be a visible SDF body when it is also the primary light source.",
|
||||
"The consolidated fractal brush architecture lives in research/rendering/fractal-brush-architecture-plan.md. Its pipeline is client intent -> domain roots -> semantic IFS brush grammar -> ownership tree -> node summaries -> contribution cache/residency scheduler -> backend packets -> renderer passes -> debug/evidence. Its credibility depends on module boundaries and tests: contracts, pure CPU fractal core, D3D12 backend, client adapters, mock payload/probe/random/clock seams, shader parity tests, and deterministic performance fixtures.",
|
||||
"The actionable fractal brush roadmap lives in research/rendering/fractal-brush-implementation-roadmap.md. Start with the first work packet: add Aquarium.Engine.Fractal and tests, cube-face/tile key types, identity and tangent projection candidates, an area distortion sampler, face-edge tests, and a projection report before touching recursive detail."
|
||||
],
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@ public sealed class ZyphosCameraComposerTests
|
|||
Assert.Equal(orbitalCenter, shot.CameraTarget);
|
||||
Assert.Equal(orbitalCenter, shot.ParentAnchor);
|
||||
Assert.Equal(ZyphosUmbrosSystem.UmbrosCenter(0.0f), shot.TrackedCenter);
|
||||
Assert.True(shot.EffectiveDistance > ZyphosUmbrosSystem.CenterSeparation);
|
||||
Assert.True(shot.EffectiveDistance > ZyphosUmbrosSystem.CenterSeparation * 0.5f);
|
||||
Assert.True(shot.EffectiveDistance < ZyphosUmbrosSystem.CenterSeparation);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -38,6 +39,25 @@ public sealed class ZyphosCameraComposerTests
|
|||
Assert.Equal(midpoint, shot.TrackedCenter);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SolarFrameTargetsVisibleParentStar()
|
||||
{
|
||||
var shot = ZyphosCameraComposer.Compose(ZyphosSpatialDomainCatalog.Solar, 0.1f, 0.4f, 16.0f, 0.0f);
|
||||
|
||||
Assert.Equal(ZyphosUmbrosSystem.PrimaryStarCenter(0.0f), shot.CameraTarget);
|
||||
Assert.Equal(ZyphosUmbrosSystem.PrimaryStarCenter(0.0f), shot.TrackedCenter);
|
||||
Assert.Null(shot.ParentDomainKey);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LeafScaleDomainsCanZoomBelowPlanetaryDistance()
|
||||
{
|
||||
var shot = ZyphosCameraComposer.Compose(ZyphosSpatialDomainCatalog.CanopyLeaf, 0.1f, 0.4f, 0.1f, 0.0f);
|
||||
|
||||
Assert.True(shot.MinimumDistance < 0.25f);
|
||||
Assert.True(shot.EffectiveDistance < 1.0f);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SurfaceTilePivotsThroughLatLongParent()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue