mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 21:03:47 -10:00
While models load, await_models now holds the active cameras off (raea-sys-post's views.rs). The render world still prepares meshes, textures and pipelines, but bins nothing. It turns them on before the first frame, so every view bins the whole scene into new phases in queue order. Turning views off after a draw was binned instead loses what Bevy extracts only on a change. And a morph mesh first seen by a view after loading would keep "no morph" for good: Bevy 0.20 gives it a descriptor only once its instance was collected, and collects an instance only when it changes. So views::on runs one update and then marks each morphed mesh's Mesh3d changed (bevy-ts morph drew its card unmorphed without that; the old loading updates collected it again by chance). An earlier try, updating only the main world while models load, broke the same case: messages the render world extracts by didn't reach it. bench/room3d-repeat/check.sh renders room3d 8 times at frames where the seam ties and wants every run to match the first. The raea before this fails 5 of 7 runs; the raea with it passes. Five full renders (7200 frames each) hash the same. Frame 0 is pixel-identical to the raea before on room3d, bevy-parity many_foxes, bevy/model and bevy-ts morph. bench/live-3d is 13 of 13, and bevy-ts is 92 pass with 1 open (shader-character's body.glb, open before too). fps, the full room3d render back to back, alternating: 124.3 and 109.7 fps before, 125.7 and 108.1 after. First-frame render, three each alternating: room3d 1.00, 0.66, 0.70 s before and 0.68, 0.68, 0.68 s after; many_foxes 1.26, 0.95, 0.95 s before and 0.96, 0.95, 0.94 s after.
24 lines
1.5 KiB
Bash
Executable File
24 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
# #48: a 3D game rendered again gives the same frames. sdk/react/bench/games/room3d (a room whose walls meet its floor,
|
|
# and glTF trees outside) is rendered RUNS times (8) at frames where a wall's foot and the floor tie in depth, and
|
|
# every run must match the first. Before await_models held the views off while models loaded, the render world binned
|
|
# each mesh at the update its load landed on, so the multidraw's order, and which surface won the tie, changed from
|
|
# run to run: about one run in three differed from the first, by one pixel a frame on the floor's seam.
|
|
# bench/room3d-repeat/check.sh (RAEA_BIN: the raea to run, default target/release/raea; RUNS: how many runs)
|
|
cd "$(dirname "$0")/../.." || exit 2
|
|
BIN=${RAEA_BIN:-$PWD/target/release/raea}
|
|
RUNS=${RUNS:-8}
|
|
AT=35,90,210,258,278,295
|
|
export RAEA_SIGN=0 RAEA_MARK=0 RAEA_EXPORT_CACHE=0
|
|
OUT=$(mktemp -d "${TMPDIR:-/tmp}/raea-room3d-repeat.XXXXXX")
|
|
trap 'rm -rf "$OUT"' EXIT
|
|
status=0
|
|
for i in $(seq 1 "$RUNS"); do
|
|
"$BIN" render sdk/react/bench/games/room3d/edit.tsx --at "$AT" -o "$OUT/$i/" > "$OUT/$i.log" 2>&1 || { echo "FAIL: run $i failed"; tail -5 "$OUT/$i.log"; exit 1; }
|
|
[ "$i" = 1 ] && continue
|
|
d=$(for f in "$OUT/1"/*.png; do cmp -s "$f" "$OUT/$i/$(basename "$f")" || printf '%s ' "$(basename "$f" .png)"; done)
|
|
[ -z "$d" ] || { echo "FAIL: run $i differs from run 1 at $d(of --at $AT)"; status=1; }
|
|
done
|
|
[ $status = 0 ] && echo "PASS: $RUNS runs of room3d, every frame the same"
|
|
exit $status
|