@needle-tools/materialx 1.7.0-next.8333b4d → 1.7.0
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 +6 -2
- package/README.md +25 -1
- package/bin/JsMaterialXCore.js +1 -1
- package/bin/JsMaterialXGenShader.js +1 -1
- package/package.json +6 -3
- package/src/constants.js +4 -4
- package/src/loader/loader.three.d.ts +2 -0
- package/src/loader/loader.three.js +1 -0
- package/src/materialx.helper.js +15 -4
- package/src/materialx.js +19 -1
- package/src/materialx.material.d.ts +2 -0
- package/src/materialx.material.js +84 -3
- package/src/utils.js +16 -9
package/CHANGELOG.md
CHANGED
|
@@ -4,18 +4,22 @@ 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.0] - 2026-
|
|
7
|
+
## [1.7.0] - 2026-06-30
|
|
8
8
|
|
|
9
9
|
### Added
|
|
10
10
|
- Runtime environment radiance modes for fast Three.js PMREM sampling, MaterialX prefiltered latlong sampling, and MaterialX filtered importance sampling.
|
|
11
11
|
- MaterialX viewer examples for material library inspection, PMREM comparison, shaderball previews, configurable environments, and graph-driven material loading.
|
|
12
|
+
- Missing tangents are now automatically generated for MaterialX materials that require them. Set `generateTangents: false` to disable this.
|
|
12
13
|
|
|
13
14
|
### Changed
|
|
14
15
|
- Rebuilt the bundled MaterialX runtime to 1.39.5.
|
|
15
16
|
- Improved texture sampling, alpha-mode render state, environment rotation, and PMREM handling for Three.js integration.
|
|
16
17
|
|
|
17
18
|
### Fixed
|
|
18
|
-
- Removed
|
|
19
|
+
- Removed runtime imports of `three/src`, `UniformsLib` so the package can share the host application's Three.js import map.
|
|
20
|
+
- Added the JSON module import attribute for `package.json` so raw browser ESM imports can read the package version without MIME errors.
|
|
21
|
+
- Made Node ESM imports browser-global safe and load the bundled MaterialX WASM/data files from the installed package when `ready()` runs under Node.
|
|
22
|
+
- Switched bundled MaterialX Emscripten loaders to `node:module` builtin imports for Deno compatibility, and added runtime smoke scripts for Node, Deno, and Bun.
|
|
19
23
|
- Corrected material parameter editing for color values, environment controls, and graph-loaded materials in the viewer examples.
|
|
20
24
|
- Kept viewer debug panels and camera controls consistent across the material library, graph, shadows, and complex scenes.
|
|
21
25
|
|
package/README.md
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Web runtime for [MaterialX](https://materialx.org/) materials in [Needle Engine](https://needle.tools) and [three.js](https://threejs.org/). Renders physically based MaterialX shaders in the browser using WebAssembly — load `.mtlx` files or glTF assets with the `NEEDLE_materials_mtlx` extension (created with Needle Engine's Unity integration and ShaderGraph).
|
|
4
4
|
|
|
5
|
-
- MaterialX to WebGL
|
|
5
|
+
- MaterialX to WebGL shader generation via WASM
|
|
6
6
|
- Vertex displacement support (procedural noise, texture-based, animatable)
|
|
7
7
|
- Material-level ambient occlusion (per glTF specification)
|
|
8
8
|
- UV coordinate convention handling (glTF ↔ OpenGL)
|
|
9
|
+
- Automatic MikkTSpace tangent generation when MaterialX shaders need tangents
|
|
9
10
|
- Three.js shadow support (directional, spot, point lights)
|
|
10
11
|
- Alpha mask and blend transparency modes
|
|
11
12
|
- glTF extension for embedding MaterialX materials in `.glb`/`.gltf` files
|
|
@@ -76,6 +77,29 @@ const material = await Experimental_API.createMaterialXMaterial(
|
|
|
76
77
|
);
|
|
77
78
|
```
|
|
78
79
|
|
|
80
|
+
### Tangents
|
|
81
|
+
|
|
82
|
+
Some MaterialX shaders need tangent-space data for correct normal, anisotropy, or texture-space lighting. If a geometry is missing tangents, MaterialX materials generate MikkTSpace tangents lazily at render time using Three.js' bundled MikkTSpace utilities.
|
|
83
|
+
|
|
84
|
+
Automatic tangent generation is enabled by default. To keep the previous warning-only behavior, disable it in the same options object used for other MaterialX settings:
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
useNeedleMaterialX(gltfLoader, {
|
|
88
|
+
generateTangents: false,
|
|
89
|
+
});
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
For raw MaterialX materials:
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
const material = await Experimental_API.createMaterialXMaterial(
|
|
96
|
+
mtlxSource,
|
|
97
|
+
0,
|
|
98
|
+
undefined,
|
|
99
|
+
{ generateTangents: false },
|
|
100
|
+
);
|
|
101
|
+
```
|
|
102
|
+
|
|
79
103
|
## WASM
|
|
80
104
|
|
|
81
105
|
### Default (CDN)
|