@needle-tools/materialx 1.7.2 → 1.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@ All notable changes to this package will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.7.3] - 2026-07-09
8
+
9
+ ### Fixed
10
+ - Three PMREM environment sampling now reads the encoded CubeUV atlas from the base texture level, keeping glossy MaterialX reflections stable for prefiltered KTX2 environments that include hardware mip levels.
11
+
7
12
  ## [1.7.2] - 2026-07-06
8
13
 
9
14
  ### Fixed
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@needle-tools/materialx",
3
3
  "description": "MaterialX material support for three.js and Needle Engine – render physically based MaterialX shaders in the browser via WebAssembly",
4
- "version": "1.7.2",
4
+ "version": "1.7.3",
5
5
  "type": "module",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",
7
7
  "main": "index.js",
@@ -203,7 +203,10 @@ vec3 mx_cubeuv_bilinear(sampler2D envMap, vec3 direction, float mipInt) {
203
203
  uv.y += 4.0 * (exp2(u_envRadianceCubeUVMaxMip) - faceSize);
204
204
  uv.x *= u_envRadianceCubeUVTexelWidth;
205
205
  uv.y *= u_envRadianceCubeUVTexelHeight;
206
- return texture(envMap, uv).rgb;
206
+ // PMREM encodes roughness in the CubeUV atlas itself. If the source KTX2
207
+ // carries hardware mip levels, implicit sampling may pick those mips and
208
+ // corrupt the atlas lookup.
209
+ return textureLod(envMap, uv, 0.0).rgb;
207
210
  }
208
211
 
209
212
  float mx_cubeuv_roughnessToMip(float roughness) {