softbox 4.19.0 → 4.20.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 +21 -0
- package/dist/index.d.cts +55 -0
- package/dist/index.d.ts +55 -0
- package/dist/simple-viewer.cjs +2 -2
- package/dist/simple-viewer.es.js +279 -248
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,6 +32,7 @@ Balanced studio lighting, a baked soft contact shadow that grounds the model, au
|
|
|
32
32
|
## What you get
|
|
33
33
|
|
|
34
34
|
- **[Visual presets](#visual-presets)** — `studio · product · neutral · dark · outdoor`, one word, switched live
|
|
35
|
+
- **[Scenes](#scenes)** — `studio_dome · studio_soft`, one word picks the set the model stands in
|
|
35
36
|
- **[Turntable](#turntable)** — one-word showcase auto-rotate that pauses while the user drags
|
|
36
37
|
- **[Animations](#animations)** — GLTF clips autoplay with one word; play/pause/clip-picker API
|
|
37
38
|
- **[Photoreal mode](#photoreal-mode--stills)** — progressive path tracing + `captureStill()` PNG export
|
|
@@ -84,6 +85,26 @@ Let your users switch presets with the built-in picker (off by default):
|
|
|
84
85
|
<SimpleViewer object={url} options={{ ui: { presets: true } }} />
|
|
85
86
|
```
|
|
86
87
|
|
|
88
|
+
## Scenes
|
|
89
|
+
|
|
90
|
+
Presets grade the picture; **scenes** choose the set. `options.scene` selects
|
|
91
|
+
the physical set the model stands in — the floor, the backdrop and how the
|
|
92
|
+
built-in studio environment is built. Unlike presets, a scene is structural:
|
|
93
|
+
switching one rebuilds the viewer.
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
<SimpleViewer object={url} options={{ scene: 'studio_soft' }} />
|
|
97
|
+
// studio_dome (default) | studio_soft
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
- `studio_dome` — the default set: shadow-catcher floor, baked soft contact
|
|
101
|
+
shadow and a crisp, contrast-pushed studio light with distinct highlights.
|
|
102
|
+
- `studio_soft` — the same set lit softly: an even, low-contrast wraparound
|
|
103
|
+
light that flatters matte materials and softens speculars.
|
|
104
|
+
|
|
105
|
+
Scenes compose with presets — `scene` picks the set, `preset` grades it, and
|
|
106
|
+
any explicit option you pass overrides both.
|
|
107
|
+
|
|
87
108
|
## Turntable
|
|
88
109
|
|
|
89
110
|
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
|
@@ -132,6 +132,12 @@ export declare enum ControlType {
|
|
|
132
132
|
OrbitControls = "OrbitControls"
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
/** The scene every viewer stands in when none is set. */
|
|
136
|
+
export declare const DEFAULT_SCENE: ViewerScene;
|
|
137
|
+
|
|
138
|
+
/** The grade the studio environment is built with when none is set. */
|
|
139
|
+
export declare const DEFAULT_STUDIO_LOOK: StudioLook;
|
|
140
|
+
|
|
135
141
|
/**
|
|
136
142
|
* Default options using the new format structure
|
|
137
143
|
*/
|
|
@@ -203,6 +209,8 @@ export declare interface EnvironmentOptions {
|
|
|
203
209
|
* Runtime-tunable via `updateOptions` — presets drive this live.
|
|
204
210
|
*/
|
|
205
211
|
environmentIntensity?: number;
|
|
212
|
+
/** Grade of the built-in studio environment; ignored when `url` is set. */
|
|
213
|
+
studioLook?: StudioLook;
|
|
206
214
|
}
|
|
207
215
|
|
|
208
216
|
export declare enum ErrorCode {
|
|
@@ -482,6 +490,9 @@ export declare interface RenderingOptions {
|
|
|
482
490
|
/** The partial options for a preset, or an empty object when none is set. */
|
|
483
491
|
export declare function resolvePreset(preset?: ViewerPreset): Partial<SimpleViewerOptions>;
|
|
484
492
|
|
|
493
|
+
/** The partial options for a scene, or an empty object when none is set. */
|
|
494
|
+
export declare function resolveScene(scene?: ViewerScene): Partial<SimpleViewerOptions>;
|
|
495
|
+
|
|
485
496
|
/**
|
|
486
497
|
* Click-picking and hotspot-occlusion raycast options.
|
|
487
498
|
*/
|
|
@@ -566,6 +577,13 @@ export declare interface SimpleViewerOptions {
|
|
|
566
577
|
* pass overrides the preset's values.
|
|
567
578
|
*/
|
|
568
579
|
preset?: ViewerPreset;
|
|
580
|
+
/**
|
|
581
|
+
* A one-word scene (`studio_dome`, `studio_soft`) that selects the physical
|
|
582
|
+
* set — floor, backdrop and how the studio environment is built. The
|
|
583
|
+
* structural counterpart of `preset`: switching a scene rebuilds the viewer.
|
|
584
|
+
* Any other option you pass overrides the scene's values.
|
|
585
|
+
*/
|
|
586
|
+
scene?: ViewerScene;
|
|
569
587
|
/**
|
|
570
588
|
* Length unit the model geometry is authored in (default `'meters'`).
|
|
571
589
|
* Non-meter models are rescaled on load — without touching the model's own
|
|
@@ -706,6 +724,16 @@ export declare interface SimpleViewerProps {
|
|
|
706
724
|
children?: React_2.ReactNode;
|
|
707
725
|
}
|
|
708
726
|
|
|
727
|
+
/**
|
|
728
|
+
* How the built-in procedural studio environment is graded when it is built.
|
|
729
|
+
* `crisp` (the default) darkens the surround and boosts the soft-box panels so
|
|
730
|
+
* glossy materials show distinct highlights; `soft` uses the studio room
|
|
731
|
+
* as-built for an even, low-contrast wraparound light. Structural — the
|
|
732
|
+
* environment is baked once at construction, so changing it rebuilds the
|
|
733
|
+
* viewer. Scenes (`SimpleViewerOptions.scene`) drive this.
|
|
734
|
+
*/
|
|
735
|
+
export declare type StudioLook = 'crisp' | 'soft';
|
|
736
|
+
|
|
709
737
|
export declare class ThreeViewerError extends Error {
|
|
710
738
|
readonly code: ErrorCode;
|
|
711
739
|
readonly context?: ErrorContext | undefined;
|
|
@@ -769,6 +797,16 @@ declare interface Vec3Like {
|
|
|
769
797
|
*/
|
|
770
798
|
export declare const VIEWER_PRESETS: Record<ViewerPreset, Partial<SimpleViewerOptions>>;
|
|
771
799
|
|
|
800
|
+
/**
|
|
801
|
+
* Scenes: named SETS layered over the defaults (deep-merged), the structural
|
|
802
|
+
* counterpart of `VIEWER_PRESETS`. Where a preset grades the picture (runtime
|
|
803
|
+
* look fields, applied live), a scene selects the physical set the model
|
|
804
|
+
* stands in — floor, backdrop and how the studio environment is built — so
|
|
805
|
+
* each scene only sets **structural** fields and switching one rebuilds the
|
|
806
|
+
* viewer. Explicit user options always win.
|
|
807
|
+
*/
|
|
808
|
+
export declare const VIEWER_SCENES: Record<ViewerScene, Partial<SimpleViewerOptions>>;
|
|
809
|
+
|
|
772
810
|
/**
|
|
773
811
|
* The public, Three.js-typed view of the viewer event contract — the shape
|
|
774
812
|
* consumers see on the viewer handle's `events` emitter. Shares its single
|
|
@@ -855,4 +893,21 @@ declare interface ViewerEventMap_2<TObject, TCamera, TControls, THandle> {
|
|
|
855
893
|
*/
|
|
856
894
|
export declare type ViewerPreset = 'studio' | 'product' | 'neutral' | 'dark' | 'outdoor';
|
|
857
895
|
|
|
896
|
+
/**
|
|
897
|
+
* A one-word scene that selects the physical SET the model stands in — the
|
|
898
|
+
* floor, the backdrop geometry and how the built-in studio environment is
|
|
899
|
+
* built. Set it on `SimpleViewerOptions.scene`. The scene is the structural
|
|
900
|
+
* counterpart of the tonal `preset` axis: presets grade the picture live,
|
|
901
|
+
* scenes swap the set (switching one rebuilds the viewer). Any explicit
|
|
902
|
+
* option you pass overrides the scene's values.
|
|
903
|
+
*
|
|
904
|
+
* - `studio_dome` — the default set: invisible shadow-catcher floor, baked
|
|
905
|
+
* soft contact shadow, crisp contrast-pushed studio environment (distinct
|
|
906
|
+
* highlights on glossy materials) and the path-traced infinity dome.
|
|
907
|
+
* - `studio_soft` — the same set lit softly: the studio environment is used
|
|
908
|
+
* as-built, without the contrast push, for an even, low-drama wraparound
|
|
909
|
+
* light that flatters matte materials and softens speculars.
|
|
910
|
+
*/
|
|
911
|
+
export declare type ViewerScene = 'studio_dome' | 'studio_soft';
|
|
912
|
+
|
|
858
913
|
export { }
|
package/dist/index.d.ts
CHANGED
|
@@ -132,6 +132,12 @@ export declare enum ControlType {
|
|
|
132
132
|
OrbitControls = "OrbitControls"
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
/** The scene every viewer stands in when none is set. */
|
|
136
|
+
export declare const DEFAULT_SCENE: ViewerScene;
|
|
137
|
+
|
|
138
|
+
/** The grade the studio environment is built with when none is set. */
|
|
139
|
+
export declare const DEFAULT_STUDIO_LOOK: StudioLook;
|
|
140
|
+
|
|
135
141
|
/**
|
|
136
142
|
* Default options using the new format structure
|
|
137
143
|
*/
|
|
@@ -203,6 +209,8 @@ export declare interface EnvironmentOptions {
|
|
|
203
209
|
* Runtime-tunable via `updateOptions` — presets drive this live.
|
|
204
210
|
*/
|
|
205
211
|
environmentIntensity?: number;
|
|
212
|
+
/** Grade of the built-in studio environment; ignored when `url` is set. */
|
|
213
|
+
studioLook?: StudioLook;
|
|
206
214
|
}
|
|
207
215
|
|
|
208
216
|
export declare enum ErrorCode {
|
|
@@ -482,6 +490,9 @@ export declare interface RenderingOptions {
|
|
|
482
490
|
/** The partial options for a preset, or an empty object when none is set. */
|
|
483
491
|
export declare function resolvePreset(preset?: ViewerPreset): Partial<SimpleViewerOptions>;
|
|
484
492
|
|
|
493
|
+
/** The partial options for a scene, or an empty object when none is set. */
|
|
494
|
+
export declare function resolveScene(scene?: ViewerScene): Partial<SimpleViewerOptions>;
|
|
495
|
+
|
|
485
496
|
/**
|
|
486
497
|
* Click-picking and hotspot-occlusion raycast options.
|
|
487
498
|
*/
|
|
@@ -566,6 +577,13 @@ export declare interface SimpleViewerOptions {
|
|
|
566
577
|
* pass overrides the preset's values.
|
|
567
578
|
*/
|
|
568
579
|
preset?: ViewerPreset;
|
|
580
|
+
/**
|
|
581
|
+
* A one-word scene (`studio_dome`, `studio_soft`) that selects the physical
|
|
582
|
+
* set — floor, backdrop and how the studio environment is built. The
|
|
583
|
+
* structural counterpart of `preset`: switching a scene rebuilds the viewer.
|
|
584
|
+
* Any other option you pass overrides the scene's values.
|
|
585
|
+
*/
|
|
586
|
+
scene?: ViewerScene;
|
|
569
587
|
/**
|
|
570
588
|
* Length unit the model geometry is authored in (default `'meters'`).
|
|
571
589
|
* Non-meter models are rescaled on load — without touching the model's own
|
|
@@ -706,6 +724,16 @@ export declare interface SimpleViewerProps {
|
|
|
706
724
|
children?: React_2.ReactNode;
|
|
707
725
|
}
|
|
708
726
|
|
|
727
|
+
/**
|
|
728
|
+
* How the built-in procedural studio environment is graded when it is built.
|
|
729
|
+
* `crisp` (the default) darkens the surround and boosts the soft-box panels so
|
|
730
|
+
* glossy materials show distinct highlights; `soft` uses the studio room
|
|
731
|
+
* as-built for an even, low-contrast wraparound light. Structural — the
|
|
732
|
+
* environment is baked once at construction, so changing it rebuilds the
|
|
733
|
+
* viewer. Scenes (`SimpleViewerOptions.scene`) drive this.
|
|
734
|
+
*/
|
|
735
|
+
export declare type StudioLook = 'crisp' | 'soft';
|
|
736
|
+
|
|
709
737
|
export declare class ThreeViewerError extends Error {
|
|
710
738
|
readonly code: ErrorCode;
|
|
711
739
|
readonly context?: ErrorContext | undefined;
|
|
@@ -769,6 +797,16 @@ declare interface Vec3Like {
|
|
|
769
797
|
*/
|
|
770
798
|
export declare const VIEWER_PRESETS: Record<ViewerPreset, Partial<SimpleViewerOptions>>;
|
|
771
799
|
|
|
800
|
+
/**
|
|
801
|
+
* Scenes: named SETS layered over the defaults (deep-merged), the structural
|
|
802
|
+
* counterpart of `VIEWER_PRESETS`. Where a preset grades the picture (runtime
|
|
803
|
+
* look fields, applied live), a scene selects the physical set the model
|
|
804
|
+
* stands in — floor, backdrop and how the studio environment is built — so
|
|
805
|
+
* each scene only sets **structural** fields and switching one rebuilds the
|
|
806
|
+
* viewer. Explicit user options always win.
|
|
807
|
+
*/
|
|
808
|
+
export declare const VIEWER_SCENES: Record<ViewerScene, Partial<SimpleViewerOptions>>;
|
|
809
|
+
|
|
772
810
|
/**
|
|
773
811
|
* The public, Three.js-typed view of the viewer event contract — the shape
|
|
774
812
|
* consumers see on the viewer handle's `events` emitter. Shares its single
|
|
@@ -855,4 +893,21 @@ declare interface ViewerEventMap_2<TObject, TCamera, TControls, THandle> {
|
|
|
855
893
|
*/
|
|
856
894
|
export declare type ViewerPreset = 'studio' | 'product' | 'neutral' | 'dark' | 'outdoor';
|
|
857
895
|
|
|
896
|
+
/**
|
|
897
|
+
* A one-word scene that selects the physical SET the model stands in — the
|
|
898
|
+
* floor, the backdrop geometry and how the built-in studio environment is
|
|
899
|
+
* built. Set it on `SimpleViewerOptions.scene`. The scene is the structural
|
|
900
|
+
* counterpart of the tonal `preset` axis: presets grade the picture live,
|
|
901
|
+
* scenes swap the set (switching one rebuilds the viewer). Any explicit
|
|
902
|
+
* option you pass overrides the scene's values.
|
|
903
|
+
*
|
|
904
|
+
* - `studio_dome` — the default set: invisible shadow-catcher floor, baked
|
|
905
|
+
* soft contact shadow, crisp contrast-pushed studio environment (distinct
|
|
906
|
+
* highlights on glossy materials) and the path-traced infinity dome.
|
|
907
|
+
* - `studio_soft` — the same set lit softly: the studio environment is used
|
|
908
|
+
* as-built, without the contrast push, for an even, low-drama wraparound
|
|
909
|
+
* light that flatters matte materials and softens speculars.
|
|
910
|
+
*/
|
|
911
|
+
export declare type ViewerScene = 'studio_dome' | 'studio_soft';
|
|
912
|
+
|
|
858
913
|
export { }
|