Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

R3F23d: in-fbo 0.9941 and in-pingpong 0.9949 against three.js at frame 12, both now in tools/parity.sh (the ping-pong case clears to black, as three's canvas does under it); the full list of 38 passes. docs/r3f.feature R3F23 says what R3F23c built and what is left: in-reflector, an onBeforeCompile patch (R3F24)

shinyobjectz68f70eb1e64c
diff --git a/docs/r3f.feature b/docs/r3f.feature
index 6c792a14..b3cd3df0 100644
--- a/docs/r3f.feature
+++ b/docs/r3f.feature
@@ -529,7 +529,20 @@ Feature: React Three Fiber both ways: an R3F scene drawn by raea, a raea composi
# 3D targets stay left out. in-fbo (test/parity/targets.tsx, R3F_CASES="in-fbo:12" until tools/parity.sh lists
# it): SSIM 0.9557 against three.js at frame 12. What's left of the gap is the unlit plane showing the target, drawn
# without three's ACES 1/0.6 (Bevy's Exposure scales lit shading only; a plain meshBasicMaterial is as far off): the
- # pass itself matches (a pass camera keeps ev100 9.7, as three's linear pass is lit). Next: R3F23c.
+ # pass itself matches (a pass camera keeps ev100 9.7, as three's linear pass is lit).
+ # Status (11-15, later): R3F23c built. A pass is keyed by its target, what it drew (its scene and the lone mesh's
+ # material) and its count, so GPUComputationRenderer's start and step passes into each of its two targets keep their
+ # own layer and camera frame to frame. A material's texture follows the target drawn this frame: a map naming render
+ # images is keyed (maps, map_k; raea-sys-rendermap), a ShaderMaterial's (and a node material's) through its
+ # three:uniforms rows (three-shader's patch, by texture name). A three shader drawn into a target writes its colour as
+ # it is (output "target": three tone-maps and encodes only what it draws to the screen). A still with a camera into a
+ # render image steps every frame before it (runtime-scene carries_state), so a start drawn at frame 0 is there at 12.
+ # Two fixes on the way: the engine's load empties its render images before its rows spawn (runtime/plugins emptied
+ # them after, so a three:uniforms row made a second, blank image under the same name and every ShaderMaterial read a
+ # target as black), and a flipY=false DataTexture keeps its rows in order (texture.ts bytesOf turned it upside down,
+ # on maps and in shaders). R3F23d: in-fbo 0.9941 and in-pingpong 0.9949 against three.js at frame 12, both in
+ # tools/parity.sh; the full list of 38 passes. Left: in-reflector, whose material's projective read is an
+ # onBeforeCompile patch (R3F24).
Scenario: R3F24. onBeforeCompile patches
Given a material patched by onBeforeCompile (drei's MeshWobbleMaterial and MeshDistortMaterial, a patched
diff --git a/sdk/r3f/test/parity/targets.tsx b/sdk/r3f/test/parity/targets.tsx
index ca4c0ec1..da932903 100644
--- a/sdk/r3f/test/parity/targets.tsx
+++ b/sdk/r3f/test/parity/targets.tsx
@@ -85,9 +85,12 @@ function PingPong() {
show.uniforms.heightmap.value = sim.gpu.getCurrentRenderTarget(sim.height).texture;
});
return (
- <mesh material={show} rotation={[-0.5, 0, 0]}>
- <planeGeometry args={[3, 3]} />
- </mesh>
+ <>
+ <color attach="background" args={["#000000"]} />
+ <mesh material={show} rotation={[-0.5, 0, 0]}>
+ <planeGeometry args={[3, 3]} />
+ </mesh>
+ </>
);
}
diff --git a/sdk/r3f/tools/parity.sh b/sdk/r3f/tools/parity.sh
index a6b165ce..9ccea4a1 100755
--- a/sdk/r3f/tools/parity.sh
+++ b/sdk/r3f/tools/parity.sh
@@ -21,6 +21,8 @@ CASES+=(in-vanilla:24)
CASES+=(in-post2:6 in-post3:6)
# three/webgpu's PostProcessing: its scene pass and TSL nodes as raea's effects (test/parity/tslpost.tsx, R3F25)
CASES+=(in-tslpost:6 in-tslpost2:6)
+# render targets an app draws itself, on raea's GPU: a useFBO, and GPUComputationRenderer's ping-pong (test/parity/targets.tsx, R3F23)
+CASES+=(in-fbo:12 in-pingpong:12)
[ -z "${R3F_CASES:-}" ] || read -ra CASES <<<"$R3F_CASES"
mkdir -p "$OUT"
for c in "${CASES[@]}"; do