hud: drop [T] CONDUITS layer, always-active thermal glow, and directional hit-arcs

This commit is contained in:
Meta Vens 2026-12-04 23:56:25 +01:00
commit 3e499c31ee
4 changed files with 192 additions and 153 deletions

View file

@ -213,9 +213,6 @@ public partial class Main : Node3D
: Input.MouseModeEnum.Captured;
}
break;
case Key.T:
_hud.ToggleThermal();
break;
case Key.R:
Reset(_seed + 1);
break;
@ -274,21 +271,13 @@ public partial class Main : Node3D
long t0 = Stopwatch.GetTimestamp();
_session.Step(input);
long t1 = Stopwatch.GetTimestamp();
_terrain.Sync(_session.State.Terrain);
long t2 = Stopwatch.GetTimestamp();
_arena.Sync(_session, _elapsedSeconds, (float)delta);
long t3 = Stopwatch.GetTimestamp();
double toMs = 1000.0 / Stopwatch.Frequency;
_perfPendingStepMs += (t1 - t0) * toMs;
_perfPendingTerrainMs += (t2 - t1) * toMs;
_perfPendingArenaMs += (t3 - t2) * toMs;
_perfPhysicsTicks++;
}
else
{
_session.Step(input);
_terrain.Sync(_session.State.Terrain);
_arena.Sync(_session, _elapsedSeconds, (float)delta);
}
}
@ -301,14 +290,23 @@ public partial class Main : Node3D
if (_perfTargetFrames > 0)
{
double toMs = 1000.0 / Stopwatch.Frequency;
long tt0 = Stopwatch.GetTimestamp();
_terrain.Sync(_session.State.Terrain);
long tt1 = Stopwatch.GetTimestamp();
_arena.Sync(_session, _elapsedSeconds, (float)delta);
long ta1 = Stopwatch.GetTimestamp();
_perfPendingTerrainMs = (tt1 - tt0) * toMs;
_perfPendingArenaMs = (ta1 - tt1) * toMs;
long tc0 = Stopwatch.GetTimestamp();
UpdateCamera((float)delta);
_terrain.UpdateTileLod(_camera.GlobalPosition);
long th0 = Stopwatch.GetTimestamp();
_hud.Sync(_session);
long th1 = Stopwatch.GetTimestamp();
_perfCamMsSum += (th0 - tc0) * 1000.0 / Stopwatch.Frequency;
double hudMs = (th1 - th0) * 1000.0 / Stopwatch.Frequency;
_perfCamMsSum += (th0 - tc0) * toMs;
double hudMs = (th1 - th0) * toMs;
long now = Stopwatch.GetTimestamp();
double frameMs = (now - _perfLastFrameTick) * 1000.0 / Stopwatch.Frequency;
@ -342,6 +340,8 @@ public partial class Main : Node3D
}
else
{
_terrain.Sync(_session.State.Terrain);
_arena.Sync(_session, _elapsedSeconds, (float)delta);
UpdateCamera((float)delta);
_terrain.UpdateTileLod(_camera.GlobalPosition);
_hud.Sync(_session);
@ -423,6 +423,16 @@ public partial class Main : Node3D
GD.Print($" Paladin sample nodes: {string.Join(", ", names)}");
}
GD.Print("=== END PERF BENCHMARK ===");
string? previewOut = System.Environment.GetEnvironmentVariable("RTD_CAPTURE_PREVIEW");
if (!string.IsNullOrWhiteSpace(previewOut) && DisplayServer.GetName() != "headless")
{
var img = GetViewport().GetTexture()?.GetImage();
if (img is not null)
{
var err = img.SavePng(previewOut);
GD.Print($"PERF PREVIEW SAVED: {previewOut} ({img.GetWidth()}x{img.GetHeight()}, err={err})");
}
}
GetTree().Quit(0);
}
@ -614,7 +624,7 @@ public partial class Main : Node3D
LightEnergy = 1.45f,
ShadowEnabled = true,
DirectionalShadowMode = DirectionalLight3D.ShadowMode.Parallel2Splits,
DirectionalShadowMaxDistance = 145f,
DirectionalShadowMaxDistance = 88f,
RotationDegrees = new Vector3(-48f, 32f, 0f)
};
AddChild(sun);