softbox 4.23.0 → 4.24.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/README.md +28 -0
- package/dist/index.d.cts +35 -0
- package/dist/index.d.ts +35 -0
- package/dist/simple-viewer.cjs +4 -4
- package/dist/simple-viewer.es.js +152 -33
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,6 +36,7 @@ Balanced studio lighting, a baked soft contact shadow that grounds the model, au
|
|
|
36
36
|
- **[Turntable](#turntable)** — one-word showcase auto-rotate that pauses while the user drags
|
|
37
37
|
- **[Animations](#animations)** — GLTF clips autoplay with one word; play/pause/clip-picker API
|
|
38
38
|
- **[Material variants](#material-variants)** — KHR_materials_variants colorways, switched live with one option
|
|
39
|
+
- **[AR](#ar)** — one option hands the model to AR Quick Look (iOS) / Scene Viewer (Android)
|
|
39
40
|
- **[Photoreal mode](#photoreal-mode--stills)** — progressive path tracing + `captureStill()` PNG export
|
|
40
41
|
- **[Video capture](#video-capture)** — `captureVideo()` records the canvas to WebM/MP4, zero dependencies
|
|
41
42
|
- **[Hotspots & click selection](#hotspot-annotations--click-selection)** — DOM pins on world-space points, BVH-accelerated picking
|
|
@@ -139,6 +140,33 @@ pick survives unrelated option changes. Variant materials materialize in
|
|
|
139
140
|
the background right after load (first paint never waits for colorways
|
|
140
141
|
nobody opened); an early pick is applied the moment they're ready.
|
|
141
142
|
|
|
143
|
+
## AR
|
|
144
|
+
|
|
145
|
+
One option puts an **AR** button over the canvas that opens the model in the
|
|
146
|
+
platform's native AR viewer — no WebXR session, no extra bundle:
|
|
147
|
+
|
|
148
|
+
```tsx
|
|
149
|
+
<SimpleViewer object={url} options={{ ar: true }} />
|
|
150
|
+
|
|
151
|
+
// iOS AR Quick Look cannot read GLB — give it the USDZ counterpart:
|
|
152
|
+
<SimpleViewer object={url} options={{ ar: { iosSrc: '/shoe.usdz', title: 'Runner' } }} />
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
- **Android** → Scene Viewer, straight from the model's own URL (`ar: true`
|
|
156
|
+
is enough). The model must be loaded from an **https** URL — a dropped
|
|
157
|
+
`blob:` file has no address a native app could fetch, and Scene Viewer
|
|
158
|
+
refuses plain http. Imperative `loadModel()` swaps are tracked — the
|
|
159
|
+
button always hands off the model that is on stage.
|
|
160
|
+
- **iOS** → AR Quick Look, from `iosSrc` (USDZ).
|
|
161
|
+
- **Desktop / unsupported** → the button simply never renders, so setting
|
|
162
|
+
`ar` unconditionally is safe. On an Android-UA device that turns out to
|
|
163
|
+
have no AR component (Quest, TV boxes), the failed handoff bounces back
|
|
164
|
+
reload-free and the button retires itself.
|
|
165
|
+
|
|
166
|
+
`placement` picks the corner (`bottom-left` by default; it lifts above the
|
|
167
|
+
built-in preset picker on its own). UI-only: toggling `ar` never rebuilds
|
|
168
|
+
the viewer or reloads the model.
|
|
169
|
+
|
|
142
170
|
## Turntable
|
|
143
171
|
|
|
144
172
|
One word puts the model on a slowly rotating showcase turntable. It pauses while the user drags and resumes on release; toggling is live, like presets.
|
package/dist/index.d.cts
CHANGED
|
@@ -31,6 +31,33 @@ export declare interface AnimationOptions {
|
|
|
31
31
|
speed?: number;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* AR handoff configuration: a small button over the canvas that opens the
|
|
36
|
+
* model in the platform's native AR viewer — AR Quick Look on iOS, Scene
|
|
37
|
+
* Viewer on Android. UI-only: the button never touches the WebGL viewer, and
|
|
38
|
+
* toggling it never rebuilds anything. The button only renders on devices
|
|
39
|
+
* that can actually hand off (never on desktop).
|
|
40
|
+
*/
|
|
41
|
+
export declare interface AROptions {
|
|
42
|
+
/**
|
|
43
|
+
* USDZ counterpart of the model, for iOS AR Quick Look — Quick Look cannot
|
|
44
|
+
* read GLB, so without this the button stays hidden on iOS. Android Scene
|
|
45
|
+
* Viewer instead reuses the loaded model's own URL and needs nothing here
|
|
46
|
+
* (but requires the model to be loaded from a network URL — a dropped
|
|
47
|
+
* `blob:` file has no address a native app could fetch).
|
|
48
|
+
*/
|
|
49
|
+
iosSrc?: string;
|
|
50
|
+
/** Title shown on Android Scene Viewer's info card. */
|
|
51
|
+
title?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Corner the button floats in (default `bottom-left`). When the built-in
|
|
54
|
+
* preset picker is enabled, a bottom-placed button lifts above the chip
|
|
55
|
+
* row on its own — pick a top corner if it must clear other chrome (e.g.
|
|
56
|
+
* a `bottom-left` gizmo).
|
|
57
|
+
*/
|
|
58
|
+
placement?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
59
|
+
}
|
|
60
|
+
|
|
34
61
|
export declare interface AxesHelperOptions {
|
|
35
62
|
size?: number;
|
|
36
63
|
}
|
|
@@ -730,6 +757,14 @@ export declare interface SimpleViewerOptions {
|
|
|
730
757
|
* live preset picker). All opt-in; UI-only — never rebuilds the viewer.
|
|
731
758
|
*/
|
|
732
759
|
ui?: UIOptions;
|
|
760
|
+
/**
|
|
761
|
+
* AR handoff button: opens the model in the platform's native AR viewer —
|
|
762
|
+
* AR Quick Look on iOS (needs `iosSrc`, a USDZ counterpart), Scene Viewer
|
|
763
|
+
* on Android (reuses the model's own URL). `true` enables with defaults.
|
|
764
|
+
* The button renders only on devices that can actually hand off, so it is
|
|
765
|
+
* safe to set unconditionally. UI-only — never rebuilds the viewer.
|
|
766
|
+
*/
|
|
767
|
+
ar?: boolean | AROptions;
|
|
733
768
|
/**
|
|
734
769
|
* Click-picking / hotspot-occlusion raycast tuning (e.g. `selection: { bvh:
|
|
735
770
|
* false }` to skip the load-time BVH build on memory-constrained targets).
|
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,33 @@ export declare interface AnimationOptions {
|
|
|
31
31
|
speed?: number;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* AR handoff configuration: a small button over the canvas that opens the
|
|
36
|
+
* model in the platform's native AR viewer — AR Quick Look on iOS, Scene
|
|
37
|
+
* Viewer on Android. UI-only: the button never touches the WebGL viewer, and
|
|
38
|
+
* toggling it never rebuilds anything. The button only renders on devices
|
|
39
|
+
* that can actually hand off (never on desktop).
|
|
40
|
+
*/
|
|
41
|
+
export declare interface AROptions {
|
|
42
|
+
/**
|
|
43
|
+
* USDZ counterpart of the model, for iOS AR Quick Look — Quick Look cannot
|
|
44
|
+
* read GLB, so without this the button stays hidden on iOS. Android Scene
|
|
45
|
+
* Viewer instead reuses the loaded model's own URL and needs nothing here
|
|
46
|
+
* (but requires the model to be loaded from a network URL — a dropped
|
|
47
|
+
* `blob:` file has no address a native app could fetch).
|
|
48
|
+
*/
|
|
49
|
+
iosSrc?: string;
|
|
50
|
+
/** Title shown on Android Scene Viewer's info card. */
|
|
51
|
+
title?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Corner the button floats in (default `bottom-left`). When the built-in
|
|
54
|
+
* preset picker is enabled, a bottom-placed button lifts above the chip
|
|
55
|
+
* row on its own — pick a top corner if it must clear other chrome (e.g.
|
|
56
|
+
* a `bottom-left` gizmo).
|
|
57
|
+
*/
|
|
58
|
+
placement?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
59
|
+
}
|
|
60
|
+
|
|
34
61
|
export declare interface AxesHelperOptions {
|
|
35
62
|
size?: number;
|
|
36
63
|
}
|
|
@@ -730,6 +757,14 @@ export declare interface SimpleViewerOptions {
|
|
|
730
757
|
* live preset picker). All opt-in; UI-only — never rebuilds the viewer.
|
|
731
758
|
*/
|
|
732
759
|
ui?: UIOptions;
|
|
760
|
+
/**
|
|
761
|
+
* AR handoff button: opens the model in the platform's native AR viewer —
|
|
762
|
+
* AR Quick Look on iOS (needs `iosSrc`, a USDZ counterpart), Scene Viewer
|
|
763
|
+
* on Android (reuses the model's own URL). `true` enables with defaults.
|
|
764
|
+
* The button renders only on devices that can actually hand off, so it is
|
|
765
|
+
* safe to set unconditionally. UI-only — never rebuilds the viewer.
|
|
766
|
+
*/
|
|
767
|
+
ar?: boolean | AROptions;
|
|
733
768
|
/**
|
|
734
769
|
* Click-picking / hotspot-occlusion raycast tuning (e.g. `selection: { bvh:
|
|
735
770
|
* false }` to skip the load-time BVH build on memory-constrained targets).
|