Add volume animation support in viewport-host.ts

This commit is contained in:
2026-04-06 17:29:44 +02:00
parent aa9a532ae9
commit 4d32769fda

View File

@@ -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();