TerrainView draws the island as 16 x 16 chunks of 64 m, each at one of four detail levels (2, 4, 8 and 16 m spacing) chosen by distance to the camera. TerrainChunkBuilder builds chunk geometry on WorkerThreadPool threads; the main thread only uploads finished meshes, within a 2 ms per-frame budget, nearest chunks first. - Seams: every chunk hangs skirts deeper than twice the most any level strays from the full-resolution edge, so neighbours at any two levels meet without a crack. Normals come from the full-resolution heightfield at every level, and back faces light like the ground above them. - Splat material: a procedural shader blends sand, marsh, grass and rock with weights from the island's bands, averaged over 4 m so borders blend. Steep ground turns to rock and summits weather pale. - Collision stays SimGround's heightfield, with no renderer involved. - Capture scenarios terrain, terrain_lod (tinted by level) and terrain_cracks (magenta sky). tools/crack_check.gd counts sky pixels seen through the ground; make terrain-capture requires cracks in a skirtless control and none in the real terrain. Tests: chunk vertices sit on the heightfield; skirts cover every pairing of levels on sampled shared edges; detail falls with distance; flying across the island at 30 m/s for 2,037 frames streams 661 chunk rebuilds with the worst main-thread frame at 0.8 to 1.4 ms (headless, CPU only); 24 players over 900 ticks on two generated islands never sink into the ground, and a player sprints up towards a summit unharmed. make terrain-capture: control 437 crack pixels, terrain 0. Closes #10 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
1.2 KiB
Bash
Executable File
24 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Proves terrain chunks meet without cracks across detail levels. Renders the
|
|
# terrain_cracks scenario, where a magenta sky shows through any gap, and requires zero
|
|
# crack pixels. It first renders terrain_cracks_control, the same view with skirts turned
|
|
# off, and requires cracks there, so a passing result means the check can see them.
|
|
# Needs Docker, like tools/capture.sh.
|
|
set -uo pipefail
|
|
cd "$(dirname "${BASH_SOURCE[0]}")/.."
|
|
mkdir -p captures
|
|
status=0
|
|
|
|
tools/capture.sh terrain_cracks_control captures/terrain_cracks_control.png --frames=10 >/dev/null || exit 1
|
|
if tools/godot.sh --script res://tools/crack_check.gd -- --image="$PWD/captures/terrain_cracks_control.png" | grep crack_check; then
|
|
echo "terrain-capture FAIL: the control without skirts showed no cracks, so the check proves nothing"
|
|
status=1
|
|
fi
|
|
tools/capture.sh terrain_cracks captures/terrain_cracks.png --frames=10 >/dev/null || exit 1
|
|
if ! tools/godot.sh --script res://tools/crack_check.gd -- --image="$PWD/captures/terrain_cracks.png" | grep crack_check; then
|
|
echo "terrain-capture FAIL: cracks between terrain chunks"
|
|
status=1
|
|
fi
|
|
[[ $status -eq 0 ]] && echo "terrain-capture: ok (control cracks, real terrain has none)"
|
|
exit $status
|