softbox 4.18.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/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 {
@@ -225,6 +233,7 @@ export declare enum ErrorCode {
225
233
  INVALID_STATE = "INVALID_STATE",
226
234
  INVALID_PARAMETER = "INVALID_PARAMETER",
227
235
  OPERATION_FAILED = "OPERATION_FAILED",
236
+ POST_PROCESSING_FAILED = "POST_PROCESSING_FAILED",
228
237
  UNKNOWN = "UNKNOWN"
229
238
  }
230
239
 
@@ -418,6 +427,13 @@ export declare interface PathTracingOptions {
418
427
  export declare interface RendererOptions {
419
428
  antialias?: boolean;
420
429
  alpha?: boolean;
430
+ premultipliedAlpha?: boolean;
431
+ /**
432
+ * Note: the viewer forces this ON regardless — a completed path-traced
433
+ * frame must survive on the canvas for captureStill to read back.
434
+ */
435
+ preserveDrawingBuffer?: boolean;
436
+ powerPreference?: 'high-performance' | 'low-power' | 'default';
421
437
  shadowMapEnabled?: boolean;
422
438
  pixelRatio?: number;
423
439
  /** A `THREE.ShadowMapType` constant (e.g. `THREE.PCFShadowMap` === 1). */
@@ -474,6 +490,9 @@ export declare interface RenderingOptions {
474
490
  /** The partial options for a preset, or an empty object when none is set. */
475
491
  export declare function resolvePreset(preset?: ViewerPreset): Partial<SimpleViewerOptions>;
476
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
+
477
496
  /**
478
497
  * Click-picking and hotspot-occlusion raycast options.
479
498
  */
@@ -532,6 +551,11 @@ export declare interface SimpleViewerHandle {
532
551
  /**
533
552
  * Replace the environment map (reflections + background) at runtime with the
534
553
  * equirectangular HDRI/LDR image at `url`. Cached by URL, so re-applying is cheap.
554
+ *
555
+ * Like the capture APIs, the environment APIs throw (async ones reject) with
556
+ * INVALID_STATE when the viewer was disposed — including a dispose that lands
557
+ * while the map is still loading. Fire-and-forget callers should attach a
558
+ * `.catch` if unmount races are possible (e.g. React StrictMode in dev).
535
559
  */
536
560
  setEnvironmentMap: (url: string) => Promise<void>;
537
561
  /** Restore the built-in studio environment and clean gradient background. */
@@ -553,6 +577,13 @@ export declare interface SimpleViewerOptions {
553
577
  * pass overrides the preset's values.
554
578
  */
555
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;
556
587
  /**
557
588
  * Length unit the model geometry is authored in (default `'meters'`).
558
589
  * Non-meter models are rescaled on load — without touching the model's own
@@ -693,6 +724,16 @@ export declare interface SimpleViewerProps {
693
724
  children?: React_2.ReactNode;
694
725
  }
695
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
+
696
737
  export declare class ThreeViewerError extends Error {
697
738
  readonly code: ErrorCode;
698
739
  readonly context?: ErrorContext | undefined;
@@ -756,6 +797,16 @@ declare interface Vec3Like {
756
797
  */
757
798
  export declare const VIEWER_PRESETS: Record<ViewerPreset, Partial<SimpleViewerOptions>>;
758
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
+
759
810
  /**
760
811
  * The public, Three.js-typed view of the viewer event contract — the shape
761
812
  * consumers see on the viewer handle's `events` emitter. Shares its single
@@ -842,4 +893,21 @@ declare interface ViewerEventMap_2<TObject, TCamera, TControls, THandle> {
842
893
  */
843
894
  export declare type ViewerPreset = 'studio' | 'product' | 'neutral' | 'dark' | 'outdoor';
844
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
+
845
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 {
@@ -225,6 +233,7 @@ export declare enum ErrorCode {
225
233
  INVALID_STATE = "INVALID_STATE",
226
234
  INVALID_PARAMETER = "INVALID_PARAMETER",
227
235
  OPERATION_FAILED = "OPERATION_FAILED",
236
+ POST_PROCESSING_FAILED = "POST_PROCESSING_FAILED",
228
237
  UNKNOWN = "UNKNOWN"
229
238
  }
230
239
 
@@ -418,6 +427,13 @@ export declare interface PathTracingOptions {
418
427
  export declare interface RendererOptions {
419
428
  antialias?: boolean;
420
429
  alpha?: boolean;
430
+ premultipliedAlpha?: boolean;
431
+ /**
432
+ * Note: the viewer forces this ON regardless — a completed path-traced
433
+ * frame must survive on the canvas for captureStill to read back.
434
+ */
435
+ preserveDrawingBuffer?: boolean;
436
+ powerPreference?: 'high-performance' | 'low-power' | 'default';
421
437
  shadowMapEnabled?: boolean;
422
438
  pixelRatio?: number;
423
439
  /** A `THREE.ShadowMapType` constant (e.g. `THREE.PCFShadowMap` === 1). */
@@ -474,6 +490,9 @@ export declare interface RenderingOptions {
474
490
  /** The partial options for a preset, or an empty object when none is set. */
475
491
  export declare function resolvePreset(preset?: ViewerPreset): Partial<SimpleViewerOptions>;
476
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
+
477
496
  /**
478
497
  * Click-picking and hotspot-occlusion raycast options.
479
498
  */
@@ -532,6 +551,11 @@ export declare interface SimpleViewerHandle {
532
551
  /**
533
552
  * Replace the environment map (reflections + background) at runtime with the
534
553
  * equirectangular HDRI/LDR image at `url`. Cached by URL, so re-applying is cheap.
554
+ *
555
+ * Like the capture APIs, the environment APIs throw (async ones reject) with
556
+ * INVALID_STATE when the viewer was disposed — including a dispose that lands
557
+ * while the map is still loading. Fire-and-forget callers should attach a
558
+ * `.catch` if unmount races are possible (e.g. React StrictMode in dev).
535
559
  */
536
560
  setEnvironmentMap: (url: string) => Promise<void>;
537
561
  /** Restore the built-in studio environment and clean gradient background. */
@@ -553,6 +577,13 @@ export declare interface SimpleViewerOptions {
553
577
  * pass overrides the preset's values.
554
578
  */
555
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;
556
587
  /**
557
588
  * Length unit the model geometry is authored in (default `'meters'`).
558
589
  * Non-meter models are rescaled on load — without touching the model's own
@@ -693,6 +724,16 @@ export declare interface SimpleViewerProps {
693
724
  children?: React_2.ReactNode;
694
725
  }
695
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
+
696
737
  export declare class ThreeViewerError extends Error {
697
738
  readonly code: ErrorCode;
698
739
  readonly context?: ErrorContext | undefined;
@@ -756,6 +797,16 @@ declare interface Vec3Like {
756
797
  */
757
798
  export declare const VIEWER_PRESETS: Record<ViewerPreset, Partial<SimpleViewerOptions>>;
758
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
+
759
810
  /**
760
811
  * The public, Three.js-typed view of the viewer event contract — the shape
761
812
  * consumers see on the viewer handle's `events` emitter. Shares its single
@@ -842,4 +893,21 @@ declare interface ViewerEventMap_2<TObject, TCamera, TControls, THandle> {
842
893
  */
843
894
  export declare type ViewerPreset = 'studio' | 'product' | 'neutral' | 'dark' | 'outdoor';
844
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
+
845
913
  export { }