#!/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