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.

R3F25 follow-up: the passes a composer frame keeps are read from its post parts and its compute part as well as the scene's (computes counted before passes), so a pass only an effect or a compute reads isn't pruned

shinyobjectz14180f3dfe0e
diff --git a/sdk/r3f/src/input/scene.ts b/sdk/r3f/src/input/scene.ts
index c50773ed..7ea76d3b 100644
--- a/sdk/r3f/src/input/scene.ts
+++ b/sdk/r3f/src/input/scene.ts
@@ -444,11 +444,12 @@ export function convert(scene: THREE.Scene, camera: THREE.Camera, gl: THREE.WebG
const fog = fogOf(scene.fog as THREE.Fog | THREE.FogExp2 | null);
const post = composer.found ? postParts(composer.effects) : { parts: [] as Part[], tone: undefined };
const tone = composer.found ? post.tone ?? { type: "ToneMapping", props: { mode: "none" } } : toneOf(gl);
- // what the app drew into render targets itself this frame, drawn on the GPU before the screen (passes.ts, R3F23).
- // Under a composer raea draws as its own effects, only the passes whose pictures the frame shows: the composer's
- // own (the scene into its buffer, a bloom's mip chain) are raea's effects now, and would draw the scene again
- const passes = passesOf(gl, composer.found ? [...sky.parts, ...w.world, ...drawn] : undefined);
// what the app dispatched with gl.compute since the last frame, run before the cameras draw (tsl-compute.ts, R3F22)
const computes = dispatchesOf(gl)?.part(time);
+ // what the app drew into render targets itself this frame, drawn on the GPU before the screen (passes.ts, R3F23).
+ // Under a composer raea draws as its own effects, only the passes whose pictures the frame reads (an effect's or a
+ // compute's among them): the composer's own (the scene into its buffer, a bloom's mip chain) are raea's effects now,
+ // and would draw the scene again
+ const passes = passesOf(gl, composer.found ? [...sky.parts, ...post.parts, ...(computes ? [computes] : []), ...w.world, ...drawn] : undefined);
return { parts: [...(cam ? [cam] : []), tone, ...(fog ? [fog] : []), ...sky.parts, ...post.parts, ...(computes ? [computes] : []), ...w.world, ...passes, ...drawn], background: sky.background };
}