From 4d32769fdae3f8b3d249cc6828313128c7c192ee Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 6 Apr 2026 17:29:44 +0200 Subject: [PATCH] Add volume animation support in viewport-host.ts --- src/viewport-three/viewport-host.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/viewport-three/viewport-host.ts b/src/viewport-three/viewport-host.ts index 658ad54b..172b905a 100644 --- a/src/viewport-three/viewport-host.ts +++ b/src/viewport-three/viewport-host.ts @@ -3198,6 +3198,7 @@ export class ViewportHost { } this.brushRenderObjects.clear(); + this.volumeAnimatedUniforms.length = 0; } private clearEntityMarkers() { @@ -4150,6 +4151,14 @@ export class ViewportHost { private render = () => { this.animationFrame = window.requestAnimationFrame(this.render); this.updateTransformGizmoPose(); + const now = performance.now(); + const dt = this.previousFrameTime === 0 ? 0 : Math.min((now - this.previousFrameTime) / 1000, 1 / 20); + this.previousFrameTime = now; + this.volumeTime += dt; + + for (const uniform of this.volumeAnimatedUniforms) { + uniform.value = this.volumeTime; + } if (this.advancedRenderingComposer !== null) { this.advancedRenderingComposer.render();