14 Commits
Author SHA1 Message Date
shinyobjectz 53b5da60b3 R3F23c: the engine's load empties its render images before its rows spawn, not after (runtime/plugins apply_rows reset them once the rows were in, so a three:uniforms row naming a render image made a second, blank image under the same name and every ShaderMaterial reading a target read black) 2026-11-15 13:36:44 -08:00
shinyobjectz 744c5a2a1f R3F23: a camera drawing into an image, in the engine (R3F23a). A PerspectiveCamera row whose target is "render:NAME:WxH" (":float" for an Rgba16Float image) is a rendercam: raea-runtime-look's rendercam.rs gives it a row of its own (into, on keyed by step, no tone curve, the ambient light of its own layers), the engine spawns it on that image (RenderTarget::Image, no multisampling or dither, Hdr for a float image) before the screen's camera, and a material's map naming the image reads what it drew. raea-sys-frame's render_image.rs parses and makes the image once for every source naming it; a three shader follows only the screen camera's tone mapping; the TSX PerspectiveCamera takes target and layers, and a camera with a target isn't the one the pointer picks through 2026-11-15 13:03:41 -08:00
shinyobjectz 09a935abd0 Layer keys (docs/review.feature R2a, work in progress, parked with the source stamps): a .map()'s key in the stamps (data-raea-idx, and loc#key in a use chain); raea's 3D parts (Mesh3d, Model, Entity…) stamped and given a LayerKey component (raea_sys_frame::layer) from it in runtime/scene; the work folder's SDK imports (../motion/x) read as raea's, not the edit's own; only components that read their children's types keep them unwrapped; RAEA_HIDE_LAYERS hides a layer by key (page CSS from its stamps, a 3D part's Visibility) for the layer pass's oracle. Not for landing before the layer pass. 2026-11-09 12:45:05 -08:00
shinyobjectz 4b8157f98c A still of a 3D composition no plugin carries state for draws only its own frame, not every frame before it (#77). Every engine installs the plugin clock (some plugin is always registered), so catch_up rendered each frame before a still in full: render graph, shadow views and submit, about 90 ms a frame in a film, and --at 2448 took 226 s. The engine now steps through those frames only when the rows hold something a plugin carries from frame to frame (raea_runtime_plugins::steps): a component or resource of a type from outside Bevy's own scene and render crates and raea's (a rigid body, a particle effect, Bevy's animation, time or states; a short type name, which could be anyone's), a driven mesh, or a row kind not known to be frame-pure. Keyed component rows land on their frame however it is reached. The film's --at 2448: 226 s -> 20 s, pixel-identical; a physics still at frame 100 (avian) still steps all 100 frames. bench/at-cost checks that a frame-pure still steps none. 2026-11-09 11:18:41 -08:00
shinyobjectz 426567fb63 A camera's depth as a texture: <DepthCopy>, depth images and depth textures in <Material>; Bevy parity for shader_advanced/render_depth_to_texture
Three pieces, as Bevy's render_depth_to_texture uses them:
- "render:NAME:WxH:depth" names a depth image (Depth32Float, its sampler comparing Always), shared by every field
  that names it, as "render:NAME" images are (raea-runtime-plugins fields.rs; raea-sys-shader own::depth_image).
- <DepthCopy image> in a Camera3d (raea-sys-phase DepthCopy) copies the camera's depth buffer into that image after
  its prepass and before its main pass. A depth-only camera is Bevy's own components: RenderTarget::None { size },
  DepthPrepass and Msaa off, with an order before the main camera's.
- A <Material> may bind a texture_depth_2d and a sampler_comparison (rebind slots 25 and 26, raea-sys-shader-wgsl
  ui_bind DEPTH), its texture given by name as any other. Bevy has no depth fallback image, so a Material that binds
  none gets a shared 1 x 1 depth image there.

Parity: the scene is pixel-exact at frames 5, 10, 30 and 60 (SSIM 0.999617). The only difference left is the
instruction text's glyph edges (tile 6), the same text-over-3D blend fullscreen_material records. Mutants: without
the DepthCopy it fails (0.957, tile 35); the cube one update behind passes the bar (0.995), but the real port differs
from Bevy only in the text. Every port with a Material or StandardMaterial under shader/, shader_advanced/ and 2d/
still passes (29 ports). 149 ported, 149 passing.
2026-11-08 16:34:29 -08:00
shinyobjectz 20ff5785b6 Plugins in a sequential render: a component held for its frame lands in a fed render too; an import written in a string stays text
A render to MP4 is a fed render (each frame's rows handed to a live engine), and keyed_rows stood aside for any
live engine, so a <BevyComponent from={N}> (an avian RigidBody, a hanabi Particles) waited in Keyed for good: a
row held for its frame never changes after the load, so the frames' rows never carry it either. keyed_rows now
applies them in a live engine as well, each once on its frame. A render to a PNG folder, or of one --frame, was
right already; the cube that turns dynamic at frame 10 now falls in the MP4 too.

The bundle's import rewrite (runtime/bundle rewrite.rs) matched `import ... from "..."` anywhere in the text,
so a template string a code chip types (`import { RigidBody } from "raea/plugins/avian"`) came out as
"../plugins/avian.gen". A lexer's pass now marks strings, template text, comments and regular expressions,
and a match inside one is left as written.
2026-11-08 15:07:06 -08:00
shinyobjectz 47545d9212 FC2d: a compute as written; shader/compute_shader_game_of_life passes pixel-exact
A <Compute file> compiles its shader file as written, binding its own @group(0) storage textures and uniforms
(systems/compute/src/written.rs). Each frame picks the entry point and which image each storage texture binds, as
a Bevy example's render-graph node picks its pipeline and bind group. Its images are render:NAME images in the
storage format the file declares, each with a sampler if one is given.

Strings can now change from frame to frame. A row column holds a number per frame, so a changing string is kept
as the list of values it takes plus a keyed index into it (raea-runtime-look's keyed_strings, read back with
raea-sys-frame's keyed). The changing-picture code for ImagePlane already worked this way and now uses the helper.
A Compute's entry and bind use it, and so does a Sprite's src: a Sprite can show a render:NAME image and switch
to another by name each frame.

The render-image registry (RenderImages) moves into raea-sys-frame, so the sprite system can look images up by
name. raea-runtime-plugins re-exports it.

A still renders only the frames it needs and their neighbours. When a scene has a compute that carries state
between frames (a file's images, or its own buffers), every frame up to the wanted one is now rendered, because
the GPU state can't be rebuilt from one frame.

Load checks every entry name and binding the run uses. A frame whose entry leaves a storage texture unbound is
logged and skips its dispatch.

shader/compute_shader_game_of_life passes at frames 10, 11, 30 and 60 with SSIM 1.0 and 0 pixels off. Frame 11
was added so each of the two images' samplers is drawn. Mutants are caught either by the bar or by the 2% pixel
probe: init a frame late, swapped bindings, alive colour, sprite parity, either image's sampler, clear colour,
scale, and one extra row of workgroups. The extra-row mutant passes SSIM at 0.9994; the probe finds 784 pixels off,
against 0 for the real port.
2026-11-08 09:19:32 -08:00
shinyobjectz 4f7944c463 FC2a: a Material's storage buffers and its values frame by frame; parts with one spec share one Material (128/128)
A <Material>'s `buffers` are its read-only storage buffers (var<storage, read> NAME: array<T(, N)>, up to two, at
OwnMaterial's 23 and 24), each laid out as WGSL stores its element type (own_live.rs storage; a vec3 takes 16 bytes).
Its uniforms and buffers may change from frame to frame: raea-runtime-look own_uniforms sends them as keyed
`own:uniforms` component rows from each frame they change, and own_live.rs patch packs them into the part's
Material and ShaderBuffers (a row that arrives before shade_rows puts the Material on waits on the part, Pending).
Parts whose spec is the same share one Material, as Bevy's examples share a handle: a varying spec carries its
track's hash, so parts share only when every frame's values match too (own.rs shared, OwnMade, cleared per load).
layout.rs's word encoding is shared by uniforms and buffers.

Port: shader/storage_buffer (SSIM 0.999999 at 30 and 60): 91 cubes with MeshTags (<BevyComponent
bevy_mesh::components::MeshTag>), the example's vertex and fragment shaders from its one file, its colour buffer
recomputed each frame as its update system does. Freezing the colours at frame 0 fails (97310 px off), as does
tagging every cube 0 (76718). The other shader ports rerun and pass.
2026-11-08 05:55:22 -08:00
shinyobjectz c0fd55f43d A material: row sets only the fields it gives on the part's own StandardMaterial, the rest as they were (part of #38). patch_material deserialized the given fields as a whole StandardMaterial, every field it wasn't given at its default, and applied all of them. So material-field's patch of emissive_exposure_weight also blacked out the cube's emissive and turned its black base white. On frame 0 the scene sync put the row's colours back. From frame 1 on, a render leaves an unchanged mesh alone (StillSynced), so the program route drew the cube grey (red 49) at a weight of 0.14, in stills too. Live play re-synced every frame, which hid it, and so the two routes differed on 29 of 30 frames. Each given field is now deserialized by its own type and applied to that field alone. An unknown field is refused by name.
material-field-0, red at the cube's centre on frames 0, 1, 5, 10, 20, 29: the program route was 216, 49, 49, 49, 49, 49 and now draws 215, 206, 165, 101, 14, 14, the same as live play. That's the ramp Bevy's emissive * mix(1, exposure, weight) gives the rows' eased track. At frame 20 the cube is the black base's specular (14, 9, 10), not grey. The grey (50, 48, 49) that control.feature FC1c recorded was this bug, and the case comments now say dark. The probes (r>150 at 0, r<80 at 20 and live) pass as before. A unit test (a_material_row_sets_only_its_fields) checks that a patch keeps the emissive and base colour; it fails on the old patch with emissive black and base white. bevy-ts check.sh: 92 pass, 1 open (shader-character: its body.glb has no joint it names, open before this too).

fps, material-field-0 back to back, three runs each: 21.9, 16.9, 23.0 ms a frame before, 22.2, 21.7, 17.4 after.
2026-11-07 23:06:11 -08:00
shane 3381690416 raea is developed here now (public-first)
This repository was an export of a private one; from this commit on it is where raea is developed. Contributions:
CONTRIBUTING.md.
2026-11-07 13:36:50 -08:00
shane d3c399b4d5 raea origin/main 2026-11-07 01:29:24 -08:00
shinyobjectz 88ccb8284d raea 2e9eda9fa 2026-11-06 18:08:53 -08:00
shinyobjectz 5e1c192d29 raea 9565b5f97 2026-11-06 16:27:57 -08:00
shinyobjectz f675b0ad2b raea dc579e418 2026-10-31 13:15:29 -07:00