OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-tps / scenes / test / dc_terrain_map_pt_bench.tscn

56 lines · tscn ref:
[gd_scene format=3]

; Bench rig for map_dc_terrain — the scene the 60->20fps regression was actually
; observed in (hyper-games #11 §5, F7 lives at scenes/maps/map_dc_terrain.gd:312).
;
; WHY THIS EXISTS. Every number in benchmarks/pt/RESULTS.md was measured in
; scenes/test/dc_terrain_streaming_pt_noplayer.tscn, which is DCTerrain + a camera +
; one directional light. The map adds Sky3D (sky shader + sun/moon), SunshineClouds2
; (a full-screen compositor compute pass), a CreatureSpawner and WAD-textured terrain.
; So the harness built to explain the regression could not see any of the things that
; distinguish the scene it was reported in. This rig closes that gap.
;
; map_dc_terrain.tscn is INSTANCED, not rebuilt: its 900-line script owns terrain
; config, the sky sim, cloud driver wiring and the edit tooling. A copy would rot.
;
; NO WorldEnvironment here on purpose — the map ships its own (Sky3DExtended), and
; PTBench._find_environment() takes the first one it finds. A second would make which
; environment gets the PT config a tree-order coincidence.
;
; The camera is the map's, not ours. map_dc_terrain.gd:128-133 creates a fly camera in
; _ready() and calls make_current() on it. A Camera3D declared here with current=true
; loses that race (the map's _ready runs first as a child, then overrides), so the rig
; would drive an inactive camera and measure a view nobody is looking through. That
; camera is also unreachable by NodePath — Camera3D.new() + add_child() auto-names it
; "@Camera3D@23" — so camera_path is left empty and PTBench binds the CURRENT camera,
; then aborts if what it bound is not the one rendering.
;
; Usage:
;   bash scripts/pt-bench.sh --label=map --spp=1 --bounces=1 --resolution=1914x1053 \
;     SCENE=res://scenes/test/dc_terrain_map_pt_bench.tscn
; Game defaults are spp=1 bounces=1 (autoloads/settings.gd:69-74) — pass them
; explicitly, because this rig has no RTXTest and the map authors no PT values.

[ext_resource type="Script" path="res://scenes/test/pt_bench.gd" id="1"]
[ext_resource type="PackedScene" path="res://scenes/maps/map_dc_terrain.tscn" id="2"]

[node name="DCTerrainMapPTBench" type="Node3D"]

[node name="MapDCTerrain" parent="." instance=ExtResource("2")]

[node name="CanvasLayer" type="CanvasLayer" parent="."]

[node name="StatsLabel" type="Label" parent="CanvasLayer"]
offset_left = 10.0
offset_top = 10.0
offset_right = 400.0
offset_bottom = 100.0
text = "Loading..."

[node name="PTBench" type="Node" parent="."]
script = ExtResource("1")
terrain_path = NodePath("../MapDCTerrain/DCTerrain")
camera_path = NodePath("../MapDCTerrain/Camera3D")
rtx_path = NodePath("")
stats_label_path = NodePath("../CanvasLayer/StatsLabel")