diff --git a/src/runtime-three/runtime-host.ts b/src/runtime-three/runtime-host.ts index f64093dc..88d227a3 100644 --- a/src/runtime-three/runtime-host.ts +++ b/src/runtime-three/runtime-host.ts @@ -682,6 +682,7 @@ export class RuntimeHost { } this.brushMeshes.clear(); + this.volumeAnimatedMaterials.length = 0; } private clearModelInstances() { @@ -729,6 +730,11 @@ export class RuntimeHost { this.activeController?.update(dt); this.audioSystem.updateListenerTransform(); + this.volumeTime += dt; + for (const mat of this.volumeAnimatedMaterials) { + (mat.uniforms["time"] as { value: number }).value = this.volumeTime; + } + for (const mixer of this.animationMixers.values()) { mixer.update(dt); }