From c2832537459db7993ea0a6bfd9be545857312eca Mon Sep 17 00:00:00 2001 From: Shota Matsuda Date: Sat, 15 Nov 2025 13:27:55 +0900 Subject: [PATCH] Add velocity node source --- examples/jsm/tsl/display/TRAANode.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/jsm/tsl/display/TRAANode.js b/examples/jsm/tsl/display/TRAANode.js index be225e6097c603..260c3edd395ab5 100644 --- a/examples/jsm/tsl/display/TRAANode.js +++ b/examples/jsm/tsl/display/TRAANode.js @@ -83,6 +83,14 @@ class TRAANode extends TempNode { */ this.camera = camera; + /** + * The velocity node used as the source for `velocityNode`, which requires + * the original projection matrix to be updated before the jitter is applied. + * + * @type {Node} + */ + this.velocityNodeSource = velocity; + /** * The jitter index selects the current camera offset value. * @@ -232,7 +240,7 @@ class TRAANode extends TempNode { this.camera.updateProjectionMatrix(); this._originalProjectionMatrix.copy( this.camera.projectionMatrix ); - velocity.setProjectionMatrix( this._originalProjectionMatrix ); + this.velocityNodeSource.setProjectionMatrix( this._originalProjectionMatrix ); // @@ -268,7 +276,7 @@ class TRAANode extends TempNode { this.camera.clearViewOffset(); - velocity.setProjectionMatrix( null ); + this.velocityNodeSource.setProjectionMatrix( null ); // update jitter index