@displayxr/inline3d 1.12.0 → 1.13.0
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 +55 -0
- package/README.md +11 -0
- package/THIRD_PARTY_NOTICES.md +76 -0
- package/js/inline3d-playcanvas-engine.js +5 -0
- package/js/inline3d-splat-effects.js +1116 -0
- package/js/inline3d-splat-perf.js +3 -0
- package/js/inline3d-splat-playcanvas.js +517 -82
- package/js/inline3d-splat-shared.js +33 -0
- package/js/inline3d-splat.js +28 -0
- package/package.json +4 -2
- package/splat.d.ts +152 -5
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,61 @@ entry points (`.`, `./three`) are frozen for 1.x, while the **scene subpaths** (
|
|
|
5
5
|
`./splat`, `./model`) are a preview tier whose options may change in any release. Entries below say
|
|
6
6
|
which tier they touch, because that is what tells you whether an upgrade can move your pixels.
|
|
7
7
|
|
|
8
|
+
## 1.13.0 — 2026-09-24
|
|
9
|
+
|
|
10
|
+
Touches the **preview tier** (`./splat`, `engine: 'playcanvas'` only), additively. A page that
|
|
11
|
+
passes none of the new options renders the same pixels (rest view MAE 0.000 vs 1.12.1).
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- **Splat shader effects** ([`docs/splat-effects.md`](docs/splat-effects.md)). Every effect is keyed
|
|
16
|
+
on world position and time only, so both eyes of a woven tile agree (measured: coincident eyes,
|
|
17
|
+
L == R, MAE 0.000, for every effect).
|
|
18
|
+
- `addSplat(…, { reveal: 'inflate' | 'sweep' | 'dissolve' | 'fade' | { type, durationMs, holdMs,
|
|
19
|
+
easing, origin } })`: installed at its start state before the first frame, played once
|
|
20
|
+
`firstWoven` settles (at once in 2D).
|
|
21
|
+
- `handle.playEffect(name, { durationMs, holdMs, easing, origin, direction, scope }) →
|
|
22
|
+
Promise<{ finished }>`, `handle.setEffect(name, params | null)` (persistent effects, or any
|
|
23
|
+
effect held at `{ progress }`), `handle.stopEffect(name?, { finish })`, `handle.effects()`.
|
|
24
|
+
- Effects: `inflate` (the gallery's reveal, `z' = D + (z − D)·s` along rays from the eyes),
|
|
25
|
+
`deflate`, `sweep` (radial, sized from the framing box), `fade` (coverage-linear to ±8 %),
|
|
26
|
+
`dissolve` (the engine's dissolve script, as a reveal), `pulse`, `grade`, `clip`, and
|
|
27
|
+
`custom` / `custom:<name>` GLSL (engine-shaped functions, `dxrProgress`, `dxrTime`,
|
|
28
|
+
`splat.index` in entity scope; screen-space inputs refused).
|
|
29
|
+
- The SDK owns ONE generated chunk per scope (tile: the unified material's `gsplatModifyVS`;
|
|
30
|
+
entity: a work-buffer modifier), composed grade → clip → reveal → pulse → custom. Removing
|
|
31
|
+
the last effect restores the engine's own chunk: MAE 0.000, colour and alpha.
|
|
32
|
+
- `setSource(src, { transition: 'cut' | 'crossfade' | 'flip' | 'wavefront', durationMs, easing,
|
|
33
|
+
reveal, ridge, ridgeMaxDisparity })`. **`wavefront`** is the photo-frame prototype's sweep:
|
|
34
|
+
a soft left → right front, 0.18 of the travel wide, commits each column from the old photo
|
|
35
|
+
(a frozen frame, wiped at the same viewport u in both eyes) to the new one, with a 0.03 m
|
|
36
|
+
depth ridge riding it (capped at 0.4 % of the view width in disparity). It takes 2000 ms,
|
|
37
|
+
ease-in-out, and falls back to the crossfade in a hidden tab. `flip` flattens the old photo
|
|
38
|
+
onto its convergence plane, swaps at zero disparity and inflates the new one. `reveal`
|
|
39
|
+
reveals the incoming asset (entity scope) while the old one fades. `fadeMs` keeps its 1.12.1
|
|
40
|
+
meaning. For photo slideshows: `crossfade` or `wavefront`.
|
|
41
|
+
- Frame cost within noise (stereo 18.10 ms → 18.73 ms with an animating inflate; hiding effects
|
|
42
|
+
are cheaper).
|
|
43
|
+
- Spark: `reveal`, `playEffect`, `setEffect`, `stopEffect` throw "PlayCanvas-only in this
|
|
44
|
+
version".
|
|
45
|
+
- **`THIRD_PARTY_NOTICES.md`** (in the package): the MIT notices of PlayCanvas engine, three.js
|
|
46
|
+
and Spark. Shader code adapted from the engine carries a provenance comment.
|
|
47
|
+
|
|
48
|
+
## 1.12.1 — 2026-09-24
|
|
49
|
+
|
|
50
|
+
### Fixed
|
|
51
|
+
|
|
52
|
+
- **`setSource(…, { fadeMs })` is a real crossfade** (`./splat`, `engine: 'playcanvas'`). The fade
|
|
53
|
+
scaled every splat's alpha by t and drew both photos in one sorted pass, so whichever photo sat in
|
|
54
|
+
front won: an incoming photo in front covered 64 % of the picture at t = 0.2 (an 800 ms fade read
|
|
55
|
+
as a snap), one behind it only 18 % at t = 0.5 (a late pop). Now the last frame of the outgoing
|
|
56
|
+
asset is frozen into a texture (both eyes) and lerped with the live incoming one, per
|
|
57
|
+
premultiplied pixel, alpha included. Measured on three SHARP photo pairs, mono and a fake 2-view
|
|
58
|
+
stereo pair: the blend fraction is **t to ±0.001** at every tenth, identical in both eyes; the
|
|
59
|
+
frame at t = 0 equals the outgoing frame and the end state equals a `fadeMs: 0` swap (MAE 0.000,
|
|
60
|
+
colour and alpha). The outgoing photo holds still during the fade. If no frame is drawn within
|
|
61
|
+
250 ms (a hidden tab) the old one-pass fade runs, now with a coverage-linear alpha remap.
|
|
62
|
+
|
|
8
63
|
## 1.12.0 — 2026-09-24
|
|
9
64
|
|
|
10
65
|
Touches the **preview tier** (`./model`, and `./splat`'s `engine: 'playcanvas'` import path). A
|
package/README.md
CHANGED
|
@@ -53,6 +53,16 @@ Bundlers: the engine is reached through a named-import module (`js/inline3d-play
|
|
|
53
53
|
so the unused ~40% of the engine tree-shakes away); its sort workers are Blob URLs (CSP
|
|
54
54
|
`worker-src blob:`), and esbuild needs `node:worker_threads` marked external.
|
|
55
55
|
|
|
56
|
+
**Splat effects (preview, `engine: 'playcanvas'`).** Shader effects on the splats themselves,
|
|
57
|
+
keyed on world position and time so both eyes agree: `addSplat(…, { reveal: 'inflate' | 'sweep' |
|
|
58
|
+
'dissolve' | 'fade' })` (plays once the tile is woven), `handle.playEffect` / `setEffect` /
|
|
59
|
+
`stopEffect` / `effects()` (inflate, deflate, sweep, dissolve, fade, pulse, grade, clip, custom
|
|
60
|
+
GLSL), and `setSource(src, { transition: 'crossfade' | 'flip' | 'wavefront', reveal })`. Spark
|
|
61
|
+
throws on all of them for now. [`docs/splat-effects.md`](docs/splat-effects.md).
|
|
62
|
+
|
|
63
|
+
Splat and model rendering on the PlayCanvas backend uses the PlayCanvas engine (MIT); see
|
|
64
|
+
[`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md).
|
|
65
|
+
|
|
56
66
|
**Models render with PlayCanvas by default (1.12).** `addModel(wall, canvas, 'chair.glb')` loads
|
|
57
67
|
the glTF with the PlayCanvas engine (optional peer `playcanvas`), lit to match the Khronos glTF
|
|
58
68
|
Sample Viewer: an in-memory neutral studio environment, Khronos PBR Neutral tone mapping,
|
|
@@ -162,6 +172,7 @@ js/
|
|
|
162
172
|
inline3d-model-playcanvas.js the PlayCanvas model backend (Sample-Viewer lighting, engine decoders)
|
|
163
173
|
inline3d-model.js the three.js model backend (engine:'three'; ./model/three)
|
|
164
174
|
inline3d-playcanvas-engine.js named playcanvas imports for both PlayCanvas adapters (tree-shaking)
|
|
175
|
+
inline3d-splat-effects.js splat shader effects: the runner, the effect registry (PlayCanvas)
|
|
165
176
|
from what the asset declares (you serve the decoder files — see the guide)
|
|
166
177
|
docs/
|
|
167
178
|
authoring-inline-3d.md the authoring guide
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Third-party notices — `@displayxr/inline3d`
|
|
2
|
+
|
|
3
|
+
`@displayxr/inline3d` is Apache-2.0 (see `LICENSE`). It bundles no third-party code, but parts of
|
|
4
|
+
it are adapted from, or run on, the MIT-licensed projects below. Their notices follow.
|
|
5
|
+
|
|
6
|
+
| Project | Version | How it is used |
|
|
7
|
+
|---|---|---|
|
|
8
|
+
| [PlayCanvas engine](https://github.com/playcanvas/engine) | 2.22.3 | Optional peer (`playcanvas`): the default splat backend and the `./model` backend. Shader code in this package is **adapted** from it: the non-square-pixel footprint rewrite of `src/scene/shader-lib/glsl/chunks/gsplat/vert/gsplatCorner.js` (`js/inline3d-splat-playcanvas.js`), the quad-extent cap in `gsplatCommon.js` (`js/inline3d-splat-perf.js`), and the dissolve effect and its hash/noise/fbm helpers from `scripts/esm/gsplat/shader-effect-dissolve.mjs` (`js/inline3d-splat-effects.js`). Each adapted site carries a provenance comment. |
|
|
9
|
+
| [three.js](https://github.com/mrdoob/three.js) | ≥ 0.150 | Optional peer (`three`): the `./three` helpers, the Spark splat path, `./model`'s `engine: 'three'`. |
|
|
10
|
+
| [Spark](https://github.com/sparkjsdev/spark) | ≥ 2.0 | Optional peer (`@sparkjsdev/spark`): the Spark splat backend. |
|
|
11
|
+
|
|
12
|
+
## PlayCanvas engine — MIT
|
|
13
|
+
|
|
14
|
+
Copyright (c) 2011-2026 PlayCanvas Ltd.
|
|
15
|
+
|
|
16
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
17
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
18
|
+
in the Software without restriction, including without limitation the rights
|
|
19
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
20
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
21
|
+
furnished to do so, subject to the following conditions:
|
|
22
|
+
|
|
23
|
+
The above copyright notice and this permission notice shall be included in
|
|
24
|
+
all copies or substantial portions of the Software.
|
|
25
|
+
|
|
26
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
27
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
28
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
29
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
30
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
31
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
32
|
+
THE SOFTWARE.
|
|
33
|
+
|
|
34
|
+
## three.js — MIT
|
|
35
|
+
|
|
36
|
+
Copyright © 2010-2026 three.js authors
|
|
37
|
+
|
|
38
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
39
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
40
|
+
in the Software without restriction, including without limitation the rights
|
|
41
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
42
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
43
|
+
furnished to do so, subject to the following conditions:
|
|
44
|
+
|
|
45
|
+
The above copyright notice and this permission notice shall be included in
|
|
46
|
+
all copies or substantial portions of the Software.
|
|
47
|
+
|
|
48
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
49
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
50
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
51
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
52
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
53
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
54
|
+
THE SOFTWARE.
|
|
55
|
+
|
|
56
|
+
## Spark — MIT
|
|
57
|
+
|
|
58
|
+
Copyright © 2025 WORLD LABS TECHNOLOGIES, INC.
|
|
59
|
+
|
|
60
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
61
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
62
|
+
in the Software without restriction, including without limitation the rights
|
|
63
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
64
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
65
|
+
furnished to do so, subject to the following conditions:
|
|
66
|
+
|
|
67
|
+
The above copyright notice and this permission notice shall be included in
|
|
68
|
+
all copies or substantial portions of the Software.
|
|
69
|
+
|
|
70
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
71
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
72
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
73
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
74
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
75
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
76
|
+
THE SOFTWARE.
|
|
@@ -46,11 +46,16 @@ export {
|
|
|
46
46
|
BLENDEQUATION_ADD,
|
|
47
47
|
BLENDMODE_SRC_ALPHA,
|
|
48
48
|
BLENDMODE_ZERO,
|
|
49
|
+
BLENDMODE_ONE,
|
|
50
|
+
BLENDMODE_ONE_MINUS_SRC_ALPHA,
|
|
49
51
|
CULLFACE_NONE,
|
|
50
52
|
SEMANTIC_POSITION,
|
|
51
53
|
SEMANTIC_TEXCOORD0,
|
|
52
54
|
ShaderChunks,
|
|
53
55
|
SHADERLANGUAGE_GLSL,
|
|
56
|
+
// setSource's frame snapshot
|
|
57
|
+
RenderTarget,
|
|
58
|
+
FILTER_NEAREST,
|
|
54
59
|
// splats
|
|
55
60
|
WORKBUFFER_UPDATE_ALWAYS,
|
|
56
61
|
WORKBUFFER_UPDATE_ONCE,
|