Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

#28 (5): ShaderMesh's doc says its uniforms may change from frame to frame and the shader isn't compiled again; it said they were set at load, which agents reading the SDK for types took literally (#26's scene sets one each frame and renders it)

shinyobjectz1dca9ace77c4
diff --git a/sdk/render/src/3d/bevy.tsx b/sdk/render/src/3d/bevy.tsx
index 4783c9b3..68f34e4e 100644
--- a/sdk/render/src/3d/bevy.tsx
+++ b/sdk/render/src/3d/bevy.tsx
@@ -120,7 +120,8 @@ export interface ShaderMeshProps {
/** A mesh drawn by a material written here in WESL or WGSL (docs/bevy-ts.feature G20): one generic Bevy material
* (rdb's ShaderMaterial, an AsBindGroup of 16 uniform slots and 4 textures) whose fragment shader is this source, so
- * a dissolve, a toon ramp, a hologram or a procedural pattern needs no Rust. Uniforms are set at load.
+ * a dissolve, a toon ramp, a hologram or a procedural pattern needs no Rust. Uniforms may change from frame to frame
+ * (they're set again on any frame where they change); the shader isn't compiled again (#28).
* @bevy bevy_pbr::mesh_material::MeshMaterial3d<raea_sys_material::shader_material::ShaderMaterial> */
export function ShaderMesh({ shape, wesl, wgsl, uniforms = {}, textures = {}, defs, alpha, doubleSided, ...place }: ShaderMeshProps) {
if ((wesl === undefined) === (wgsl === undefined)) throw new TypeError("ShaderMesh: give its source as wesl (or wgsl), one of them");