Add volume animation update to ViewportHost
This commit is contained in:
@@ -2339,6 +2339,7 @@ export class ViewportHost {
|
||||
renderObjects.edges.material.dispose();
|
||||
}
|
||||
this.brushRenderObjects.clear();
|
||||
this.volumeAnimatedUniforms.length = 0;
|
||||
}
|
||||
clearEntityMarkers() {
|
||||
for (const renderObjects of this.entityRenderObjects.values()) {
|
||||
@@ -3055,6 +3056,13 @@ export class ViewportHost {
|
||||
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();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user