From 970cac46c29a1e7fd4f2ef1933b457f06080e971 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 17 Aug 2026 16:58:39 +0700 Subject: [PATCH] material animation stops touching assets: one shared table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - a drawn animated material — scrolling texture, pulsing tint — is never mutated again: the animation rides delta rows in a shared region of the light buffer, folded branch-free in the shader, with zero as identity - the churn that came with mutating assets dies by construction — no per-material modified ratchet, no far-twin re-inserts — and capture parity is bit-exact - the portal flood's answer goes compare-then-write, clearing the ground for a static-visibility lane - the single-threaded PostUpdate probe answered: cheaper on mean cpu, parked on a tail-latency class, kept as a documented lever Co-Authored-By: Claude Fable 5 --- .../benilla-app/src/entities/spell_fx/mod.rs | 4 + crates/benilla-app/src/entities/wmo_props.rs | 2 + crates/benilla-app/src/lib.rs | 9 + crates/benilla-app/tests/world_api_wall.rs | 10 +- crates/benilla-assets/src/materials.rs | 9 + .../benilla-assets/src/shaders/wow_model.wgsl | 15 +- crates/benilla-assets/src/world_assets/mod.rs | 1 + .../benilla-world/src/doodad_anim/mat_anim.rs | 261 +++++++++++++++--- crates/benilla-world/src/doodad_anim/mod.rs | 3 +- crates/benilla-world/src/lib.rs | 1 + crates/benilla-world/src/mat_anim_table.rs | 201 ++++++++++++++ crates/benilla-world/src/model_render.rs | 13 +- crates/benilla-world/src/rig_palette.rs | 21 +- .../src/terrain_stream/spawn/assemble.rs | 14 +- .../src/terrain_stream/spawn/mod.rs | 4 + crates/benilla-world/src/wmo_portal/mod.rs | 20 +- crates/benilla-world/src/world_plugins.rs | 4 + 17 files changed, 520 insertions(+), 72 deletions(-) create mode 100644 crates/benilla-world/src/mat_anim_table.rs diff --git a/crates/benilla-app/src/entities/spell_fx/mod.rs b/crates/benilla-app/src/entities/spell_fx/mod.rs index 9c799df2..7bfe0783 100644 --- a/crates/benilla-app/src/entities/spell_fx/mod.rs +++ b/crates/benilla-app/src/entities/spell_fx/mod.rs @@ -138,6 +138,10 @@ fn fx_part_material( }; let t0 = anim.sample(0.0); mat.extension.tint = Vec4::new(t0[0], t0[1], t0[2], 1.0); + // The clone must leave the shared mat-anim table (decision 1381): its tint is ticked per + // INSTANCE right here (the whole point of the clone), and a carried world slot would add the + // shared delta on top — a double animation the old asset-mutating lane could never produce. + mat.extension.anim_slots = Vec4::ZERO; let handle = wow_materials.add(mat); tint_reg.0.insert(handle.id(), (anim.clone(), now)); handle diff --git a/crates/benilla-app/src/entities/wmo_props.rs b/crates/benilla-app/src/entities/wmo_props.rs index 8d89fbbb..702f42aa 100644 --- a/crates/benilla-app/src/entities/wmo_props.rs +++ b/crates/benilla-app/src/entities/wmo_props.rs @@ -188,6 +188,7 @@ pub(super) fn spawn_wmo_gameobject_props( mut mats: benilla_world::model_render::M2BatchMaterials, mut uv_reg: ResMut, mut tint_reg: ResMut, + mut anim_table: ResMut, mut probes: ResMut, time: Res