@needle-tools/three-mesh-effects 0.3.2 → 0.3.4

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +2 -1
  3. package/build/box-impostor-runtime.js +13 -0
  4. package/build/box-impostor-runtime.js.map +3 -3
  5. package/build/deformation-runtime.js +11 -9
  6. package/build/deformation-runtime.js.map +2 -2
  7. package/build/impostor-runtime.js +42 -6
  8. package/build/impostor-runtime.js.map +3 -3
  9. package/build/internal/box-impostor/box-impostor-runtime.js +13 -0
  10. package/build/internal/box-impostor/box-impostor-runtime.js.map +3 -3
  11. package/build/internal/deformation/pin-ik.js +11 -9
  12. package/build/internal/deformation/pin-ik.js.map +2 -2
  13. package/build/internal/deformation/pin-wiggle.js.map +1 -1
  14. package/build/internal/deformation/rig-extension.js.map +1 -1
  15. package/build/internal/deformation/rig-runtime.js +11 -9
  16. package/build/internal/deformation/rig-runtime.js.map +2 -2
  17. package/build/internal/impostor/impostor-node-material.js +42 -6
  18. package/build/internal/impostor/impostor-node-material.js.map +3 -3
  19. package/build/internal/pixel-impostor/pixel-impostor-display.js +9 -7
  20. package/build/internal/pixel-impostor/pixel-impostor-display.js.map +2 -2
  21. package/build/internal/rendering/classic-webgl-support.js +12 -0
  22. package/build/internal/rendering/classic-webgl-support.js.map +7 -0
  23. package/build/internal/rendering/renderer-support.js +13 -0
  24. package/build/internal/rendering/renderer-support.js.map +3 -3
  25. package/build/pixel-impostor-runtime.js +9 -7
  26. package/build/pixel-impostor-runtime.js.map +2 -2
  27. package/build/types/rendering/classic-webgl-support.d.ts +9 -0
  28. package/build/types/rendering/classic-webgl-support.js +1 -0
  29. package/package.json +2 -2
  30. package/src/deformation/pin-ik.ts +13 -9
  31. package/src/impostor/impostor-node-material.js +34 -6
  32. package/src/pixel-impostor/pixel-impostor-display.js +18 -7
  33. package/src/rendering/classic-webgl-support.js +15 -0
  34. package/src/rendering/renderer-support.js +5 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.4 - 2026-11-22
4
+
5
+ - Use Mesh Effects with the latest Three.js, r187. WebGPURenderer is supported from r185 and WebGLRenderer from r187.
6
+ - Ground octahedral impostors in your scene with real-time shadows on WebGPU, shaped by the captured model.
7
+
8
+ ## 0.3.3 - 2026-11-16
9
+
10
+ - Reduce first-use shader compilation stalls for octahedral impostors.
11
+
3
12
  ## 0.3.2 - 2026-11-13
4
13
 
5
14
  - Support Three.js r186 and load box and card impostors automatically with WebGLRenderer.
package/README.md CHANGED
@@ -6,7 +6,8 @@ Three.js loaders and TSL materials for GLBs exported by [Needle Mesh Baker](http
6
6
  npm install @needle-tools/three-mesh-effects three
7
7
  ```
8
8
 
9
- The package supports Three.js r185 and r186. Its Needle Engine adapter is an
9
+ The package supports Three.js r185 and later with `WebGPURenderer`, and r187
10
+ and later with `WebGLRenderer`. Its Needle Engine adapter is an
10
11
  optional import. The examples use ordinary Three.js and assume an existing
11
12
  `renderer`, `scene`, and `camera`.
12
13
 
@@ -1235,7 +1235,17 @@ import {
1235
1235
  } from "three";
1236
1236
 
1237
1237
  // src/rendering/renderer-support.js
1238
+ import { REVISION } from "three";
1238
1239
  import * as TSL from "three/tsl";
1240
+
1241
+ // src/rendering/classic-webgl-support.js
1242
+ function classicWebGLSupportsNodeMaterials(revision) {
1243
+ const fork = /^186\.2-alpha\.(\d+)$/.exec(revision);
1244
+ if (fork) return Number(fork[1]) >= 2;
1245
+ return Number.parseInt(revision, 10) >= 187;
1246
+ }
1247
+
1248
+ // src/rendering/renderer-support.js
1239
1249
  function rendererSupportsImpostorNodeMaterials(renderer) {
1240
1250
  if (typeof Reflect.get(TSL, "struct") !== "function") return false;
1241
1251
  return renderer?.isWebGPURenderer === true || renderer?.capabilities?.supportsNodeMaterials === true;
@@ -1247,6 +1257,9 @@ async function enableRendererNodeMaterials(renderer) {
1247
1257
  if (!setup) {
1248
1258
  setup = import("three/addons/tsl/WebGLNodesHandler.js").then(({ WebGLNodesHandler }) => {
1249
1259
  if (rendererSupportsImpostorNodeMaterials(renderer)) return;
1260
+ if (!classicWebGLSupportsNodeMaterials(REVISION)) {
1261
+ console.warn(`Mesh Effects: WebGLRenderer from three r${REVISION} stops drawing node materials after about a dozen are in use. Use three r187 or later, or WebGPURenderer.`);
1262
+ }
1250
1263
  renderer.setNodesHandler?.(new WebGLNodesHandler());
1251
1264
  renderer.capabilities ??= {};
1252
1265
  renderer.capabilities.supportsNodeMaterials = true;