From d96a30675d88e8d851c9b0f382e3a4941ef692a9 Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Wed, 13 May 2026 22:06:21 +0200 Subject: [PATCH 1/3] Update Raycaster.js Simplify #33568, see https://github.com/mrdoob/three.js/pull/33568#issuecomment-4443674475. --- src/core/Raycaster.js | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/core/Raycaster.js b/src/core/Raycaster.js index 0e6d3388662a66..f941e0b82b4c03 100644 --- a/src/core/Raycaster.js +++ b/src/core/Raycaster.js @@ -2,7 +2,6 @@ import { Matrix4 } from '../math/Matrix4.js'; import { Ray } from '../math/Ray.js'; import { Layers } from './Layers.js'; import { error } from '../utils.js'; -import { WebGPUCoordinateSystem } from '../constants.js'; const _matrix = /*@__PURE__*/ new Matrix4(); @@ -127,23 +126,7 @@ class Raycaster { } else if ( camera.isOrthographicCamera ) { - let coordsZ; - - if ( camera.reversedDepth ) { - - coordsZ = camera.far / ( camera.far - camera.near ); - - } else if ( camera.coordinateSystem === WebGPUCoordinateSystem ) { - - coordsZ = camera.near / ( camera.near - camera.far ); - - } else { - - coordsZ = ( camera.near + camera.far ) / ( camera.near - camera.far ); - - } - - this.ray.origin.set( coords.x, coords.y, coordsZ ).unproject( camera ); // set origin in plane of camera + this.ray.origin.set( coords.x, coords.y, camera.projectionMatrix.elements[ 14 ] ).unproject( camera ); // set origin in plane of camera this.ray.direction.set( 0, 0, - 1 ).transformDirection( camera.matrixWorld ); this.camera = camera; From bac44f15a0084d2899cc828e18133c291a091232 Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Wed, 13 May 2026 23:25:35 +0200 Subject: [PATCH 2/3] Core: Fix JSDoc. (#33569) --- src/nodes/accessors/TextureNode.js | 2 +- src/nodes/display/PassNode.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nodes/accessors/TextureNode.js b/src/nodes/accessors/TextureNode.js index dbb66cb074ec1c..f886ed21397ab3 100644 --- a/src/nodes/accessors/TextureNode.js +++ b/src/nodes/accessors/TextureNode.js @@ -813,7 +813,7 @@ class TextureNode extends UniformNode { /** * Gathers four texels from the texture. * - * @param {[Node]} gatherNode - The index of the channel to read. This must be in range [0, 3] and a compile-time constant. + * @param {Node} gatherNode - The index of the channel to read. This must be in range [0, 3] and a compile-time constant. * @return {TextureNode} A texture node representing the texture sample. */ gather( gatherNode = 0 ) { diff --git a/src/nodes/display/PassNode.js b/src/nodes/display/PassNode.js index bab01cc00b212b..6c2f1ad633de11 100644 --- a/src/nodes/display/PassNode.js +++ b/src/nodes/display/PassNode.js @@ -318,7 +318,7 @@ class PassNode extends TempNode { * A dictionary holding the internal result textures. * * @private - * @type {{ output: Texture, depth?: DepthTexture }} + * @type {{ output: Texture, depth: ?DepthTexture }} */ this._textures = { output: renderTarget.texture From 48badc167e789000ca6f982be4b384bfe9dd348f Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Wed, 13 May 2026 23:32:14 +0200 Subject: [PATCH 3/3] Update ConditionalNode.js Rephrase class description. --- src/nodes/math/ConditionalNode.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nodes/math/ConditionalNode.js b/src/nodes/math/ConditionalNode.js index 031576c73137c5..1b913364b1bf2d 100644 --- a/src/nodes/math/ConditionalNode.js +++ b/src/nodes/math/ConditionalNode.js @@ -7,12 +7,12 @@ import { warn } from '../../utils.js'; * Represents a logical `if/else` statement. Can be used as an alternative * to the `If()`/`Else()` syntax. * - * The corresponding TSL `select()` looks like so: + * The `select()` method is called in a chaining fashion on a condition. The parameter nodes of `select()` + * determine the outcome of the entire statement. + * * ```js * velocity = position.greaterThanEqual( limit ).select( velocity.negate(), velocity ); * ``` - * The `select()` method is called in a chaining fashion on a condition. The parameter nodes of `select()` - * determine the outcome of the entire statement. * * @augments Node */