mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 12:44:11 -10:00
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.