Commit Graph
27 Commits
Author SHA1 Message Date
shinyobjectz abead7eae4 SG1: a ShaderExtension's uniforms follow the frame
A mesh's shader spec was read once, from its first frame, so a ShaderExtension uniform driven by the frame drew
frame 0's value all video long: a card tinted by frame / 89 stayed blue to frame 89, and SG9's frame purity failed
it (30136 pixels differ from the frame rendered alone). Its uniforms now go as own:uniforms rows, as a <Material>'s
do (own_uniforms' ext, for a 3D mesh's material), and own_live.rs packs them into the shaded material's slots when
they change (ShaderExt slots_for, from the names and the struct fields it was built with). The card goes blue,
purple, red, and SG9 passes.
2026-11-21 23:32:43 -08:00
shinyobjectz c77c4858c0 LT21: detail cross-fades on every surface and from where the GPU measures. raea's generated fragments for ShaderExt (surfaceShader: surface and lit hooks) and ShaderMaterial (shade) never called Bevy's visibility-range dither, so a part drawn with them (the city's facades, glass and ground) drew both levels fully inside a fade band and cut one at the band's edge, a pop: on the 540p fly over 1917 Berlin, detail made one-frame spikes of 45, 20, 19 and 17 tiles at frames 41, 117, 122 and 157 where the JS levels made theirs at 58, 106, 112 and 148. Both fragments now call visibility_range_dither under @if(VISIBILITY_RANGE_DITHER), as Bevy's own pbr fragment does (a source with its own @fragment calls it itself). And Bevy's GPU dither measures from a mesh's origin (mesh_world_from_local[3]) while its CPU check measured from the box's centre under use_aabb, which raea-sys-lod set for meshes baked in world coordinates (a city tile's origin is the world's, its geometry hundreds of metres off), so the two disagreed. Now every range is measured from the origin (use_aabb off) and moved by how much farther the origin is than what the part is measured to: its nearest edge (edge), the mesh's own middle when its origin lies outside its bounds, else nothing; the move can be negative, and a range never goes below 0. A moved range is rewritten once the eye has gone a third of its way to the nearest fading band, which bounds a stale move's error (the distance moves as far as the eye, a move twice as far). RAEA_LOD_DEBUG=time now times apply inside it: between two systems ordered around it others ran, so it read 1 ms with no Details at all. 2026-11-17 19:52:34 -08:00
shinyobjectz db9dcda0a8 R3F22: the lane's copies folded (tools/dupes.sh). raea-sys-shader's uniform_bytes packs a written compute's, a written frame pass's and three's kernels' uniforms in their declared WGSL layout, where compute slab.rs, framepass written.rs and compute three.rs each had their own; three-shader storage.rs reads a per-vertex and a per-copy attribute's item through one padded; shared.rs's size error reads the spec's size by index 2026-11-15 13:01:38 -08:00
shinyobjectz fef9a1bd38 R3F22: three's compute and storage buffers run in the engine. raea-sys-shader shared.rs keeps a storage buffer by key (Bevy's ShaderBuffer, made once with its size and first contents, kept on the GPU, reset by a fresh three session; the empty one for an unused slot), the facility the computes that write it and the node materials that read it share. raea-sys-compute three.rs reads a <Compute kernels shared runs>: each kernel three's own WGSL with its storage bindings by key and its uniforms packed by three's struct, and the frame's runs queued once each by (epoch, seq) and dispatched in order before the other computes, a run whose pipeline or buffer isn't ready held. raea-sys-three-shader storage.rs binds two read-only shared buffers to a node material (bindings 11 and 12), and repeats a BufferMesh with copies count times with each copy's number, matrix and attributes (not frustum-culled). Two fixes the parity render found: runtime-scene keys a compute row's kernels, shared and runs frame by frame (a run after frame 0 never reached the engine), and three-shader's unlit entry premultiplies an additive material's colour with no alpha (three_blend in tone.wesl), since Bevy blends AlphaMode::Add as premultiplied alpha. compute lib.rs's groups_of and column serve the written, inline and three computes alike. docs/r3f.feature: R3F22 done, in-tsl-particles SSIM 0.9510 2026-11-15 12:58:22 -08:00
shinyobjectz 19b72d3dee Ray tracing and shaders: a ShaderExtension that doesn't compile refuses the render, and <Pathtracer /> no longer panics on its first frame
- raea-sys-shader (failed.rs): a shader raea registers for a scene (a ShaderExtension's surface and lit hooks, an own
  material's, a UI material's) that doesn't compile left its pipeline out, the frame drew without it (black) and the
  render said APPLIED. The render world now finds those pipelines in Bevy's cache and refuses the render with the
  compiler's error, through raea-gpu-device's refuse, which the frame's read back checks. Repro: `patch` (a WGSL
  reserved word) as a variable in a surface() hook.
- engine/render/raytrace: SolariPlugins makes every StandardMaterial deferred, but Bevy's Pathtracer requires only Hdr,
  so a <Pathtracer /> camera had no deferred prepass and Bevy's prepass queue panicked unwrapping its deferred phase.
  A Pathtracer camera now gets DepthPrepass and DeferredPrepass.
2026-11-08 20:46:49 -08:00
shinyobjectz 894f9821b4 Texture binding arrays in an own Material; Bevy parity for shader_advanced/texture_binding_array, exact
A <Material>'s textures may give one list of 1 to 16 pictures, bound as the source's binding_array<texture_2d<f32>>
(ui_bind's ARRAY slot, binding 57). Bevy's AsBindGroup derive can't own an array of views, so a new
OwnArrayMaterial (systems/shader/src/own_array.rs) wraps the part's OwnMaterial and builds its bind group directly,
as Bevy's example does: the derived entries, then the array with the fallback image past the list. Its layout leaves
out the uniform buffers, because wgpu refuses a binding array beside one, so build refuses uniforms on such a source.
Its pipelines are OwnMaterial's (same key, specialize), and own_live patches it too. A source with no texture_2d of
its own samples with the first sampler, which becomes the list's first picture's. 2D and devices without texture
binding arrays are refused. The depth and picture helpers move to own_images.rs (own.rs stays under 500 lines).

The port is exact at frames 5 and 10. Two tiles swapped and linear filtering each still passed the 0.99 bar
(0.992, 0.990); a missing tile failed it.
2026-11-08 17:08:08 -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 0620a51e85 raea-sys-shader-wgsl: a WGSL source read as text, split from raea-sys-shader
raea-sys-shader was at 1989 of its 2000 lines, with a depth texture for <Material> (FC2d, Bevy's
render_depth_to_texture) still to add. Its source-text modules move to a crate of their own, unchanged:
layout.rs (an own uniform struct's fields and uniform layout), storage_layout.rs (a storage buffer's words) and
ui_bind.rs (bindings renumbered into raea's slots); raea-sys-shader imports them under the same names. Four
pub(crate) helpers are pub now. Tests: the same 12 pass (6 in each crate).
2026-11-08 16:21:10 -08:00
shinyobjectz c240b8e99d Mesh shaders: <MeshShaderPass> on a camera, and Bevy parity for shader_advanced/mesh_shader_intro, exact
A camera's MeshShaderPass (raea-sys-phase mesh_shader.rs) runs your task shader (when given) and mesh shader, which
make primitives on the GPU and hand them to your fragment shader, straight into the view's colour and depth (compared
GreaterEqual) after the main opaque pass, as Bevy's mesh_shader_intro does. Each stage is a shader file compiled as
written; bind group 0 is Globals and the view uniform; `groups` is draw_mesh_tasks' workgroup count. raea's shared
device already takes every adapter feature, so Apple silicon's mesh shaders are there; a GPU without them logs once
and draws nothing. In TSX it is <MeshShaderPass task mesh fragment groups> from raea/3d.

Found on the way and fixed: a shader file's `import super::NAME` was read a line at a time, so a statement over
lines (`import super::{\n bindings::{globals, TaskPayload},\n};`, as the example's three files write it) imported
nothing, and a nested list would have read its items as modules; it is now read to its `;` with each top-level
item's first name. And raea-sys-phase's own shaders (PhaseItem, MeshPass, ShaderInstances, GBufferPass) are now
registered in a folder of their own with their super:: imports, as a Material's are.

Parity: SSIM 1.000000 with a worst tile of 0 at frames 5, 10, 30, 60, 120, 240 and 300. Frames 240 and 300 (64 and
125 cubes) are there because the bar passed a port with no pass at all at frame 120 (0.997961, tile 23: the cubes
are small); with them that mutant fails (0.984513 and 0.967070), and one without its task shader fails at 0.0001.
The ports that read shader files (shader_material, extended_material, shader_material_2d, deferred_raymarch,
custom_render_phase, custom_phase_item, custom_shader_instancing, manual_material) still pass. 148 ported, 148 passing.
2026-11-08 16:14:57 -08:00
shinyobjectz ae61cbb3e6 A mesh carries its own vertex attributes, and a Material reads the ones it names (shader_advanced/custom_vertex_attribute)
Bevy's custom_vertex_attribute gives a cube a BlendColor attribute and lays out the material's vertex buffer as
[POSITION at 0, BLEND_COLOR at 1] in its specialize. raea now does both:

- sdk/render: MeshVertexAttribute.new(name, id, format) and Mesh's ATTRIBUTE_* constants; Mesh3d `attributes`
  ([[attribute, values]], a value a vertex); Material `vertex_attributes` ([[attribute, location]]).
- runtime/scene: the mesh row carries `attributes` from the first frame.
- raea-sys-mesh attribute.rs: with_attributes inserts them into the mesh (names interned once, as Bevy's are
  &'static str); engine/render's shared mesh keys on them, line-neutral.
- raea-sys-shader own.rs: the layout is part of the pipeline key, and swap sets the vertex buffer to
  layout.0.get_layout of the named attributes, as Bevy's specialize does.

Parity: frames 5 and 10 at ssim 1.000000, 0 pixels off. Mutants: a green BlendColor, BlendColor at location 0 and
four blue vertices fail the bar. Moving the cube 0.1 up and halving the uniform's red pass the bar but the probe
counts 6,067 and 36,685 pixels off (the known SSIM blind spot; the real port is 0).

skills/ pins raea-skills 5218644 (#7), whose generated sdk.md lists the new names.
2026-11-08 15:20:15 -05:00
shinyobjectz a3db7b6dba FC2d: a compute writes a mesh, your own phase item, a frame pass as written; three shader_advanced ports pass
Three of Bevy's shader_advanced examples now run as written, each through a general feature.

A compute writes a mesh (shader_advanced/compute_mesh). A <Compute file> binds each var<storage> its file declares:
either its own buffer, its first contents in the type's storage layout and kept from frame to frame, or a mesh's
vertex or index slab in Bevy's MeshAllocator, found by its part's name (systems/compute/src/slab.rs). A uniform
field given { start: NAME } or { end: NAME } is that mesh's range in the slab, counted in the array's elements, and
is packed each frame once the allocator has placed the mesh. The allocator's slabs carry STORAGE usage, set before
MeshAllocatorPlugin's finish makes the allocator, as the example's plugin sets it. A <BufferMesh> with indices and
normals is now Bevy's indexed Mesh, its index buffer kept, instead of flat triangles (systems/mesh/src/indexed.rs);
3d/vertex_colors, which takes that path, still passes. Every row with a name now gets a Bevy Name, not only bare
entities.

Your own phase item (shader_advanced/custom_phase_item). <PhaseItem> puts raea-sys-phase's PhaseItem and an Aabb on
an <Entity>. A new crate, systems/phase, queues it into each view's Opaque3d phase with a pipeline of its shader
file as written, drawing its own vertex buffer (its stride and attributes) and index buffer with its depth state,
as the example's queue_custom_phase_item does.

A frame pass as written (shader_advanced/custom_post_processing). A <FramePass file> binds its file's own @group(0)
declarations: each texture_2d<f32> is the frame (the one `frame` names) or an image, each sampler Bevy's default or
the one given, each var<uniform> its value (systems/framepass/src/written.rs). Its uniforms may change frame by
frame: like a compute's entry and bind, they are a keyed string column, and the pass repacks them when they change.
FramePass moves out of materials.tsx (at its 500-line limit) into 3d/framepass.tsx. The group(0) declaration parser
the compute and the pass share is raea-sys-shader's bindings::group0.

A camera on the Engine's target now draws a w x h Viewport of the w x (h + 1) tag-row target, as orthographic
cameras already did. A perspective camera had a sub view of the whole target, so a draw in clip space, such as the
phase item's triangle, mapped to 721 rows: its bottom edge landed 0.75 px low and the port passed at SSIM 0.9936 with
2355 pixels off. It is now pixel-exact. The whole suite was rerun with the change.

Results:
- compute_mesh passes at frames 5 and 10 (SSIM 0.999999, 2 pixels off at a 2% threshold). Eight mutants all fail the
  bar: no dispatch, either range set to 0, indices written into the vertex slab, the compute's mesh unnamed, the
  other cube's colour, no shadows, and the other cube moved.
- custom_phase_item passes at frames 5 and 10 with SSIM 1.0 and 0 pixels off. Mutants: the second attribute at
  offset 12, a vertex given another colour, and the top vertex at y 0.9 all fail the bar; a vertex moved from 0.866 to
  0.86 passes on SSIM (0.9953) but leaves 1556 pixels off, where the port leaves 0.
- custom_post_processing passes at frames 10, 30 and 60 (SSIM 0.99995, 0 pixels off). Mutants: no white clear colour
  fails the bar; intensity times 4/3 (8100 pixels off), a slower turn (4256), a linear sampler (16) and sin(t) for
  sin(sin(t)) (2964 at frame 60) pass on SSIM but leave pixels off. The pass before tone mapping draws the same
  frame, as it should: the camera is not HDR, so Bevy tone-maps in the material shader and its tonemapping node is
  skipped.
- After the change, the whole suite passes: 141 of 141 ported (two first-run misses rerun clean: standard_widgets
  missed its replayed menu click on the Bevy side, automatic_instancing missed its frame-time bar under another load).
2026-11-08 10:31:46 -08:00
shinyobjectz 498d7765cd FC2a: storage buffers in any WGSL type; shader/gpu_component_array_buffer passes pixel-exact
A <Material>'s storage buffer is no longer limited to an array of numbers or vectors. It can be any host-shareable
type its source declares: scalars and vectors, matCxR<f32>, fixed and runtime arrays, and the source's own structs,
including fields under @if. Each is written in WGSL's storage layout (systems/shader/src/storage_layout.rs), as
Bevy's examples write such buffers with encase. In TSX a buffer is a StorageValue: a number, a list (a vector's
components, an array's elements, a matrix's columns) or a struct's { field: value }. Struct fields may also share a
line (`struct S { a: f32, b: vec2<f32> }`); layout.rs splits them at the commas outside a type's <>.

The parity bench's ChaCha8Rng gains next_u64, random_bool and random_index, matching rand's draws for seed 12345
(lib/rand.test.ts). The parity host depends on bytemuck, which the example uses.

shader/gpu_component_array_buffer passes at frames 60, 180, 240 and 400 with SSIM 1.0 and 4 pixels off at a 2%
threshold. The port replays the example's add_cube and remove_cube on Bevy's clock. Two details matter. A part keeps
its row across frames by its name, not its React key, so each cube is named by its spawn number; otherwise a cube
that moves up the list takes the texture of the cube that was there first. And when both timers fire on one update,
the cube spawned then is not yet in the other cubes' archetype, so the despawn swaps in the previous last cube and
the new one joins after it.

Nine mutants all fail the bar: swapped textures, swapped colour channels, a constant MeshTag, a 310 ms spawn timer,
the new cube put first, another seed, cube scale, camera target and a mirrored z. All 19 shader ports still pass.
2026-11-08 09:39:48 -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 f5cb4f3ae2 FC2: automatic_instancing and pipeline_constants pass; gpu_readback excluded (136/136)
shader/automatic_instancing: 65 536 cubes, one mesh and one Material, each with a MeshTag (a BevyComponent) its
vertex shader reads a texel by, moved in z every frame. The update was 103 ms against Bevy's 9: every moving row's
values were made into a map each frame. The timeline now records which columns move per row (Timeline::moving), and
a row only its placement moves has, once its other values are applied, its transform read straight from the frame's
columns (FrameRows::moves_only, placer, transform_by): 7.4 ms against Bevy's 8.3. The parity probe formatted a string
for every visible mesh each probed frame, in the next frame's measured time, on both sides; it now formats a size once.
Mutants: the tag off by one (SSIM 0.977) and the phase (0.397) fail the bar.

shader/pipeline_constants: a Material's `constants` are its fragment's pipeline-overridable constants (WGSL override),
set in its pipeline as the example's specialize pushes LEVELS; kept by hash so its key stays Copy (SpriteMaterial's
combined key is a packed struct). Its quads are pixel-exact; LEVELS + 1 and no constants both fail the bar. A Text2d
inside a layered Canvas3D was silently not drawn (the bar passed it at SSIM 0.9946); it now throws, saying to put it
after the Canvas3D.

shader/gpu_readback is excluded: it spawns no camera and draws no frame; its behaviour is the GPU results it reads back
and logs, the world check's, not a picture.
2026-11-08 08:17:42 -08:00
shinyobjectz 0dd03f7c24 FC2b: an extension file's own bindings, any numbers (shader/extended_material_bindless, 134/134)
A MaterialExtension's fragment file is compiled as written but for its material-group bindings' numbers, which go to
ShaderExt's slots in the order declared: its uniform struct at 100 (its uniforms packed in its layout), up to four
texture_2d at 101-107 and their one sampler at 102 (ext_bind.rs, through ui_bind's rebind_with). A declaration under
@if(BINDLESS) is left as written and compiles out, so Bevy's extended_material_bindless binds its @else set (50, 51,
52), as it does without bindless; the @binding(100) struct is read from outside those spans.

The port is pixel-exact at frames 30 and 60. Mutants on a dark scene the bar's SSIM threshold can't see: the
modulate colour (30k px off at a 2% probe), the rotation by 0.1 rad (9k), the sphere's sectors (2k); the base
colour under the checker moves SSIM 1.0 to 0.9995.
2026-11-08 07:22:25 -08:00
shinyobjectz 2ff13ee50b FC2a: bindless Materials as Bevy draws them without bindless (shader/shader_material_bindless, shader_material_2d_bindless, 133/133)
A Material's declarations under @if(BINDLESS) are left as written: raea's Materials aren't bindless, so that set
compiles out and the @else set binds, as Bevy's does on a GPU without bindless (ui_bind.rs bindless_spans).

A Cylinder alone is drawn as Bevy's Cylinder mesh (32 sides, one segment), with its normals and texture coordinates,
as a lone sphere, cuboid and plane already are: a shader reading its uv now compiles (core/shape cylinder_of).

Mutants: the cylinder's colour, its logo and the cube's blue are each caught (the blue by a pixel probe, 236 against
214); the radius by the pixel count. In 2D a logo swap is caught; Mask against Opaque draws the same picture in Bevy
too (a custom Material2d doesn't discard, and the Mask pipeline doesn't blend).
2026-11-08 07:13:06 -08:00
shinyobjectz 5acc123835 FC2a: one reader for the component a part holds its own Material by (3D, 2D or a sprite's) 2026-11-08 06:38:33 -08:00
shinyobjectz 1b6fbfc390 FC2a: a Sprite's own Material (Bevy's SpriteMaterial), its values per frame in live play, and scripted keys in the parity host (shader/sprite_material, 130/130)
<Sprite><Material/></Sprite> is Bevy's SpriteMaterial<M>: raea's OwnMaterial is also a MaterialExtension2d, so it
extends the sprite's own SpriteMeshMaterial and its shader reads the sprite through sprite_mesh::functions. A
Material's fixed slots now start at 30, past the sprite's own bindings (a UiMaterial's still start at 0), and an
alpha mode the spec doesn't give leaves the sprite's own.

Live play now carries a Material's values frame by frame: a one-frame program sends its own:uniforms row, and a
component whose target keeps its render id (a sprite, a 2D shape) is no longer dropped.

The parity host's input script takes key names (KeyCode's: "Space"), held in ButtonInput<KeyCode> after Bevy's
input systems, so input_just_pressed sees a press on its update.

shader/sprite_material passes at 6 frames across two Space presses (SSIM 0.99983, the text's tile). Mutants of the
amount, the burn edge's width and the delta fail. A burn-edge colour mutant passes the bar, which can't see a thin
edge's colour, but the edge probe catches it: the same 1721 edge pixels, green total 1428 real against 1266 mutant,
and 1428 in Bevy's. The Material, sprite and 2D ports rerun pass.
2026-11-08 06:34:46 -08:00
shinyobjectz 21182ec6ba FC2a: one check for a name a Material's shader doesn't declare (uniform or storage buffer); materials.tsx back under 500 lines 2026-11-08 06:05:57 -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 fff38cbcd6 FC2a: a Material's textures of every dimension (1d, 2d_array, cube, cube_array, 3d), up to 6 samplers, and Bevy's fallback image for a texture it doesn't give (127/127)
rebind_in takes `dims`: a Material's (not a UiMaterial's) textures of the other dimensions go to their own slots
of OwnMaterial, one of each (16 1d, 18 2d_array, 20 cube, 21 cube_array, 22 3d), and its samplers, in the order
the source declares them, to 9, 11, 13, 15, 17 and 19 (Bevy's view binds up to 8 of the fragment stage's 16). A
texture the source declares and the spec doesn't give binds Bevy's fallback image of its dimension, as an
Option<Handle<Image>> left None does; a 2d_array takes the spec's texture array ({ layers }).

Port: shader/fallback_image (SSIM 1.000000). Its fragment writes nothing, so the frame alone can't show the
bindings: a raea-only variant that samples all six textures draws the cube (worst tile 158 against Bevy's empty
frame), so the six bind and sample. A unit test puts fallback_image_test.wesl's twelve bindings in their slots.
2026-11-08 05:43:27 -08:00
shinyobjectz ffc9962cd0 Fold three new copies in own.rs: one specialize for Material and Material2d (a macro), the shader handle inline, and no is_own 2026-11-08 05:35:58 -08:00
shinyobjectz 66195f7472 FC2a: your own Material in 2D (Bevy's Material2d), and a shared-texture 2D camera's output replaces as Bevy's first camera does (126/126)
A <Material> in a Mesh2d is Bevy's Material2d: raea-sys-shader's OwnMaterial implements both Material and Material2d
(group 3 in 3D, 2 in 2D), so the bindings, the imports beside the file and the packing are one code path;
alpha_mode maps to AlphaMode2d (Opaque, Mask, else Blend), and cull_mode now keeps the pipeline's own unless given
(Back in 3D, none in 2D, as Bevy's pipelines have them). Mesh2d carries it to Shape2D as `shader`, the shape row
keeps it as a JSON column, and raea-sys-sprite's spawn_shape puts MeshMaterial2d<OwnMaterial> on in place of the
ColorMaterial, its textures decoded at once (own::picture, which the UiMaterial now uses too).

raea's 2D camera draws over the 3D camera on its target. With the 3D camera single-sampled and not Hdr (a 2D-only
scene's), the two share one main texture, so the 2D camera's blit used to alpha-blend the finished frame over
itself (Bevy blends every camera after the first on a target). It now replaces, as a lone Camera2d's does: a 2D
fragment's alpha below 1 reaches the frame as Bevy leaves it. Found by shader/shader_material_2d, whose Mask(0.5)
material writes alpha 0.5 and never discards: Bevy's centre pixel (0, 0, 40), raea's was (29, 29, 43) and is now
(0, 0, 40). A mixed scene (a multisampled 3D camera) keeps the blend.

Port: shader/shader_material_2d, SSIM 1.000000 (the Blend mutant fails, 16384 px off). The full sweep passes
126 of 126.
2026-11-08 05:29:32 -08:00
shinyobjectz a28118696e FC2a: your own Material is Bevy's Material, not an extension: its own bindings, imports beside it, alpha mode, depth bias, cull mode; 3 shader ports (125/125)
raea/pbr's <Material> now draws as raea-sys-shader's OwnMaterial (own.rs), an `impl Material` whose bind group
takes any author's layout: the file's @group(MATERIAL_BIND_GROUP) bindings are renumbered into fixed slots in the
order the source declares them (8 uniforms of any type up to 256 bytes, packed in their declared types, a struct's
from { field: value }; 4 textures and their samplers), as the UiMaterial's are (ui_bind.rs rebind_in, generalized
to any group). `import super::NAME` reads NAME.wesl beside the file: the module is registered under an embedded
folder per source folder, which is the module path WESL resolves super:: to. alpha_mode and depth_bias are its
Material methods', cull_mode its specialize's (Back; null culls none), and `vertex` names a vertex shader for the
main pass. A shader's textures given as staticFile paths are now found as its fragment is.

Ports: shader/shader_material (SSIM 1.000000: its own bindings at 0-2, the relative import, AlphaMode::Blend; the
Opaque mutant fails at 36143 px off, and a cull_mode null mutant moves SSIM to 0.992), shader/shader_defs
(0.999999: its uniform a struct, IS_RED from defs), shader/shader_material_screenspace_texture (0.9989 at 10 and
60, max 12 grey off: view.viewport uv under the turning camera). animate_shader, extended_material and
ui/ui_material rerun and pass as before.
2026-11-08 05:29:32 -08:00
shinyobjectz c703bb308c FC0a: UiMaterial, as Bevy's ui/ui_material runs it (docs/control.feature FC2a). raea/ui's MaterialNode draws a node with a fragment shader of the author's, compiled as written: its @group(1) bindings are renumbered into raea's slots (up to 8 uniforms of any type to 256 bytes, 4 textures and their samplers; raea-sys-shader ui_bind.rs) and it reads UiVertexOutput as in Bevy. raea-sys-shader's ui.rs runs Bevy's own UiMaterialPlugin with one material type: each node is drawn by a Camera2d of its own into a texture of its border box (the node's border widths and corner radii as Bevy resolves them), which the page shows in the node's place, on the GPU or read back. ui/ui_material passes with no pixel off at frame 10; its probe caught every mutant (colour, border colour, slider, the border's width and radius, the texture). The rerun of every registered port changes nothing else (107 of 110 pass; the 3 that fail are the known frame-time and transparency_3d ones). 2026-11-07 23:29:58 -08:00
shane d3c399b4d5 raea origin/main 2026-11-07 01:29:24 -08:00
shinyobjectz f675b0ad2b raea dc579e418 2026-10-31 13:15:29 -07:00