softbox 4.21.0 → 4.23.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 +37 -3
- package/dist/{ThreePathTracingService-CMw8SvGp.cjs → ThreePathTracingService-CamzPwtW.cjs} +4 -4
- package/dist/{ThreePathTracingService-Dze7maGx.js → ThreePathTracingService-yCaEtW_f.js} +321 -322
- package/dist/index.d.cts +67 -12
- package/dist/index.d.ts +67 -12
- package/dist/simple-viewer.cjs +95 -3
- package/dist/simple-viewer.es.js +1992 -1668
- package/dist/smoothstep-BsyRnZAu.cjs +2 -0
- package/dist/{unwrap-DdgS2iXe.js → smoothstep-gC155W8-.js} +224 -216
- package/package.json +1 -1
- package/dist/unwrap-CuSMMFPQ.cjs +0 -2
package/dist/index.d.cts
CHANGED
|
@@ -132,6 +132,29 @@ export declare enum ControlType {
|
|
|
132
132
|
OrbitControls = "OrbitControls"
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
/**
|
|
136
|
+
* Photographic PBR maps for the outdoor concrete ground (CC0, Poly Haven;
|
|
137
|
+
* ~600 KB total, same CDN and override/self-host contract as the HDRI).
|
|
138
|
+
* Captured micro-structure is what reads as real concrete; the procedural
|
|
139
|
+
* generator stays as the offline fallback when these fail to fetch.
|
|
140
|
+
*/
|
|
141
|
+
export declare const DEFAULT_OUTDOOR_CONCRETE_TEXTURES: {
|
|
142
|
+
readonly texture: "https://dl.polyhaven.org/file/ph-assets/Textures/jpg/1k/concrete_floor_02/concrete_floor_02_diff_1k.jpg";
|
|
143
|
+
readonly normalMap: "https://dl.polyhaven.org/file/ph-assets/Textures/jpg/1k/concrete_floor_02/concrete_floor_02_nor_gl_1k.jpg";
|
|
144
|
+
readonly roughnessMap: "https://dl.polyhaven.org/file/ph-assets/Textures/jpg/1k/concrete_floor_02/concrete_floor_02_rough_1k.jpg";
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The daylight HDRI `outdoor_concrete` lights with when no explicit
|
|
149
|
+
* `environment.url` is given: a bright partly-cloudy sky (CC0, Poly Haven;
|
|
150
|
+
* the projection shows its soft open terrain at the horizon), fetched on
|
|
151
|
+
* demand from their CDN — the one network request the outdoor scene makes.
|
|
152
|
+
* Pass your own `environment.url` to override or self-host, exactly like
|
|
153
|
+
* the DRACO/KTX2 decoder paths. (Urban candidates — potsdamer_platz,
|
|
154
|
+
* quarry_01 — were rejected visually: dusk-dark and olive-tinted grounds.)
|
|
155
|
+
*/
|
|
156
|
+
export declare const DEFAULT_OUTDOOR_HDRI_URL = "https://dl.polyhaven.org/file/ph-assets/HDRIs/hdr/2k/kloofendal_48d_partly_cloudy_puresky_2k.hdr";
|
|
157
|
+
|
|
135
158
|
/** The scene every viewer stands in when none is set. */
|
|
136
159
|
export declare const DEFAULT_SCENE: ViewerScene;
|
|
137
160
|
|
|
@@ -211,6 +234,23 @@ export declare interface EnvironmentOptions {
|
|
|
211
234
|
environmentIntensity?: number;
|
|
212
235
|
/** Grade of the built-in studio environment; ignored when `url` is set. */
|
|
213
236
|
studioLook?: StudioLook;
|
|
237
|
+
/**
|
|
238
|
+
* Project the environment map onto a virtual ground plane so the model
|
|
239
|
+
* appears to STAND in the environment instead of floating in front of it —
|
|
240
|
+
* the outdoor scenes' horizon treatment (three's GroundedSkybox). `true`
|
|
241
|
+
* uses the defaults (height 2m — a typical eye-level HDRI shot — and a
|
|
242
|
+
* 120m world radius); pass numbers to match an HDRI shot from another
|
|
243
|
+
* height or a larger set. Only applies when `url` is set. Structural —
|
|
244
|
+
* changing it rebuilds the viewer.
|
|
245
|
+
*
|
|
246
|
+
* While active the projection mesh IS the visible backdrop, so
|
|
247
|
+
* `backgroundBlurriness` has no effect (`backgroundIntensity` is emulated
|
|
248
|
+
* by dimming the projection).
|
|
249
|
+
*/
|
|
250
|
+
groundProjection?: boolean | {
|
|
251
|
+
height?: number;
|
|
252
|
+
radius?: number;
|
|
253
|
+
};
|
|
214
254
|
}
|
|
215
255
|
|
|
216
256
|
export declare enum ErrorCode {
|
|
@@ -251,7 +291,7 @@ export declare interface GridHelperOptions {
|
|
|
251
291
|
divisions?: number;
|
|
252
292
|
colorCenterLine?: string | number;
|
|
253
293
|
colorGrid?: string | number;
|
|
254
|
-
type?: 'shadow_floor' | 'square_wire' | 'hexagonal_wire' | 'hexagonal_glass' | 'stone_tiles';
|
|
294
|
+
type?: 'shadow_floor' | 'concrete_disc' | 'square_wire' | 'hexagonal_wire' | 'hexagonal_glass' | 'stone_tiles';
|
|
255
295
|
opacity?: number;
|
|
256
296
|
styleOptions?: {
|
|
257
297
|
hexRadius?: number;
|
|
@@ -541,6 +581,14 @@ export declare interface SimpleViewerHandle {
|
|
|
541
581
|
captureVideo: (options?: CaptureVideoOptions) => Promise<Blob>;
|
|
542
582
|
/** Clip names of the loaded model, in file order (empty when none). */
|
|
543
583
|
getAnimationNames: () => string[];
|
|
584
|
+
/** KHR_materials_variants names of the loaded model (empty when none). */
|
|
585
|
+
getVariantNames: () => string[];
|
|
586
|
+
/**
|
|
587
|
+
* Switch the loaded model to a material variant; `null` restores the
|
|
588
|
+
* authored materials. Applies live (no reload). Throws `INVALID_PARAMETER`
|
|
589
|
+
* on a variant name the model does not carry.
|
|
590
|
+
*/
|
|
591
|
+
setVariant: (variant: string | null) => void;
|
|
544
592
|
/**
|
|
545
593
|
* Plays one clip by name, or ALL clips when no name is given (looped).
|
|
546
594
|
* Throws `INVALID_PARAMETER` on a clip name the model does not carry.
|
|
@@ -584,6 +632,16 @@ export declare interface SimpleViewerOptions {
|
|
|
584
632
|
* Any other option you pass overrides the scene's values.
|
|
585
633
|
*/
|
|
586
634
|
scene?: ViewerScene;
|
|
635
|
+
/**
|
|
636
|
+
* KHR_materials_variants variant to show (e.g. a product colorway baked
|
|
637
|
+
* into the GLB). Applies LIVE — switching never rebuilds the viewer or
|
|
638
|
+
* reloads the model. `null` shows the authored default materials; leaving
|
|
639
|
+
* the option out is "uncontrolled" (an imperative `handle.setVariant()`
|
|
640
|
+
* pick survives other option changes); an unknown name warns and keeps
|
|
641
|
+
* the defaults. Enumerate the model's variants via
|
|
642
|
+
* `handle.getVariantNames()`.
|
|
643
|
+
*/
|
|
644
|
+
variant?: string | null;
|
|
587
645
|
/**
|
|
588
646
|
* Length unit the model geometry is authored in (default `'meters'`).
|
|
589
647
|
* Non-meter models are rescaled on load — without touching the model's own
|
|
@@ -797,14 +855,6 @@ declare interface Vec3Like {
|
|
|
797
855
|
*/
|
|
798
856
|
export declare const VIEWER_PRESETS: Record<ViewerPreset, Partial<SimpleViewerOptions>>;
|
|
799
857
|
|
|
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
858
|
export declare const VIEWER_SCENES: Record<ViewerScene, Partial<SimpleViewerOptions>>;
|
|
809
859
|
|
|
810
860
|
/**
|
|
@@ -905,9 +955,14 @@ export declare type ViewerPreset = 'studio' | 'product' | 'neutral' | 'dark' | '
|
|
|
905
955
|
* soft contact shadow, crisp contrast-pushed studio environment (distinct
|
|
906
956
|
* highlights on glossy materials) and the path-traced infinity dome.
|
|
907
957
|
* - `studio_soft` — the same set lit softly: the studio environment is used
|
|
908
|
-
* as-built, without the contrast push,
|
|
909
|
-
*
|
|
958
|
+
* as-built, without the contrast push, plus a rebalanced rig (the key steps
|
|
959
|
+
* back, the rim edge nearly goes, the fill opens the shadows) for an even,
|
|
960
|
+
* low-drama read that flatters matte materials.
|
|
961
|
+
* - `outdoor_concrete` — open air: a real daylight HDRI lights the model and
|
|
962
|
+
* paints the sky, standing on a large matte concrete ground disc. The HDRI
|
|
963
|
+
* is fetched from a CDN by default (the one network request this scene
|
|
964
|
+
* makes); pass your own `environment.url` to override or self-host it.
|
|
910
965
|
*/
|
|
911
|
-
export declare type ViewerScene = 'studio_dome' | 'studio_soft';
|
|
966
|
+
export declare type ViewerScene = 'studio_dome' | 'studio_soft' | 'outdoor_concrete';
|
|
912
967
|
|
|
913
968
|
export { }
|
package/dist/index.d.ts
CHANGED
|
@@ -132,6 +132,29 @@ export declare enum ControlType {
|
|
|
132
132
|
OrbitControls = "OrbitControls"
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
/**
|
|
136
|
+
* Photographic PBR maps for the outdoor concrete ground (CC0, Poly Haven;
|
|
137
|
+
* ~600 KB total, same CDN and override/self-host contract as the HDRI).
|
|
138
|
+
* Captured micro-structure is what reads as real concrete; the procedural
|
|
139
|
+
* generator stays as the offline fallback when these fail to fetch.
|
|
140
|
+
*/
|
|
141
|
+
export declare const DEFAULT_OUTDOOR_CONCRETE_TEXTURES: {
|
|
142
|
+
readonly texture: "https://dl.polyhaven.org/file/ph-assets/Textures/jpg/1k/concrete_floor_02/concrete_floor_02_diff_1k.jpg";
|
|
143
|
+
readonly normalMap: "https://dl.polyhaven.org/file/ph-assets/Textures/jpg/1k/concrete_floor_02/concrete_floor_02_nor_gl_1k.jpg";
|
|
144
|
+
readonly roughnessMap: "https://dl.polyhaven.org/file/ph-assets/Textures/jpg/1k/concrete_floor_02/concrete_floor_02_rough_1k.jpg";
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The daylight HDRI `outdoor_concrete` lights with when no explicit
|
|
149
|
+
* `environment.url` is given: a bright partly-cloudy sky (CC0, Poly Haven;
|
|
150
|
+
* the projection shows its soft open terrain at the horizon), fetched on
|
|
151
|
+
* demand from their CDN — the one network request the outdoor scene makes.
|
|
152
|
+
* Pass your own `environment.url` to override or self-host, exactly like
|
|
153
|
+
* the DRACO/KTX2 decoder paths. (Urban candidates — potsdamer_platz,
|
|
154
|
+
* quarry_01 — were rejected visually: dusk-dark and olive-tinted grounds.)
|
|
155
|
+
*/
|
|
156
|
+
export declare const DEFAULT_OUTDOOR_HDRI_URL = "https://dl.polyhaven.org/file/ph-assets/HDRIs/hdr/2k/kloofendal_48d_partly_cloudy_puresky_2k.hdr";
|
|
157
|
+
|
|
135
158
|
/** The scene every viewer stands in when none is set. */
|
|
136
159
|
export declare const DEFAULT_SCENE: ViewerScene;
|
|
137
160
|
|
|
@@ -211,6 +234,23 @@ export declare interface EnvironmentOptions {
|
|
|
211
234
|
environmentIntensity?: number;
|
|
212
235
|
/** Grade of the built-in studio environment; ignored when `url` is set. */
|
|
213
236
|
studioLook?: StudioLook;
|
|
237
|
+
/**
|
|
238
|
+
* Project the environment map onto a virtual ground plane so the model
|
|
239
|
+
* appears to STAND in the environment instead of floating in front of it —
|
|
240
|
+
* the outdoor scenes' horizon treatment (three's GroundedSkybox). `true`
|
|
241
|
+
* uses the defaults (height 2m — a typical eye-level HDRI shot — and a
|
|
242
|
+
* 120m world radius); pass numbers to match an HDRI shot from another
|
|
243
|
+
* height or a larger set. Only applies when `url` is set. Structural —
|
|
244
|
+
* changing it rebuilds the viewer.
|
|
245
|
+
*
|
|
246
|
+
* While active the projection mesh IS the visible backdrop, so
|
|
247
|
+
* `backgroundBlurriness` has no effect (`backgroundIntensity` is emulated
|
|
248
|
+
* by dimming the projection).
|
|
249
|
+
*/
|
|
250
|
+
groundProjection?: boolean | {
|
|
251
|
+
height?: number;
|
|
252
|
+
radius?: number;
|
|
253
|
+
};
|
|
214
254
|
}
|
|
215
255
|
|
|
216
256
|
export declare enum ErrorCode {
|
|
@@ -251,7 +291,7 @@ export declare interface GridHelperOptions {
|
|
|
251
291
|
divisions?: number;
|
|
252
292
|
colorCenterLine?: string | number;
|
|
253
293
|
colorGrid?: string | number;
|
|
254
|
-
type?: 'shadow_floor' | 'square_wire' | 'hexagonal_wire' | 'hexagonal_glass' | 'stone_tiles';
|
|
294
|
+
type?: 'shadow_floor' | 'concrete_disc' | 'square_wire' | 'hexagonal_wire' | 'hexagonal_glass' | 'stone_tiles';
|
|
255
295
|
opacity?: number;
|
|
256
296
|
styleOptions?: {
|
|
257
297
|
hexRadius?: number;
|
|
@@ -541,6 +581,14 @@ export declare interface SimpleViewerHandle {
|
|
|
541
581
|
captureVideo: (options?: CaptureVideoOptions) => Promise<Blob>;
|
|
542
582
|
/** Clip names of the loaded model, in file order (empty when none). */
|
|
543
583
|
getAnimationNames: () => string[];
|
|
584
|
+
/** KHR_materials_variants names of the loaded model (empty when none). */
|
|
585
|
+
getVariantNames: () => string[];
|
|
586
|
+
/**
|
|
587
|
+
* Switch the loaded model to a material variant; `null` restores the
|
|
588
|
+
* authored materials. Applies live (no reload). Throws `INVALID_PARAMETER`
|
|
589
|
+
* on a variant name the model does not carry.
|
|
590
|
+
*/
|
|
591
|
+
setVariant: (variant: string | null) => void;
|
|
544
592
|
/**
|
|
545
593
|
* Plays one clip by name, or ALL clips when no name is given (looped).
|
|
546
594
|
* Throws `INVALID_PARAMETER` on a clip name the model does not carry.
|
|
@@ -584,6 +632,16 @@ export declare interface SimpleViewerOptions {
|
|
|
584
632
|
* Any other option you pass overrides the scene's values.
|
|
585
633
|
*/
|
|
586
634
|
scene?: ViewerScene;
|
|
635
|
+
/**
|
|
636
|
+
* KHR_materials_variants variant to show (e.g. a product colorway baked
|
|
637
|
+
* into the GLB). Applies LIVE — switching never rebuilds the viewer or
|
|
638
|
+
* reloads the model. `null` shows the authored default materials; leaving
|
|
639
|
+
* the option out is "uncontrolled" (an imperative `handle.setVariant()`
|
|
640
|
+
* pick survives other option changes); an unknown name warns and keeps
|
|
641
|
+
* the defaults. Enumerate the model's variants via
|
|
642
|
+
* `handle.getVariantNames()`.
|
|
643
|
+
*/
|
|
644
|
+
variant?: string | null;
|
|
587
645
|
/**
|
|
588
646
|
* Length unit the model geometry is authored in (default `'meters'`).
|
|
589
647
|
* Non-meter models are rescaled on load — without touching the model's own
|
|
@@ -797,14 +855,6 @@ declare interface Vec3Like {
|
|
|
797
855
|
*/
|
|
798
856
|
export declare const VIEWER_PRESETS: Record<ViewerPreset, Partial<SimpleViewerOptions>>;
|
|
799
857
|
|
|
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
858
|
export declare const VIEWER_SCENES: Record<ViewerScene, Partial<SimpleViewerOptions>>;
|
|
809
859
|
|
|
810
860
|
/**
|
|
@@ -905,9 +955,14 @@ export declare type ViewerPreset = 'studio' | 'product' | 'neutral' | 'dark' | '
|
|
|
905
955
|
* soft contact shadow, crisp contrast-pushed studio environment (distinct
|
|
906
956
|
* highlights on glossy materials) and the path-traced infinity dome.
|
|
907
957
|
* - `studio_soft` — the same set lit softly: the studio environment is used
|
|
908
|
-
* as-built, without the contrast push,
|
|
909
|
-
*
|
|
958
|
+
* as-built, without the contrast push, plus a rebalanced rig (the key steps
|
|
959
|
+
* back, the rim edge nearly goes, the fill opens the shadows) for an even,
|
|
960
|
+
* low-drama read that flatters matte materials.
|
|
961
|
+
* - `outdoor_concrete` — open air: a real daylight HDRI lights the model and
|
|
962
|
+
* paints the sky, standing on a large matte concrete ground disc. The HDRI
|
|
963
|
+
* is fetched from a CDN by default (the one network request this scene
|
|
964
|
+
* makes); pass your own `environment.url` to override or self-host it.
|
|
910
965
|
*/
|
|
911
|
-
export declare type ViewerScene = 'studio_dome' | 'studio_soft';
|
|
966
|
+
export declare type ViewerScene = 'studio_dome' | 'studio_soft' | 'outdoor_concrete';
|
|
912
967
|
|
|
913
968
|
export { }
|