@needle-tools/three-mesh-effects 0.3.3 → 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.
- package/CHANGELOG.md +5 -0
- package/README.md +2 -1
- package/build/box-impostor-runtime.js +13 -0
- package/build/box-impostor-runtime.js.map +3 -3
- package/build/deformation-runtime.js +11 -9
- package/build/deformation-runtime.js.map +2 -2
- package/build/impostor-runtime.js +41 -19
- package/build/impostor-runtime.js.map +3 -3
- package/build/internal/box-impostor/box-impostor-runtime.js +13 -0
- package/build/internal/box-impostor/box-impostor-runtime.js.map +3 -3
- package/build/internal/deformation/pin-ik.js +11 -9
- package/build/internal/deformation/pin-ik.js.map +2 -2
- package/build/internal/deformation/pin-wiggle.js.map +1 -1
- package/build/internal/deformation/rig-extension.js.map +1 -1
- package/build/internal/deformation/rig-runtime.js +11 -9
- package/build/internal/deformation/rig-runtime.js.map +2 -2
- package/build/internal/impostor/impostor-node-material.js +41 -19
- package/build/internal/impostor/impostor-node-material.js.map +3 -3
- package/build/internal/pixel-impostor/pixel-impostor-display.js +9 -7
- package/build/internal/pixel-impostor/pixel-impostor-display.js.map +2 -2
- package/build/internal/rendering/classic-webgl-support.js +12 -0
- package/build/internal/rendering/classic-webgl-support.js.map +7 -0
- package/build/internal/rendering/renderer-support.js +13 -0
- package/build/internal/rendering/renderer-support.js.map +3 -3
- package/build/pixel-impostor-runtime.js +9 -7
- package/build/pixel-impostor-runtime.js.map +2 -2
- package/build/types/rendering/classic-webgl-support.d.ts +9 -0
- package/build/types/rendering/classic-webgl-support.js +1 -0
- package/package.json +2 -2
- package/src/deformation/pin-ik.ts +13 -9
- package/src/impostor/impostor-node-material.js +31 -15
- package/src/pixel-impostor/pixel-impostor-display.js +18 -7
- package/src/rendering/classic-webgl-support.js +15 -0
- package/src/rendering/renderer-support.js +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
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
|
+
|
|
3
8
|
## 0.3.3 - 2026-11-16
|
|
4
9
|
|
|
5
10
|
- Reduce first-use shader compilation stalls for octahedral impostors.
|
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
|
|
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;
|