Skip to content

A mesh carries its own vertex attributes, and a Material reads the ones it names (shader_advanced/custom_vertex_attribute) - #59

Merged
shinyobjectz merged 1 commit into
mainfrom
vertex-attributes
Nov 8, 2026
Merged

shinyobjectz merged 1 commit into
mainfrom
vertex-attributes

Conversation

@shinyobjectz

Copy link
Copy Markdown
Owner

Ports Bevy's shader_advanced/custom_vertex_attribute: Mesh3d attributes (MeshVertexAttribute.new, Mesh's ATTRIBUTE_* constants) and Material vertex_attributes, which lays out the vertex buffer as Bevy's specialize does. Parity: frames 5 and 10 at ssim 1.000000, 0 pixels off; structural mutants fail the bar.

It also bumps skills/ to raea-skills 5218644 (#7), whose generated sdk.md lists the new names. It's a PR rather than agent land because GitButler can't commit a gitlink. L1 passed every step up to skills, and the skills gate passes on this tree.

…es 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.
@shinyobjectz
shinyobjectz merged commit ae61cbb into main Nov 8, 2026
4 checks passed
@shinyobjectz
shinyobjectz deleted the vertex-attributes branch November 8, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant