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.
TypeScript 3dagent-skillsai-agentsai-videobevyclaude-codegame-enginegpulinuxmacosmotion-designmotion-graphicsreactrusttypescriptvideo-editingvideo-renderingwgpuwindows
R3F23: no new near copies. sync_render_maps checks the shown map with a match before it asks for the material mutably, and parts.rs reads each frame's map by a match on its value
shinyobjectz4edb80b80dcf
diff --git a/runtime/scene/src/parts.rs b/runtime/scene/src/parts.rsindex 60d20324..d9eb1ec9 100644--- a/runtime/scene/src/parts.rs+++ b/runtime/scene/src/parts.rs@@ -171,7 +171,7 @@ pub(crate) fn meshes_rows(tr: &Tracks, names: &[String], p: &mut Program) {for (prop, col) in [("map", "map"), ("normalMap", "normal_map"), ("roughnessMap", "rough_map"), ("metalnessMap", "metal_map"), ("metallicRoughnessMap", "mr_map"), ("aoMap", "ao_map"), ("emissiveMap", "emissive_map"), ("depthMap", "depth_map"), ("clearcoatNormalMap", "clearcoat_normal_map")] {let Some(src) = m0.get(prop).and_then(Value::as_str) else { continue };// render images an app ping-pongs between are keyed frame by frame (R3F23c: raea-sys-rendermap); a picture is its first frame's- let srcs: Vec<String> = if src.starts_with("render:") { mats.iter().map(|m| m.get(prop).and_then(Value::as_str).unwrap_or(src).to_string()).collect() } else { vec![src_path(src)] };+ let srcs: Vec<String> = if src.starts_with("render:") { mats.iter().map(|m| match m.get(prop) { Some(Value::String(s)) => s.clone(), _ => src.to_string() }).collect() } else { vec![src_path(src)] };keyed_strings(p, &mut row, &id, col, &srcs);}if let Some(Value::Array(r)) = m0.get("repeat") {diff --git a/systems/rendermap/src/lib.rs b/systems/rendermap/src/lib.rsindex b06f3f22..39633b2a 100644--- a/systems/rendermap/src/lib.rs+++ b/systems/rendermap/src/lib.rs@@ -15,10 +15,15 @@ pub fn sync_render_maps(frame: Res<FrameRows>, renders: Option<Res<RenderImages>let Some(src) = raea_sys_frame::keyed(|c| v.get(c).cloned(), "map") else { continue };let Some(img) = RenderImages::name(&src).and_then(|n| renders.0.get(n)).map(|i| i.0.clone()) else { continue };// looked at first: get_mut marks the material changed whether or not it is- if mats.get(&m.0).is_some_and(|s| s.base_color_texture.as_ref() != Some(&img)) {- if let Some(mut s) = mats.get_mut(&m.0) {- s.base_color_texture = Some(img);- }+ let shown = match mats.get(&m.0) {+ Some(s) => s.base_color_texture.as_ref() == Some(&img),+ None => true,+ };+ if shown {+ continue;+ }+ if let Some(mut s) = mats.get_mut(&m.0) {+ s.base_color_texture = Some(img);}}}