@needle-tools/materialx 1.4.2 → 1.4.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,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