From 975ba1749f8c1bfdedd2807d1c5d386f1c61402f Mon Sep 17 00:00:00 2001 From: Don McCurdy <1848368+donmccurdy@users.noreply.github.com> Date: Wed, 27 May 2026 09:53:14 -0400 Subject: [PATCH 1/2] KTX2Loader: Fix regression in rgba16 unorm support (#33662) --- examples/jsm/loaders/KTX2Loader.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/jsm/loaders/KTX2Loader.js b/examples/jsm/loaders/KTX2Loader.js index 75e717c100d0d8..6032c6bdda1992 100644 --- a/examples/jsm/loaders/KTX2Loader.js +++ b/examples/jsm/loaders/KTX2Loader.js @@ -971,6 +971,8 @@ KTX2Loader.BasisWorker = function () { const UNCOMPRESSED_FORMATS = new Set( [ RGBAFormat, RGBFormat, RGFormat, RedFormat ] ); +const NORMALIZED_VK_FORMATS = new Set( [ VK_FORMAT_R16G16B16A16_UNORM ] ); + const FORMAT_MAP = { [ VK_FORMAT_R32G32B32A32_SFLOAT ]: RGBAFormat, @@ -1220,6 +1222,7 @@ async function createRawTexture( container ) { texture.minFilter = useMipmaps ? NearestMipmapNearestFilter : NearestFilter; texture.magFilter = NearestFilter; texture.generateMipmaps = container.levelCount === 0; + texture.normalized = NORMALIZED_VK_FORMATS.has( vkFormat ); } else { From 373324d143cb599a5f2320c2dffa549c2e11c593 Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Wed, 27 May 2026 19:04:42 +0200 Subject: [PATCH 2/2] SphereGeometry: Make pole vertices more robust. (#33652) --- src/geometries/SphereGeometry.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/geometries/SphereGeometry.js b/src/geometries/SphereGeometry.js index 3fa34b879f7c1e..a0eeed5a540a75 100644 --- a/src/geometries/SphereGeometry.js +++ b/src/geometries/SphereGeometry.js @@ -76,6 +76,10 @@ class SphereGeometry extends BufferGeometry { const verticesRow = []; const v = iy / heightSegments; + const theta = thetaStart + v * thetaLength; + + const y = radius * Math.cos( theta ); + const ringRadius = Math.sqrt( radius * radius - y * y ); // special case for the poles @@ -94,12 +98,13 @@ class SphereGeometry extends BufferGeometry { for ( let ix = 0; ix <= widthSegments; ix ++ ) { const u = ix / widthSegments; + const phi = phiStart + u * phiLength; // vertex - vertex.x = - radius * Math.cos( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); - vertex.y = radius * Math.cos( thetaStart + v * thetaLength ); - vertex.z = radius * Math.sin( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); + vertex.x = - ringRadius * Math.cos( phi ); + vertex.y = y; + vertex.z = ringRadius * Math.sin( phi ); vertices.push( vertex.x, vertex.y, vertex.z );