Skip to content

Every 2D primitive in Mesh2d; Bevy parity for 2d/2d_shapes - #62

Merged
shinyobjectz merged 1 commit into
mainfrom
mesh2d-primitives
Nov 9, 2026
Merged

shinyobjectz merged 1 commit into
mainfrom
mesh2d-primitives

Conversation

@shinyobjectz

Copy link
Copy Markdown
Owner

Every Bevy 2D primitive (sectors, segments, annuli, capsules, rhombi, triangles, polylines, convex polygons) and rings in Mesh2d; 2D drawn with Bevy's MSAA and exact sRGB colours; Bevy parity for 2d/2d_shapes (0.999866). The full parity run passes 152 of 152 ported examples. skills/ pins raea-skills 004b866 (#8).

…exact colours; Bevy parity for 2d/2d_shapes

Mesh2d takes all of bevy_math's 2D primitives (CircularSector, CircularSegment, Annulus, Capsule2d, Rhombus,
Triangle2d, Segment2d, Polyline2d, ConvexPolygon beside Circle, Rectangle, Ellipse and RegularPolygon), each with its
reflected fields, and any of them as Bevy's Ring: `ring={thickness}` (to_ring) or `inner={...}`. A Shape2D row
carries the spec as `primitive` and raea-sys-mesh's primitive_mesh builds it, as Bevy's mesher does.

Two fidelity gaps 2d_shapes exposed, fixed for every 2D part:
- A Mesh2d's ColorMaterial colour reached the GPU rounded to a hex. It now goes as the Srgba's floats (`srgb`).
- 2D drew single-sampled, where Bevy's Camera2d defaults to 4x MSAA, so edges between pixels snapped. An edit with
  2D mesh rows now gets MSAA (raea_sys_sprite::has_2d, beside has_3d at the two MSAA call sites only, not the
  encoder's), and the 2D camera keeps to the 3D camera's MSAA every frame, sharing its main texture. The frame tag's
  Camera2d on the same target keeps to it too: Bevy makes one 2D depth texture per target, so differing sample
  counts were a validation error.

A relative import of a file under raea's sdk/ that isn't an SDK package's source (a bench's shared helper) is now
copied into the bundle like any outside import; before, everything under sdk/ was assumed to come by name.

New bench helper sdk/raea/bench/bevy-parity/helpers/theme.ts: examples/helpers' basic_example_theme, option checkbox
and bottom-left column, used by 14 Bevy examples.

2d_shapes passes at 0.99987: the shapes area matches with 0 pixels off by more than 2%; the rest is the checkbox
captions' glyph edges (the known text item). Every port was rerun after the MSAA change: 152 of 152 pass.

skills/ pins raea-skills 004b866 (#8), whose generated sdk.md lists the new primitives.
@shinyobjectz
shinyobjectz merged commit 2c5b71f into main Nov 9, 2026
4 checks passed
@shinyobjectz
shinyobjectz deleted the mesh2d-primitives branch November 9, 2026 01:57
shinyobjectz added a commit that referenced this pull request Nov 14, 2026
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