mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 21:03:47 -10:00
What changes for authors: a mesh at opacity 1 draws opaque and writes depth, on every frame where it's at 1, even if it fades on other frames. Below 1 it blends. Before, a render made any mesh with an opacity column (one that faded at any point) a blended surface for its whole life, while live play blended only from the first frame below 1. A mesh whose alpha mode is given (alpha: blend, mask...), or a blended picture (a glyph over its atlas, a textured mesh that fades), keeps its own mode at 1. bevy/volumetric-glass differed between the routes on frames 20-39, where its pane is at opacity 1 and the fixture says it "must draw as the opaque one" (frame 19). The live route did that. The program route drew the pane blended, so it wrote no depth: the froxel hero shaft was integrated to the wall behind it and then dimmed by the pane's full opacity, and the shaft in front of the pane was lost. systems/material maps.rs now spawns a mesh opaque at opacity 1, and runtime/scene3d sync_meshes and the toon sync switch Opaque and Blend both ways each frame. froxel_glass already drops a surface's fog copy once it stops blending. Checks: - volumetric-glass: all 90 frames equal between the routes. The program route's frames 20-39 changed and now equal frame 19; no other frame changed. - bench/live-3d/check.sh adds it: 13/13 pass. bevy-ts: 92 pass, 1 open (shader-character's body.glb, open before too). - Old vs new binary, program route, frame hashes: no change in broll (p26), bevy-parity mesh_ray_cast, texture, transparency_3d, bevy-ts alpha-mask, bevy/materials, bevy/studio, conformance layered-clear, react box3d. room3d isn't deterministic (two runs of the old binary differ on 147 frames); its one fade is a Decal, which this doesn't touch. - The 1 to 0.99 edge (a scratch cube held at 1, then 0.99, 0.98 over a sphere): frame 9 to 10 changes as much as 10 to 11 (about 15 px, at most 4 levels), and the same on both routes, before and after. - No golden reference fades a mesh. volumetric-glass, program route, ms a frame before vs after, back to back: 7.3/7.6/7.5 vs 7.5/7.5/7.9.
31 lines
2.6 KiB
Bash
Executable File
31 lines
2.6 KiB
Bash
Executable File
#!/bin/bash
|
|
# #26: a 3D composition's 3D made live, frame by frame as it's stepped (as live play and a game's render make it),
|
|
# draws what its rows made beforehand draw (a render's program), pixel for pixel. Each composition below is rendered
|
|
# to per-frame hashes with RAEA_3D=program and with RAEA_3D=live (RAEA_LIVE3D_CHECK=1: each live frame's fast rows
|
|
# also held against its full rows), and the two must be identical. They caught what live frames sent otherwise than
|
|
# a render keys it: a spot's cone (spotlight), a zero scale's NaN rotation and a bulb's f32 place
|
|
# (spherical_area_lights, lighting), a colour as rounded floats against its hex (screenshake), a rotation's sign
|
|
# (shapes); atmospheric_fog keeps the camera's own spawns, the at-3d scene a ShaderMesh's uniforms; bevy/environment
|
|
# cuts from one panorama to another at frame 30, which live play never made or lit before that frame (#38), and
|
|
# material-field-0 animates a material field past the row columns, which a render drew wrong after frame 0 (#38).
|
|
# Exits 1 on a failure.
|
|
# bench/live-3d/check.sh (RAEA_BIN: the raea to run, default target/release/raea)
|
|
cd "$(dirname "$0")/../.." || exit 2
|
|
BIN=${RAEA_BIN:-$PWD/target/release/raea}
|
|
export RAEA_SIGN=0 RAEA_MARK=0 RAEA_EXPORT_CACHE=0
|
|
OUT=$(mktemp -d "${TMPDIR:-/tmp}/raea-live-3d.XXXXXX")
|
|
trap 'rm -rf "$OUT"' EXIT
|
|
status=0
|
|
for f in bench/at-3d/scene.tsx sdk/raea/bench/bevy-parity/3d/spotlight.tsx sdk/raea/bench/bevy-parity/3d/spherical_area_lights.tsx \
|
|
sdk/raea/bench/bevy-parity/3d/atmospheric_fog.tsx examples/games/screenshake.tsx examples/games/shapes.tsx examples/games/lighting.tsx \
|
|
sdk/raea/bench/bevy/environment/edit.tsx sdk/raea/bench/bevy-ts/cases/material-field-0.tsx \
|
|
sdk/raea/bench/bevy-ts/cases/kept-mount.tsx sdk/raea/bench/bevy-ts/cases/kept-unmount.tsx sdk/raea/bench/bevy/text3d/edit.tsx \
|
|
sdk/raea/bench/bevy/volumetric-glass/edit.tsx; do
|
|
n=$(basename "$f" .tsx)
|
|
RAEA_3D=program "$BIN" render "$f" -o "$OUT/$n.program.txt" > "$OUT/$n.program.log" 2>&1 || { echo "FAIL $f: the programmed render failed"; tail -3 "$OUT/$n.program.log"; status=1; continue; }
|
|
RAEA_3D=live RAEA_LIVE3D_CHECK=1 "$BIN" render "$f" -o "$OUT/$n.live.txt" > "$OUT/$n.live.log" 2>&1 || { echo "FAIL $f: the live render failed: $(grep -o 'RAEA_LIVE3D_CHECK.\{0,160\}' "$OUT/$n.live.log" | head -1)"; status=1; continue; }
|
|
d=$(diff <(cut -d' ' -f2 "$OUT/$n.program.txt") <(cut -d' ' -f2 "$OUT/$n.live.txt") | grep -c '^<')
|
|
if [ "$d" = 0 ]; then echo "PASS $f ($(wc -l < "$OUT/$n.live.txt" | tr -d ' ') frames)"; else echo "FAIL $f: $d frames differ"; status=1; fi
|
|
done
|
|
exit $status
|