From 281815cbebe8c3bd48cde7f2cca6d2fced26141e Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Sat, 20 Jun 2026 14:51:35 +0200 Subject: [PATCH] USDZExporter: Basic normal scale support. (#33851) --- examples/jsm/exporters/USDZExporter.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/jsm/exporters/USDZExporter.js b/examples/jsm/exporters/USDZExporter.js index 52a9ead3d961b3..134713323d1afe 100644 --- a/examples/jsm/exporters/USDZExporter.js +++ b/examples/jsm/exporters/USDZExporter.js @@ -1075,8 +1075,13 @@ function buildMaterial( material, textures, quickLookCompatible = false ) { if ( mapType === 'normal' ) { - textureNode.addProperty( 'float4 inputs:scale = (2, 2, 2, 1)' ); - textureNode.addProperty( 'float4 inputs:bias = (-1, -1, -1, 0)' ); + // Similar to GLTFExporter, only the x component is used so the y-negation that + // GLTFLoader applies to tangent-less glTF assets is not baked into the export. + + const scale = material.normalScale.x; + + textureNode.addProperty( `float4 inputs:scale = (${ 2 * scale }, ${ 2 * scale }, 2, 1)` ); + textureNode.addProperty( `float4 inputs:bias = (${ - scale }, ${ - scale }, -1, 0)` ); }