@needle-tools/materialx 1.4.2 → 1.4.3-next.3bfa4b1
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 +9 -0
- package/README.md +34 -0
- package/bin/JsMaterialXCore.js +12 -9
- package/bin/JsMaterialXCore.wasm +0 -0
- package/bin/JsMaterialXGenShader.data.txt +26297 -24807
- package/bin/JsMaterialXGenShader.js +12 -11
- package/bin/JsMaterialXGenShader.wasm +0 -0
- package/bin/SHA_309ccca5d7788f90d773248c88498ddc203dc260 +0 -0
- package/bin/revision.json +5 -0
- package/package.json +4 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/materialx.d.ts +28 -0
- package/src/materialx.helper.d.ts +2 -0
- package/src/materialx.helper.js +46 -14
- package/src/materialx.js +42 -17
- package/src/materialx.material.js +192 -20
- package/src/utils.d.ts +3 -1
- package/src/vite-url-modules.d.ts +9 -0
- package/bin/README.md +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,15 @@ 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.4.3] – 2026-02-20
|
|
8
|
+
- Feat: Add `globalThis.NEEDLE_MATERIALX_LOCATION` to override WASM location. Use `"package"` for package-local files, or a custom path for self-hosted/CDN.
|
|
9
|
+
|
|
10
|
+
## [1.4.2] – 2026-02-10
|
|
11
|
+
- Fix: Improve error handling when MaterialX renderable element is not found
|
|
12
|
+
|
|
13
|
+
## [1.4.1] – 2026-02-10
|
|
14
|
+
- Feat: Use MaterialX from CDN by default
|
|
15
|
+
|
|
7
16
|
## [1.3.2] - 2025-08-12
|
|
8
17
|
- Fix: Error when MaterialX extension is not present
|
|
9
18
|
|
package/README.md
CHANGED
|
@@ -15,6 +15,40 @@ Web runtime support to load and display MaterialX materials in Needle Engine and
|
|
|
15
15
|
|
|
16
16
|
## How to use
|
|
17
17
|
|
|
18
|
+
### Custom WASM Location
|
|
19
|
+
|
|
20
|
+
By default, MaterialX WASM files are loaded from `https://cdn.needle.tools/static/materialx/<version>/`. You can override this by setting `globalThis.NEEDLE_MATERIALX_LOCATION` **before** any MaterialX code runs.
|
|
21
|
+
|
|
22
|
+
#### Package-local files
|
|
23
|
+
|
|
24
|
+
To use the WASM files bundled with the `@needle-tools/materialx` npm package, set the location to one of:
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
globalThis.NEEDLE_MATERIALX_LOCATION = "package";
|
|
28
|
+
// or
|
|
29
|
+
globalThis.NEEDLE_MATERIALX_LOCATION = "bin/";
|
|
30
|
+
// or
|
|
31
|
+
globalThis.NEEDLE_MATERIALX_LOCATION = "./bin/";
|
|
32
|
+
// or
|
|
33
|
+
globalThis.NEEDLE_MATERIALX_LOCATION = "../bin/";
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
This is useful when you want to avoid network requests or bundle all assets locally.
|
|
37
|
+
|
|
38
|
+
#### Custom path
|
|
39
|
+
|
|
40
|
+
To use a custom base URL (for self-hosted deployments, air-gapped environments, or a custom CDN):
|
|
41
|
+
|
|
42
|
+
```js
|
|
43
|
+
globalThis.NEEDLE_MATERIALX_LOCATION = "/assets/materialx/";
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The value must end with a trailing slash (`/`).
|
|
47
|
+
|
|
48
|
+
#### Default (CDN)
|
|
49
|
+
|
|
50
|
+
By default, MaterialX WASM files are loaded from the Needle CDN. No configuration needed.
|
|
51
|
+
|
|
18
52
|
### Use with Needle Engine
|
|
19
53
|
|
|
20
54
|
```ts
|