From 6cad074498ea514224b82e51585972a583e19b4c Mon Sep 17 00:00:00 2001 From: WestLangley Date: Tue, 14 Jul 2026 13:05:41 -0400 Subject: [PATCH 1/2] Vector3: Clean up comments (#34037) --- src/math/Vector3.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/math/Vector3.js b/src/math/Vector3.js index da4efea010d54a..b2e4c4e65cc50a 100644 --- a/src/math/Vector3.js +++ b/src/math/Vector3.js @@ -516,8 +516,8 @@ class Vector3 { } /** - * Transforms the direction of this vector by a matrix (the upper left 3 x 3 - * subset of the given 4x4 matrix and then normalizes the result. + * Transforms this vector by the upper left 3x3 sub-matrix of the given 4x4 matrix, + * and normalizes the result. * * @param {Matrix4} m - The matrix. * @return {Vector3} A reference to this vector. From 959b2f0f080988489b984a4e8075a28d8e07e4ce Mon Sep 17 00:00:00 2001 From: WestLangley Date: Tue, 14 Jul 2026 13:06:23 -0400 Subject: [PATCH 2/2] Shaders: Make comments more explicit (#34038) --- .../shaders/ShaderChunk/defaultnormal_vertex.glsl.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/renderers/shaders/ShaderChunk/defaultnormal_vertex.glsl.js b/src/renderers/shaders/ShaderChunk/defaultnormal_vertex.glsl.js index 0c1e1301561c9f..6775d60c08884c 100644 --- a/src/renderers/shaders/ShaderChunk/defaultnormal_vertex.glsl.js +++ b/src/renderers/shaders/ShaderChunk/defaultnormal_vertex.glsl.js @@ -10,7 +10,8 @@ vec3 transformedNormal = objectNormal; #ifdef USE_BATCHING // this is in lieu of a per-instance normal-matrix - // shear transforms in the instance matrix are not supported + // non-uniform scaling in the instance matrix is supported + // shear transforms are not supported mat3 bm = mat3( batchingMatrix ); transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); @@ -27,7 +28,8 @@ vec3 transformedNormal = objectNormal; #ifdef USE_INSTANCING // this is in lieu of a per-instance normal-matrix - // shear transforms in the instance matrix are not supported + // non-uniform scaling in the instance matrix is supported + // shear transforms are not supported mat3 im = mat3( instanceMatrix ); transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );