@needle-tools/materialx 1.3.4 → 1.4.0-next.326ed81
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/package.json +2 -2
- package/src/materialx.js +18 -8
package/package.json
CHANGED
package/src/materialx.js
CHANGED
|
@@ -48,15 +48,25 @@ export async function ready() {
|
|
|
48
48
|
if (debug) console.log("[MaterialX] Initializing WASM module...");
|
|
49
49
|
try {
|
|
50
50
|
|
|
51
|
+
const useRemoteUrls = true;
|
|
52
|
+
|
|
51
53
|
/** @type {Array<string>} */
|
|
52
|
-
const urls = await Promise.all(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
const urls = await Promise.all(
|
|
55
|
+
useRemoteUrls ? [
|
|
56
|
+
/** @ts-ignore */
|
|
57
|
+
import( /* @vite-ignore */ `https://cdn.needle.tools/static/materialx/1.3.4/JsMaterialXCore.wasm?url`).then(m => m.default || m),
|
|
58
|
+
/** @ts-ignore */
|
|
59
|
+
import( /* @vite-ignore */ `https://cdn.needle.tools/static/materialx/1.3.4/JsMaterialXGenShader.wasm?url`).then(m => m.default || m),
|
|
60
|
+
/** @ts-ignore */
|
|
61
|
+
import( /* @vite-ignore */ `https://cdn.needle.tools/static/materialx/1.3.4/JsMaterialXGenShader.data?url`).then(m => m.default || m),
|
|
62
|
+
] : [
|
|
63
|
+
/** @ts-ignore */
|
|
64
|
+
import( /* @vite-ignore */ `../bin/JsMaterialXCore.wasm?url`).then(m => m.default || m),
|
|
65
|
+
/** @ts-ignore */
|
|
66
|
+
import( /* @vite-ignore */ `../bin/JsMaterialXGenShader.wasm?url`).then(m => m.default || m),
|
|
67
|
+
/** @ts-ignore */
|
|
68
|
+
import( /* @vite-ignore */ `../bin/JsMaterialXGenShader.data.txt?url`).then(m => m.default || m),
|
|
69
|
+
]);
|
|
60
70
|
const [JsMaterialXCore, JsMaterialXGenShader, JsMaterialXGenShader_data] = urls;
|
|
61
71
|
|
|
62
72
|
const module = await MaterialX({
|