From 129c238a66d4756f11a9342540bea9448bc4fb56 Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Tue, 3 Feb 2026 14:06:12 -0500 Subject: [PATCH 1/3] TSL: Remove ScriptableNodeResources export (#32945) --- src/Three.TSL.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Three.TSL.js b/src/Three.TSL.js index df6da56d86c733..89be2f582d458f 100644 --- a/src/Three.TSL.js +++ b/src/Three.TSL.js @@ -29,7 +29,6 @@ export const HALF_PI = TSL.HALF_PI; export const PointShadowFilter = TSL.PointShadowFilter; export const Return = TSL.Return; export const Schlick_to_F0 = TSL.Schlick_to_F0; -export const ScriptableNodeResources = TSL.ScriptableNodeResources; export const ShaderNode = TSL.ShaderNode; export const Stack = TSL.Stack; export const Switch = TSL.Switch; From b1430df4bf24e8120adfd14d520c8d7228dac04d Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Tue, 3 Feb 2026 20:06:29 +0100 Subject: [PATCH 2/3] Anaglyph: Rename `screenDistance` to `planeDistance`. (#32943) --- examples/jsm/effects/AnaglyphEffect.js | 14 ++-- examples/jsm/tsl/display/AnaglyphPassNode.js | 80 ++++++++++---------- examples/webgl_effects_anaglyph.html | 4 +- examples/webgpu_display_stereo.html | 8 +- 4 files changed, 53 insertions(+), 53 deletions(-) diff --git a/examples/jsm/effects/AnaglyphEffect.js b/examples/jsm/effects/AnaglyphEffect.js index 740d4261fff2cf..3882e25519cc56 100644 --- a/examples/jsm/effects/AnaglyphEffect.js +++ b/examples/jsm/effects/AnaglyphEffect.js @@ -32,7 +32,7 @@ const _forward = /*@__PURE__*/ new Vector3(); * * This implementation uses CameraUtils.frameCorners() to align stereo * camera frustums to a virtual screen plane, providing accurate depth - * perception with zero parallax at the screen distance. + * perception with zero parallax at the plane distance. * * Note that this class can only be used with {@link WebGLRenderer}. * When using {@link WebGPURenderer}, use {@link AnaglyphPassNode}. @@ -74,8 +74,8 @@ class AnaglyphEffect { this.eyeSep = 0.064; /** - * The distance from the viewer to the virtual screen plane - * where zero parallax (screen depth) occurs. + * The distance in world units from the viewer to the virtual + * screen plane where zero parallax (screen depth) occurs. * Objects at this distance appear at the screen surface. * Objects closer appear in front of the screen (negative parallax). * Objects further appear behind the screen (positive parallax). @@ -86,7 +86,7 @@ class AnaglyphEffect { * @type {number} * @default 0.5 */ - this.screenDistance = 0.5; + this.planeDistance = 0.5; const _params = { minFilter: LinearFilter, magFilter: NearestFilter, format: RGBAFormat }; @@ -199,11 +199,11 @@ class AnaglyphEffect { _eyeL.copy( camera.position ).addScaledVector( _right, - halfSep ); _eyeR.copy( camera.position ).addScaledVector( _right, halfSep ); - // Calculate screen center (at screenDistance in front of the camera center) - _screenCenter.copy( camera.position ).addScaledVector( _forward, - this.screenDistance ); + // Calculate screen center (at planeDistance in front of the camera center) + _screenCenter.copy( camera.position ).addScaledVector( _forward, - this.planeDistance ); // Calculate screen dimensions from camera FOV and aspect ratio - const halfHeight = this.screenDistance * Math.tan( MathUtils.DEG2RAD * camera.fov / 2 ); + const halfHeight = this.planeDistance * Math.tan( MathUtils.DEG2RAD * camera.fov / 2 ); const halfWidth = halfHeight * camera.aspect; // Calculate screen corners diff --git a/examples/jsm/tsl/display/AnaglyphPassNode.js b/examples/jsm/tsl/display/AnaglyphPassNode.js index 41955ac58c5922..80c38be194b44d 100644 --- a/examples/jsm/tsl/display/AnaglyphPassNode.js +++ b/examples/jsm/tsl/display/AnaglyphPassNode.js @@ -81,7 +81,7 @@ function createMatrixPair( leftSpec, rightSpec ) { return [ r[ 0 ], g[ 0 ], b[ 0 ], // Column 0: coefficients for input R r[ 1 ], g[ 1 ], b[ 1 ], // Column 1: coefficients for input G - r[ 2 ], g[ 2 ], b[ 2 ] // Column 2: coefficients for input B + r[ 2 ], g[ 2 ], b[ 2 ] // Column 2: coefficients for input B ]; } @@ -117,16 +117,16 @@ const ANAGLYPH_MATRICES = { // Paper: Left=[R,0,0], Right=[0,0,Lum] [ AnaglyphAlgorithm.TRUE ]: { [ AnaglyphColorMode.RED_CYAN ]: createMatrixPair( - { r: [ 1, 0, 0 ] }, // Left: R -> outR - { g: LUM, b: LUM } // Right: Lum -> outG, Lum -> outB + { r: [ 1, 0, 0 ] }, // Left: R -> outR + { g: LUM, b: LUM } // Right: Lum -> outG, Lum -> outB ), [ AnaglyphColorMode.MAGENTA_CYAN ]: createMatrixPair( - { r: [ 1, 0, 0 ], b: [ 0, 0, 0.5 ] }, // Left: R -> outR, partial B -> outB - { g: LUM, b: [ 0, 0, 0.5 ] } // Right: Lum -> outG, partial B + { r: [ 1, 0, 0 ], b: [ 0, 0, 0.5 ] }, // Left: R -> outR, partial B -> outB + { g: LUM, b: [ 0, 0, 0.5 ] } // Right: Lum -> outG, partial B ), [ AnaglyphColorMode.MAGENTA_GREEN ]: createMatrixPair( - { r: [ 1, 0, 0 ], b: LUM }, // Left: R -> outR, Lum -> outB - { g: LUM } // Right: Lum -> outG + { r: [ 1, 0, 0 ], b: LUM }, // Left: R -> outR, Lum -> outB + { g: LUM } // Right: Lum -> outG ) }, @@ -134,16 +134,16 @@ const ANAGLYPH_MATRICES = { // Paper: Left=[Lum,0,0], Right=[0,0,Lum] [ AnaglyphAlgorithm.GREY ]: { [ AnaglyphColorMode.RED_CYAN ]: createMatrixPair( - { r: LUM }, // Left: Lum -> outR - { g: LUM, b: LUM } // Right: Lum -> outG, Lum -> outB + { r: LUM }, // Left: Lum -> outR + { g: LUM, b: LUM } // Right: Lum -> outG, Lum -> outB ), [ AnaglyphColorMode.MAGENTA_CYAN ]: createMatrixPair( - { r: LUM, b: [ 0.15, 0.29, 0.06 ] }, // Left: Lum -> outR, half-Lum -> outB - { g: LUM, b: [ 0.15, 0.29, 0.06 ] } // Right: Lum -> outG, half-Lum -> outB + { r: LUM, b: [ 0.15, 0.29, 0.06 ] }, // Left: Lum -> outR, half-Lum -> outB + { g: LUM, b: [ 0.15, 0.29, 0.06 ] } // Right: Lum -> outG, half-Lum -> outB ), [ AnaglyphColorMode.MAGENTA_GREEN ]: createMatrixPair( - { r: LUM, b: LUM }, // Left: Lum -> outR, Lum -> outB - { g: LUM } // Right: Lum -> outG + { r: LUM, b: LUM }, // Left: Lum -> outR, Lum -> outB + { g: LUM } // Right: Lum -> outG ) }, @@ -151,16 +151,16 @@ const ANAGLYPH_MATRICES = { // Paper: Left=[R,0,0], Right=[0,G,B] [ AnaglyphAlgorithm.COLOUR ]: { [ AnaglyphColorMode.RED_CYAN ]: createMatrixPair( - { r: [ 1, 0, 0 ] }, // Left: R -> outR - { g: [ 0, 1, 0 ], b: [ 0, 0, 1 ] } // Right: G -> outG, B -> outB + { r: [ 1, 0, 0 ] }, // Left: R -> outR + { g: [ 0, 1, 0 ], b: [ 0, 0, 1 ] } // Right: G -> outG, B -> outB ), [ AnaglyphColorMode.MAGENTA_CYAN ]: createMatrixPair( - { r: [ 1, 0, 0 ], b: [ 0, 0, 0.5 ] }, // Left: R -> outR, partial B -> outB - { g: [ 0, 1, 0 ], b: [ 0, 0, 0.5 ] } // Right: G -> outG, partial B -> outB + { r: [ 1, 0, 0 ], b: [ 0, 0, 0.5 ] }, // Left: R -> outR, partial B -> outB + { g: [ 0, 1, 0 ], b: [ 0, 0, 0.5 ] } // Right: G -> outG, partial B -> outB ), [ AnaglyphColorMode.MAGENTA_GREEN ]: createMatrixPair( - { r: [ 1, 0, 0 ], b: [ 0, 0, 1 ] }, // Left: R -> outR, B -> outB - { g: [ 0, 1, 0 ] } // Right: G -> outG + { r: [ 1, 0, 0 ], b: [ 0, 0, 1 ] }, // Left: R -> outR, B -> outB + { g: [ 0, 1, 0 ] } // Right: G -> outG ) }, @@ -168,16 +168,16 @@ const ANAGLYPH_MATRICES = { // Paper: Left=[Lum,0,0], Right=[0,G,B] [ AnaglyphAlgorithm.HALF_COLOUR ]: { [ AnaglyphColorMode.RED_CYAN ]: createMatrixPair( - { r: LUM }, // Left: Lum -> outR - { g: [ 0, 1, 0 ], b: [ 0, 0, 1 ] } // Right: G -> outG, B -> outB + { r: LUM }, // Left: Lum -> outR + { g: [ 0, 1, 0 ], b: [ 0, 0, 1 ] } // Right: G -> outG, B -> outB ), [ AnaglyphColorMode.MAGENTA_CYAN ]: createMatrixPair( - { r: LUM, b: [ 0.15, 0.29, 0.06 ] }, // Left: Lum -> outR, half-Lum -> outB + { r: LUM, b: [ 0.15, 0.29, 0.06 ] }, // Left: Lum -> outR, half-Lum -> outB { g: [ 0, 1, 0 ], b: [ 0.15, 0.29, 0.06 ] } // Right: G -> outG, half-Lum -> outB ), [ AnaglyphColorMode.MAGENTA_GREEN ]: createMatrixPair( - { r: LUM, b: LUM }, // Left: Lum -> outR, Lum -> outB - { g: [ 0, 1, 0 ] } // Right: G -> outG + { r: LUM, b: LUM }, // Left: Lum -> outR, Lum -> outB + { g: [ 0, 1, 0 ] } // Right: G -> outG ) }, @@ -223,16 +223,16 @@ const ANAGLYPH_MATRICES = { // Paper: Left=[0,0.7G+0.3B,0,0], Right=[0,G,B] [ AnaglyphAlgorithm.OPTIMISED ]: { [ AnaglyphColorMode.RED_CYAN ]: createMatrixPair( - { r: [ 0, 0.7, 0.3 ] }, // Left: 0.7G+0.3B -> outR - { g: [ 0, 1, 0 ], b: [ 0, 0, 1 ] } // Right: G -> outG, B -> outB + { r: [ 0, 0.7, 0.3 ] }, // Left: 0.7G+0.3B -> outR + { g: [ 0, 1, 0 ], b: [ 0, 0, 1 ] } // Right: G -> outG, B -> outB ), [ AnaglyphColorMode.MAGENTA_CYAN ]: createMatrixPair( { r: [ 0, 0.7, 0.3 ], b: [ 0, 0, 0.5 ] }, // Left: 0.7G+0.3B -> outR, partial B - { g: [ 0, 1, 0 ], b: [ 0, 0, 0.5 ] } // Right: G -> outG, partial B + { g: [ 0, 1, 0 ], b: [ 0, 0, 0.5 ] } // Right: G -> outG, partial B ), [ AnaglyphColorMode.MAGENTA_GREEN ]: createMatrixPair( { r: [ 0, 0.7, 0.3 ], b: [ 0, 0, 1 ] }, // Left: 0.7G+0.3B -> outR, B -> outB - { g: [ 0, 1, 0 ] } // Right: G -> outG + { g: [ 0, 1, 0 ] } // Right: G -> outG ) }, @@ -241,20 +241,20 @@ const ANAGLYPH_MATRICES = { // Paper matrix [8]: Left=[0.439R+0.447G+0.148B, 0, 0], Right=[0, 0.095R+0.934G+0.005B, 0.018R+0.028G+1.057B] [ AnaglyphAlgorithm.COMPROMISE ]: { [ AnaglyphColorMode.RED_CYAN ]: createMatrixPair( - { r: [ 0.439, 0.447, 0.148 ] }, // Left: weighted RGB -> outR + { r: [ 0.439, 0.447, 0.148 ] }, // Left: weighted RGB -> outR { - g: [ 0.095, 0.934, 0.005 ], // Right: weighted RGB -> outG - b: [ 0.018, 0.028, 1.057 ] // Right: weighted RGB -> outB + g: [ 0.095, 0.934, 0.005 ], // Right: weighted RGB -> outG + b: [ 0.018, 0.028, 1.057 ] // Right: weighted RGB -> outB } ), [ AnaglyphColorMode.MAGENTA_CYAN ]: createMatrixPair( { r: [ 0.439, 0.447, 0.148 ], - b: [ 0.009, 0.014, 0.074 ] // Partial blue from left + b: [ 0.009, 0.014, 0.074 ] // Partial blue from left }, { g: [ 0.095, 0.934, 0.005 ], - b: [ 0.009, 0.014, 0.528 ] // Partial blue from right + b: [ 0.009, 0.014, 0.528 ] // Partial blue from right } ), [ AnaglyphColorMode.MAGENTA_GREEN ]: createMatrixPair( @@ -275,7 +275,7 @@ const ANAGLYPH_MATRICES = { * * This implementation uses CameraUtils.frameCorners() to align stereo * camera frustums to a virtual screen plane, providing accurate depth - * perception with zero parallax at the screen distance. + * perception with zero parallax at the plane distance. * * @augments StereoCompositePassNode * @three_import import { anaglyphPass, AnaglyphAlgorithm, AnaglyphColorMode } from 'three/addons/tsl/display/AnaglyphPassNode.js'; @@ -317,8 +317,8 @@ class AnaglyphPassNode extends StereoCompositePassNode { this.eyeSep = 0.064; /** - * The distance from the viewer to the virtual screen plane - * where zero parallax (screen depth) occurs. + * The distance in world units from the viewer to the virtual + * screen plane where zero parallax (screen depth) occurs. * Objects at this distance appear at the screen surface. * Objects closer appear in front of the screen (negative parallax). * Objects further appear behind the screen (positive parallax). @@ -329,7 +329,7 @@ class AnaglyphPassNode extends StereoCompositePassNode { * @type {number} * @default 0.5 */ - this.screenDistance = 0.5; + this.planeDistance = 0.5; /** * The current anaglyph algorithm. @@ -462,12 +462,12 @@ class AnaglyphPassNode extends StereoCompositePassNode { _eyeL.copy( camera.position ).addScaledVector( _right, - halfSep ); _eyeR.copy( camera.position ).addScaledVector( _right, halfSep ); - // Calculate screen center (at screenDistance in front of the camera center) - _screenCenter.copy( camera.position ).addScaledVector( _forward, - this.screenDistance ); + // Calculate screen center (at planeDistance in front of the camera center) + _screenCenter.copy( camera.position ).addScaledVector( _forward, - this.planeDistance ); // Calculate screen dimensions from camera FOV and aspect ratio const DEG2RAD = Math.PI / 180; - const halfHeight = this.screenDistance * Math.tan( DEG2RAD * camera.fov / 2 ); + const halfHeight = this.planeDistance * Math.tan( DEG2RAD * camera.fov / 2 ); const halfWidth = halfHeight * camera.aspect; // Calculate screen corners diff --git a/examples/webgl_effects_anaglyph.html b/examples/webgl_effects_anaglyph.html index 2c54043fd08bd8..cab764fdeca188 100644 --- a/examples/webgl_effects_anaglyph.html +++ b/examples/webgl_effects_anaglyph.html @@ -96,9 +96,9 @@ // Configure stereo parameters for physically-correct rendering // eyeSep: interpupillary distance (default 0.064m / 64mm for humans) - // screenDistance: distance to the zero-parallax plane (objects here appear at screen depth) + // planeDistance: distance to the zero-parallax plane (objects here appear at screen depth) effect.eyeSep = 0.064; - effect.screenDistance = 3; // Match camera distance to origin for zero parallax at scene center + effect.planeDistance = 3; // Match camera distance to origin for zero parallax at scene center // diff --git a/examples/webgpu_display_stereo.html b/examples/webgpu_display_stereo.html index 17b4474f915327..1f0a8a7ae02923 100644 --- a/examples/webgpu_display_stereo.html +++ b/examples/webgpu_display_stereo.html @@ -54,7 +54,7 @@ const params = { effect: 'stereo', eyeSep: 0.064, - screenDistance: 3, + planeDistance: 3, anaglyphAlgorithm: 'dubois', anaglyphColorMode: 'redCyan' }; @@ -136,7 +136,7 @@ // Configure anaglyph for physically-correct stereo with zero parallax at scene center anaglyph.eyeSep = params.eyeSep; - anaglyph.screenDistance = params.screenDistance; + anaglyph.planeDistance = params.planeDistance; renderPipeline.outputNode = stereo; @@ -162,9 +162,9 @@ anaglyph.colorMode = value; } ); - anaglyphFolder.add( params, 'screenDistance', 0.5, 10, 0.1 ).name( 'Screen Distance' ).onChange( function ( value ) { + anaglyphFolder.add( params, 'planeDistance', 0.5, 10, 0.1 ).name( 'Plane Distance' ).onChange( function ( value ) { - anaglyph.screenDistance = value; + anaglyph.planeDistance = value; } ); anaglyphFolder.paramList.domElement.style.display = 'none'; From 1f2fea769315befd9bdb3f46574e2eeb92c5047a Mon Sep 17 00:00:00 2001 From: AI-Glow <202489492+glowsenior@users.noreply.github.com> Date: Tue, 3 Feb 2026 12:53:21 -0800 Subject: [PATCH 3/3] =?UTF-8?q?Fix=20typo=20in=20FileLoader=20JSDoc:=20hht?= =?UTF-8?q?tps=20=E2=86=92=20https=20(#32946)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/loaders/FileLoader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/loaders/FileLoader.js b/src/loaders/FileLoader.js index 2c732364a7f93a..90a4c8164ff1be 100644 --- a/src/loaders/FileLoader.js +++ b/src/loaders/FileLoader.js @@ -43,7 +43,7 @@ class FileLoader extends Loader { /** * The expected mime type. Valid values can be found - * [here](hhttps://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#mimetype) + * [here](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#mimetype) * * @type {string} */