@needle-tools/three-mesh-effects 0.3.1 → 0.3.2
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 +22 -6
- package/SKILL.md +7 -5
- package/build/box-impostor-runtime.js +212 -87
- package/build/box-impostor-runtime.js.map +4 -4
- package/build/impostor-runtime.js +112 -46
- package/build/impostor-runtime.js.map +4 -4
- package/build/index.js +4 -0
- package/build/index.js.map +2 -2
- package/build/internal/box-impostor/box-impostor-display.js +178 -81
- package/build/internal/box-impostor/box-impostor-display.js.map +4 -4
- package/build/internal/box-impostor/box-impostor-material.js +163 -71
- package/build/internal/box-impostor/box-impostor-material.js.map +4 -4
- package/build/internal/box-impostor/box-impostor-projection.js +38 -18
- package/build/internal/box-impostor/box-impostor-projection.js.map +4 -4
- package/build/internal/box-impostor/box-impostor-runtime.js +193 -76
- package/build/internal/box-impostor/box-impostor-runtime.js.map +4 -4
- package/build/internal/impostor/impostor-node-material.js +112 -46
- package/build/internal/impostor/impostor-node-material.js.map +4 -4
- package/build/internal/pixel-impostor/pixel-impostor-display.js +84 -38
- package/build/internal/pixel-impostor/pixel-impostor-display.js.map +4 -4
- package/build/internal/rendering/captured-surface-depth.js +35 -0
- package/build/internal/rendering/captured-surface-depth.js.map +7 -0
- package/build/internal/rendering/captured-surface-material.js +28 -0
- package/build/internal/rendering/captured-surface-material.js.map +7 -0
- package/build/internal/rendering/renderer-support.js +31 -0
- package/build/internal/rendering/renderer-support.js.map +7 -0
- package/build/pixel-impostor-runtime.js +84 -38
- package/build/pixel-impostor-runtime.js.map +4 -4
- package/build/types/box-impostor/box-impostor-display.d.ts +9 -1
- package/build/types/box-impostor/box-impostor-material.d.ts +4 -0
- package/build/types/box-impostor/box-impostor-runtime.d.ts +5 -11
- package/build/types/impostor/impostor-node-material.d.ts +2 -15
- package/build/types/rendering/captured-surface-depth.d.ts +5 -0
- package/build/types/rendering/captured-surface-depth.js +1 -0
- package/build/types/rendering/captured-surface-material.d.ts +8 -0
- package/build/types/rendering/captured-surface-material.js +1 -0
- package/build/types/rendering/renderer-support.d.ts +27 -0
- package/build/types/rendering/renderer-support.js +1 -0
- package/package.json +3 -3
- package/src/box-impostor/box-impostor-display.js +23 -11
- package/src/box-impostor/box-impostor-material.js +94 -44
- package/src/box-impostor/box-impostor-projection.js +3 -14
- package/src/box-impostor/box-impostor-runtime.js +6 -4
- package/src/impostor/impostor-node-material.js +11 -40
- package/src/pixel-impostor/pixel-impostor-display.js +5 -13
- package/src/public/index.js +5 -0
- package/src/rendering/captured-surface-depth.js +55 -0
- package/src/rendering/captured-surface-material.js +27 -0
- package/src/rendering/renderer-support.js +50 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.2 - 2026-11-13
|
|
4
|
+
|
|
5
|
+
- Support Three.js r186 and load box and card impostors automatically with WebGLRenderer.
|
|
6
|
+
- Smooth box-impostor shading and view transitions, including capture edges.
|
|
7
|
+
- Correct point and spot lighting on reconstructed impostor surfaces.
|
|
8
|
+
- Keep traced boxes and fitted cards visible when the camera enters their bounds.
|
|
9
|
+
- Preserve scene intersections with standard, reversed and logarithmic depth buffers.
|
|
10
|
+
- Avoid repeated shader compilation when rendering box and card impostors on WebGL.
|
|
11
|
+
|
|
3
12
|
## 0.3.1 - 2026-11-11
|
|
4
13
|
|
|
5
14
|
- Show card and box carrier outlines without triangulation diagonals, including card overlays on WebGPU.
|
package/README.md
CHANGED
|
@@ -31,13 +31,19 @@ const { scene: model } = await loader.loadAsync('/model.glb');
|
|
|
31
31
|
scene.add(model);
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
This handles hull effects, deformation rigs, octahedral impostors, and pixel impostor atlas
|
|
34
|
+
This handles hull effects, deformation rigs, box and card impostors, octahedral impostors, and pixel impostor atlas
|
|
35
35
|
bindings, including assets combining extensions. It also works with `load`,
|
|
36
36
|
`parse`, and `parseAsync`. Each handler is dynamically imported only for assets
|
|
37
37
|
declaring that extension; bundlers can keep those imports in separate chunks.
|
|
38
38
|
Dynamic imports defer downloads, rather than removing handlers that an asset
|
|
39
39
|
might need. The existing individual registration functions remain available.
|
|
40
40
|
|
|
41
|
+
On `WebGLRenderer`, loading an enabled Mesh Effects extension installs Three's
|
|
42
|
+
`WebGLNodesHandler` once per renderer, so the same TSL materials render on WebGL.
|
|
43
|
+
Ordinary glTF files and disabled extensions leave the renderer untouched. Hosts
|
|
44
|
+
with their own compatible handler can advertise
|
|
45
|
+
`renderer.capabilities.supportsNodeMaterials = true` to retain it.
|
|
46
|
+
|
|
41
47
|
All extensions are enabled by default. To opt out of specific handlers, pass
|
|
42
48
|
their glTF extension names in the optional third argument:
|
|
43
49
|
|
|
@@ -89,12 +95,19 @@ in the material atlas rejects empty hits. Sampling rejects depth discontinuities
|
|
|
89
95
|
that would otherwise form extruded walls. Captures preserve surface opacity
|
|
90
96
|
independently of the display cutoff. `useLoader(loader, renderer)` enables it automatically.
|
|
91
97
|
|
|
92
|
-
Use `WebGPURenderer` from `three/webgpu
|
|
93
|
-
|
|
94
|
-
|
|
98
|
+
Use `WebGLRenderer` or `WebGPURenderer` from `three/webgpu`. `useLoader` and the
|
|
99
|
+
manual box registration enable Three's WebGL TSL handler when needed. Renderers
|
|
100
|
+
without node-material support retain the portable fallback for optional box
|
|
101
|
+
extensions and reject required ones. Captures remain fixed in their animated node frame.
|
|
95
102
|
A nearest-surface depth field cannot represent all hidden layers; split complex
|
|
96
103
|
parts into more boxes when gaps or occluded surfaces disappear.
|
|
97
104
|
|
|
105
|
+
Depth-writing variants use the reconstructed surface for depth, point/spot lighting
|
|
106
|
+
and received shadows. Enable Three's shadow map and the usual light/mesh
|
|
107
|
+
`castShadow` and mesh `receiveShadow` flags. Raster reflection probes use
|
|
108
|
+
`CubeRenderTarget` with `WebGPURenderer`; geometry raycasts still see the compact
|
|
109
|
+
carrier. Alpha-blended variants retain sorting and do not write depth.
|
|
110
|
+
|
|
98
111
|
For manual integration, `@needle-tools/three-mesh-effects/box-impostor-runtime`
|
|
99
112
|
exports `registerNeedleBoxImpostorLoader(loader, { renderer })`,
|
|
100
113
|
`createBoxImpostorGeometry(descriptor)`, `createBoxImpostorMaterial(descriptor, maps)`
|
|
@@ -121,7 +134,9 @@ opacity uses sorted draws without depth writes. Dithered opacity uses
|
|
|
121
134
|
alpha hashing; captures do not represent layered glass or refraction. Cutout
|
|
122
135
|
uses the live alpha cutoff.
|
|
123
136
|
Depth quality, interpolation and transparency select cached compiled materials;
|
|
124
|
-
disposing the
|
|
137
|
+
disposing the current material releases its cached variants without disposing
|
|
138
|
+
shared atlases. Dispose geometry separately; a renderer may refresh its buffers
|
|
139
|
+
without unloading the material.
|
|
125
140
|
`DEFAULT_BOX_IMPOSTOR_DISPLAY` and `normalizeBoxImpostorDisplay` expose the same
|
|
126
141
|
defaults and validation used by loading and live updates.
|
|
127
142
|
|
|
@@ -162,7 +177,8 @@ Get the current effect again after rebinding; old bindings no longer control it.
|
|
|
162
177
|
`getHullEffect(hull)` returns `undefined` for an ordinary or disposed hull.
|
|
163
178
|
Standalone animated hulls can follow their own animation; call `syncAnimation()`
|
|
164
179
|
after updating their mixers or deformation rig. TSL effects require
|
|
165
|
-
`WebGPURenderer` from `three/webgpu
|
|
180
|
+
`WebGPURenderer` from `three/webgpu` or `WebGLRenderer` with Three's
|
|
181
|
+
`WebGLNodesHandler`, which `useLoader` enables when loading an effect.
|
|
166
182
|
|
|
167
183
|
The existing manual API remains available for models without the extension.
|
|
168
184
|
Here the hull supplies the effect's surface and the original stays visible inside:
|
package/SKILL.md
CHANGED
|
@@ -44,10 +44,10 @@ independent animation loop.
|
|
|
44
44
|
modes still use `createPixelImpostorDisplay` from `/pixel-impostor-runtime`;
|
|
45
45
|
update its viewport and dispose it as documented in the README.
|
|
46
46
|
- Card and fitted-box impostors: `useLoader` restores `NEEDLE_box_impostor` with
|
|
47
|
-
WebGPURenderer
|
|
47
|
+
WebGPURenderer or WebGLRenderer, enabling Three's WebGLNodesHandler as needed. Use `setBoxImpostorDisplay` from
|
|
48
48
|
`/box-impostor-runtime` for live depth, view blending, transparency and cutoff
|
|
49
49
|
changes. Rigid node animation uses the application's AnimationMixer. Dispose
|
|
50
|
-
geometry and materials on unload;
|
|
50
|
+
geometry and materials on unload; material disposal also releases cached
|
|
51
51
|
display variants. Dispose shared atlas textures after their final consumer.
|
|
52
52
|
Captures contain one surface per direction, so hidden layers and refraction
|
|
53
53
|
are approximations; projection and traced modes have different quality costs.
|
|
@@ -55,9 +55,11 @@ independent animation loop.
|
|
|
55
55
|
can choose the supported material implementation.
|
|
56
56
|
|
|
57
57
|
Hull and other TSL effects require a renderer supporting node materials. Ordinary
|
|
58
|
-
Three.js applications use WebGPURenderer from `three/webgpu
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
Three.js applications use WebGPURenderer from `three/webgpu` or WebGLRenderer
|
|
59
|
+
with Three's WebGLNodesHandler. `useLoader` enables the latter lazily for an
|
|
60
|
+
enabled extension. Hosts with an existing compiler advertise
|
|
61
|
+
`renderer.capabilities.supportsNodeMaterials = true` to preserve it. Reuse the
|
|
62
|
+
host's renderer and render loop.
|
|
61
63
|
|
|
62
64
|
When a scene is cleared while asynchronous initialization is pending, dispose
|
|
63
65
|
any runtimes that finish afterward. Track scenes separately per viewer/context,
|