three-low-poly 0.9.28 → 1.0.1

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.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { BoxGeometry } from 'three';
2
2
  import { BufferGeometry } from 'three';
3
- import { Color } from 'three';
4
3
  import { ColorRepresentation } from 'three';
5
4
  import { DataTexture } from 'three';
6
5
  import { DirectionalLight } from 'three';
@@ -8,7 +7,6 @@ import { ExtrudeGeometry } from 'three';
8
7
  import { Group } from 'three';
9
8
  import { InstancedMesh } from 'three';
10
9
  import { Material } from 'three';
11
- import { MaterialEventMap } from 'three';
12
10
  import { Mesh } from 'three';
13
11
  import { MeshBasicMaterial } from 'three';
14
12
  import { MeshLambertMaterial } from 'three';
@@ -19,84 +17,15 @@ import { Object3D } from 'three';
19
17
  import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
20
18
  import { ParametricGeometry } from 'three/addons/geometries/ParametricGeometry.js';
21
19
  import { PerspectiveCamera } from 'three';
22
- import { Plane } from 'three';
23
20
  import { PlaneGeometry } from 'three';
24
21
  import { PointLight } from 'three';
25
- import { Points } from 'three';
26
22
  import { Quaternion } from 'three';
27
- import { ShaderMaterial } from 'three';
28
23
  import { Shape } from 'three';
29
24
  import { ShapeGeometry } from 'three';
30
25
  import { SphereGeometry } from 'three';
31
- import * as THREE from 'three';
32
- import { Uniform } from 'three';
33
26
  import { Vector2 } from 'three';
34
27
  import { Vector3 } from 'three';
35
28
 
36
- /**
37
- * Shader modification to support instance-specific colors.
38
- * This function modifies the provided material to accept instance-specific colors.
39
- *
40
- * This is not generally necessary for materials that already support vertex colors,
41
- * but it can be useful for custom materials or when using InstancedMesh.
42
- *
43
- * Instanced meshes already allow for per-instance colors, implemented as:
44
- * ```ts
45
- * const colors = new Float32Array(instancedMesh.count * 3);
46
- * for (let i = 0; i < instancedMesh.count; i++) {
47
- * const [r, g, b] = [Math.random(), Math.random(), Math.random()];
48
- * colors.set([r, g, b], i * 3); // Normalized to [0, 1]
49
- * }
50
- * instancedMesh.instanceColor = new THREE.InstancedBufferAttribute(colors, 3);
51
- * ```
52
- *
53
- * Example usage:
54
- * ```ts
55
- * // Material
56
- * const material = new THREE.MeshStandardMaterial();
57
- *
58
- * // Add instance color modifier
59
- * addInstanceColor(material);
60
- *
61
- * // RGB color for each instance
62
- * const colors = new Float32Array(instancedMesh.count * 3);
63
- * for (let i = 0; i < instancedMesh.count; i++) {
64
- * getAnalogousColors(hue).forEach((color, index) => {
65
- * colors[i * 3 + index] = color / 0xff;
66
- * });
67
- * }
68
- *
69
- * // Add the instance color attribute to the geometry
70
- * instancedMesh.geometry.setAttribute("instanceColor", new THREE.InstancedBufferAttribute(colors, 3));
71
- * ```
72
- */
73
- export declare function addInstanceColor(material: Material): Material< MaterialEventMap>;
74
-
75
- /**
76
- * Utility function to add noise-based vertex displacement to an existing Three.js material.
77
- * @param {Material} material - The material to mutate, e.g., MeshStandardMaterial.
78
- * @param {Object} options - Options for noise modification.
79
- * @param {number} [options.time=0.0] - The time value for the noise function.
80
- * @param {number} [options.intensity=1.0] - The intensity of the displacement.
81
- * @param {Vector3} [options.axis=new Vector3(1, 1, 1)] - The axis of displacement.
82
- * @param {number} [options.scale=10.0] - The scale of the noise effect.
83
- */
84
- export declare function addNoiseDisplacement<T extends Material>(material: T, { time, intensity, axis, scale }?: NoiseDisplacementOptions): void;
85
-
86
- /**
87
- * Utility function to add water-like vertex displacement to an existing Three.js material.
88
- * @param {Material} material - The material to mutate, e.g., MeshStandardMaterial.
89
- * @param {Object} options - Options for water wave modification.
90
- * @param {number} [options.time=0.0] - The time value for the wave function.
91
- * @param {number} [options.waveFrequency=0.2] - The frequency of the water waves.
92
- * @param {number} [options.waveAmplitude=0.5] - The amplitude of the water waves.
93
- */
94
- export declare function addWaterDisplacement<T extends Material>(material: T, { time, waveFrequency, waveAmplitude }?: {
95
- time?: number | undefined;
96
- waveFrequency?: number | undefined;
97
- waveAmplitude?: number | undefined;
98
- }): void;
99
-
100
29
  /**
101
30
  * Align a BufferGeometry to a surface by adjusting its vertices.
102
31
  */
@@ -288,105 +217,6 @@ declare interface ArchedOutlineTarget {
288
217
  closePath(): unknown;
289
218
  }
290
219
 
291
- /**
292
- * Atmospheric scattering shader.
293
- *
294
- * Based on "A Practical Analytic Model for Daylight"
295
- * aka The Preetham Model, the de facto standard analytic skydome model
296
- * https://www.researchgate.net/publication/220720443_A_Practical_Analytic_Model_for_Daylight
297
- *
298
- * First implemented by Simon Wallner
299
- * http://simonwallner.at/project/atmospheric-scattering/
300
- *
301
- * Improved by Martin Upitis
302
- * http://blenderartists.org/forum/showthread.php?245954-preethams-sky-impementation-HDR
303
- *
304
- * Three.js integration by zz85 http://twitter.com/blurspline
305
- *
306
- * Example:
307
- * ```
308
- * const geometry = new BoxGeometry(1, 1, 1);
309
- *
310
- * const material = new ShaderMaterial({
311
- * uniforms: atmosphericShader.uniforms,
312
- * vertexShader: atmosphericShader.vertexShader,
313
- * fragmentShader: atmosphericShader.fragmentShader,
314
- * depthWrite: false,
315
- * side: BackSide,
316
- * }) as ShaderMaterial & { uniforms: AtmosphericShaderUniforms };
317
- *
318
- * const theta = MathUtils.degToRad(89);
319
- * const phi = MathUtils.degToRad(180);
320
- * const sun = new Vector3().setFromSphericalCoords(1, theta, phi);
321
- *
322
- * material.uniforms.sunPosition.value = sun;
323
- *
324
- * const mesh = new Mesh(geometry, material);
325
- * mesh.scale.setScalar(450000);
326
- * ```
327
- */
328
- export declare const atmosphericShader: {
329
- uniforms: {
330
- turbidity: {
331
- value: number;
332
- };
333
- rayleigh: {
334
- value: number;
335
- };
336
- mieCoefficient: {
337
- value: number;
338
- };
339
- mieDirectionalG: {
340
- value: number;
341
- };
342
- sunPosition: {
343
- value: Vector3;
344
- };
345
- up: {
346
- value: Vector3;
347
- };
348
- };
349
- vertexShader: string;
350
- fragmentShader: string;
351
- };
352
-
353
- export declare interface AtmosphericShaderUniforms {
354
- turbidity: Uniform<number>;
355
- rayleigh: Uniform<number>;
356
- mieCoefficient: Uniform<number>;
357
- mieDirectionalG: Uniform<number>;
358
- sunPosition: Uniform<Vector3>;
359
- up: Uniform<Vector3>;
360
- }
361
-
362
- /**
363
- * Atmospheric scattering skybox.
364
- *
365
- * Elevation (theta, θ): Angle measured above or below the horizon (from the xy-plane towards the zenith or nadir).
366
- * Azimuth (phi, φ): Angle measured around the horizon from a reference direction (e.g., north, east).
367
- */
368
- export declare class AtmosphericSkybox extends Mesh {
369
- geometry: BoxGeometry;
370
- material: ShaderMaterial & {
371
- uniforms: AtmosphericShaderUniforms;
372
- };
373
- constructor();
374
- /**
375
- * Set the sun position.
376
- *
377
- * Elevation (theta, θ)
378
- * - Angle measured above or below the horizon (from the xy-plane towards the zenith or nadir).
379
- * - Ranges from 0 to π/2 radians (or 0 to 90 degrees).
380
- * - This is the vertical angle in the xy-plane.
381
- *
382
- * Azimuth (phi, φ)
383
- * - Angle measured around the horizon from a reference direction (e.g., north, east).
384
- * - Ranges from 0 to 2π radians (or 0 to 360 degrees).
385
- * - This is the horizontal angle in the xy-plane.
386
- */
387
- sunPosition(theta: number, phi: number): void;
388
- }
389
-
390
220
  /**
391
221
  * Geometric and mathematical role of the vectors as axes in 3D space.
392
222
  *
@@ -514,31 +344,6 @@ export declare const Axis: {
514
344
  XYZ: Vector3;
515
345
  };
516
346
 
517
- declare interface BloomTransitionOptions extends SceneTransitionFXOptions {
518
- maxBloom?: number;
519
- }
520
-
521
- declare interface BlurTransitionOptions extends SceneTransitionFXOptions {
522
- maxBlur?: number;
523
- kernelSize?: number;
524
- }
525
-
526
- export declare const blurTransitionShader: {
527
- uniforms: {
528
- tDiffuse: {
529
- value: null;
530
- };
531
- kernelSize: {
532
- value: number;
533
- };
534
- resolution: {
535
- value: null;
536
- };
537
- };
538
- vertexShader: string;
539
- fragmentShader: string;
540
- };
541
-
542
347
  export declare class Bone extends Mesh<BoneGeometry, MeshStandardMaterial> {
543
348
  constructor();
544
349
  }
@@ -738,9 +543,6 @@ export declare function buildDiamondLatticeParts({ width, height, centerY, grid,
738
543
  */
739
544
  export declare function buildGregorianLatticeParts({ width, height, centerY, cellsX, cellsY, mullionThickness: barT, mullionDepth: barD, }: GregorianLatticePartOptions): BoxGeometry[];
740
545
 
741
- /** Outer frame bars — shared topology across lattice window openings. */
742
- export declare function buildRingLatticeFrameParts({ width, height, centerY, frameThickness: barT, frameDepth: barD, }: RingLatticeFramePartOptions): BoxGeometry[];
743
-
744
546
  export declare class BunsenBurner extends Group {
745
547
  constructor();
746
548
  }
@@ -914,87 +716,6 @@ export declare interface CameraSnapshot {
914
716
  target: Vector3;
915
717
  }
916
718
 
917
- /**
918
- * CameraTransition provides smooth animated transitions between perspective and orthographic cameras.
919
- *
920
- * The transition works by rendering both camera views to separate render targets and blending between them.
921
- * This provides a true, accurate transition between the two camera types.
922
- *
923
- * @example
924
- * ```typescript
925
- * const transition = new CameraTransition(
926
- * perspectiveCamera,
927
- * orthographicCamera,
928
- * renderer
929
- * );
930
- *
931
- * transition.transitionTo(orthographicCamera, {
932
- * duration: 1000,
933
- * easing: 'easeInOutCubic'
934
- * });
935
- * ```
936
- */
937
- export declare class CameraTransition {
938
- private perspectiveCamera;
939
- private orthographicCamera;
940
- private renderer;
941
- private scene;
942
- private currentCamera;
943
- private targetCamera;
944
- private transitionProgress;
945
- private transitionDuration;
946
- private transitionStartTime;
947
- private isTransitioning;
948
- private easingFunction;
949
- private renderTargetA;
950
- private renderTargetB;
951
- private blendScene;
952
- private blendCamera;
953
- private blendMaterial;
954
- private onUpdateCallback?;
955
- private onCompleteCallback?;
956
- constructor(perspectiveCamera: THREE.PerspectiveCamera, orthographicCamera: THREE.OrthographicCamera, renderer: THREE.WebGLRenderer);
957
- /**
958
- * Start a transition to the target camera
959
- */
960
- transitionTo(targetCamera: THREE.PerspectiveCamera | THREE.OrthographicCamera, options?: CameraTransitionOptions): void;
961
- /**
962
- * Update the transition. Call this in your render loop.
963
- */
964
- update(scene: THREE.Scene): THREE.Camera;
965
- /**
966
- * Render the scene with camera transition blending
967
- */
968
- render(scene: THREE.Scene): void;
969
- /**
970
- * Get the current active camera
971
- */
972
- getCurrentCamera(): THREE.Camera;
973
- /**
974
- * Check if a transition is currently in progress
975
- */
976
- getIsTransitioning(): boolean;
977
- /**
978
- * Get the current transition progress (0-1)
979
- */
980
- getProgress(): number;
981
- /**
982
- * Resize the render targets when the renderer size changes
983
- */
984
- setSize(width: number, height: number): void;
985
- /**
986
- * Dispose of resources
987
- */
988
- dispose(): void;
989
- }
990
-
991
- export declare interface CameraTransitionOptions {
992
- duration?: number;
993
- easing?: EasingFunction | keyof typeof Easing;
994
- onUpdate?: (progress: number) => void;
995
- onComplete?: () => void;
996
- }
997
-
998
719
  /**
999
720
  * Candle prefab — wax stick and emissive flame (separate material groups).
1000
721
  */
@@ -1328,12 +1049,6 @@ export declare function createHexagonalTilesByRadius(options: HexagonalTileRadiu
1328
1049
  */
1329
1050
  export declare const createLogarithmicCurvePoints: (start: Vector2, end: Vector2, base: number, factor: number, segments?: number) => Vector2[];
1330
1051
 
1331
- /**
1332
- * Four clipping planes for a rectangular opening (shadow + mesh clip).
1333
- * Fragments are discarded when `dot(normal, position) > constant`.
1334
- */
1335
- export declare function createOpeningClippingPlanes(width: number, height: number, centerY?: number): Plane[];
1336
-
1337
1052
  /** Circle the scene — showcase reel orbit. */
1338
1053
  export declare function createOrbitClip(options: OrbitClipOptions): CameraClip;
1339
1054
 
@@ -1440,9 +1155,6 @@ export declare const createQuadraticCurvePoints: (start: Vector2, control: Vecto
1440
1155
  */
1441
1156
  export declare function createRandom(seed?: number): RandomSource;
1442
1157
 
1443
- /** Hollow square profile extruded for one lattice ring (local XY, facing +Z). */
1444
- export declare function createRingLatticeGeometry(outer: number, wall: number, depth: number): ExtrudeGeometry;
1445
-
1446
1158
  /**
1447
1159
  * Function to create sigmoid curve points
1448
1160
  *
@@ -1476,22 +1188,6 @@ export declare function createWobbleClip(options: WobbleClipOptions): CameraClip
1476
1188
  /** Focus punch — smooth FOV narrow toward a target. Restores FOV on cancel; keeps end FOV on complete. */
1477
1189
  export declare function createZoomClip(options: ZoomClipOptions): CameraClip;
1478
1190
 
1479
- export declare const crossfadeShader: {
1480
- uniforms: {
1481
- tDiffuseA: {
1482
- value: null;
1483
- };
1484
- tDiffuseB: {
1485
- value: null;
1486
- };
1487
- mixRatio: {
1488
- value: number;
1489
- };
1490
- };
1491
- vertexShader: string;
1492
- fragmentShader: string;
1493
- };
1494
-
1495
1191
  /**
1496
1192
  * Cross headstone prefab.
1497
1193
  */
@@ -1568,45 +1264,6 @@ export declare function cubicUVMappingBatch(vertices: [number, number, number][]
1568
1264
  */
1569
1265
  export declare function cylindricalUVMapping(vertices: [number, number, number][]): [number, number][];
1570
1266
 
1571
- export declare class DaySkybox extends Mesh {
1572
- geometry: BoxGeometry;
1573
- material: ShaderMaterial & {
1574
- uniforms: DaySkyUniforms;
1575
- };
1576
- constructor(size?: number);
1577
- }
1578
-
1579
- /**
1580
- * Shader for a day skybox.
1581
- *
1582
- * Example:
1583
- * ```
1584
- * this.material = new ShaderMaterial({
1585
- * uniforms: daySkyShader.uniforms,
1586
- * vertexShader: daySkyShader.vertexShader,
1587
- * fragmentShader: daySkyShader.fragmentShader,
1588
- * side: BackSide,
1589
- * }) as ShaderMaterial & { uniforms: DaySkyUniforms };
1590
- * ```
1591
- */
1592
- export declare const daySkyShader: {
1593
- uniforms: {
1594
- topColor: {
1595
- value: Color;
1596
- };
1597
- bottomColor: {
1598
- value: Color;
1599
- };
1600
- };
1601
- vertexShader: string;
1602
- fragmentShader: string;
1603
- };
1604
-
1605
- export declare interface DaySkyUniforms {
1606
- topColor: Uniform<Color>;
1607
- bottomColor: Uniform<Color>;
1608
- }
1609
-
1610
1267
  /**
1611
1268
  * Derive an independent sub-stream seed from a master seed and domain salt.
1612
1269
  *
@@ -2164,49 +1821,6 @@ export declare interface ErlenmeyerFlaskOptions extends ErlenmeyerFlaskGeometryO
2164
1821
  opacity?: number;
2165
1822
  }
2166
1823
 
2167
- export declare const fadeShader: {
2168
- uniforms: {
2169
- tDiffuse: {
2170
- value: null;
2171
- };
2172
- fadeAmount: {
2173
- value: number;
2174
- };
2175
- fadeColor: {
2176
- value: null;
2177
- };
2178
- };
2179
- vertexShader: string;
2180
- fragmentShader: string;
2181
- };
2182
-
2183
- declare interface FadeTransitionOptions extends SceneTransitionOptions {
2184
- color?: THREE.ColorRepresentation;
2185
- }
2186
-
2187
- declare interface FadeTransitionOptions_2 extends SceneTransitionFXOptions {
2188
- color?: THREE.ColorRepresentation;
2189
- }
2190
-
2191
- export declare const fadeTransitionSceneShader: {
2192
- uniforms: {
2193
- tDiffuseA: {
2194
- value: null;
2195
- };
2196
- tDiffuseB: {
2197
- value: null;
2198
- };
2199
- mixRatio: {
2200
- value: number;
2201
- };
2202
- fadeColor: {
2203
- value: null;
2204
- };
2205
- };
2206
- vertexShader: string;
2207
- fragmentShader: string;
2208
- };
2209
-
2210
1824
  export declare const Falloff: {
2211
1825
  linear: (distance: number, radius: number) => number;
2212
1826
  quadratic: (distance: number, radius: number) => number;
@@ -2404,10 +2018,6 @@ export declare class GearShape extends Shape {
2404
2018
  */
2405
2019
  export declare function getAnalogousColors(baseHue: number): [number, number, number];
2406
2020
 
2407
- declare interface GlitchTransitionOptions extends SceneTransitionFXOptions {
2408
- maxIntensity?: number;
2409
- }
2410
-
2411
2021
  /**
2412
2022
  * Soft additive glow billboard — reads as light without a {@link PointLight}.
2413
2023
  * Pair with {@link FlameFlickerEffect} for organic pulse, or use alone for
@@ -3136,65 +2746,11 @@ export declare interface MossyRockOptions extends MossyRockGeometryOptions {
3136
2746
  */
3137
2747
  export declare function mulberry32(seed: number): RandomStream;
3138
2748
 
3139
- export declare class NightSkybox extends Mesh {
3140
- geometry: SphereGeometry;
3141
- material: ShaderMaterial & {
3142
- uniforms: NightSkyUniforms;
3143
- };
3144
- constructor(size?: number);
3145
- }
3146
-
3147
- /**
3148
- * Shader for a night skybox.
3149
- *
3150
- * Example:
3151
- * ```
3152
- * this.material = new ShaderMaterial({
3153
- * vertexShader: nightSkyShader.vertexShader,
3154
- * fragmentShader: nightSkyShader.fragmentShader,
3155
- * uniforms: nightSkyShader.uniforms,
3156
- * side: BackSide,
3157
- * }) as ShaderMaterial & { uniforms: NightSkyUniforms };
3158
- * ```
3159
- */
3160
- export declare const nightSkyShader: {
3161
- uniforms: {
3162
- topColor: {
3163
- value: Color;
3164
- };
3165
- bottomColor: {
3166
- value: Color;
3167
- };
3168
- offset: {
3169
- value: number;
3170
- };
3171
- exponent: {
3172
- value: number;
3173
- };
3174
- };
3175
- vertexShader: string;
3176
- fragmentShader: string;
3177
- };
3178
-
3179
- export declare interface NightSkyUniforms {
3180
- topColor: Uniform<Color>;
3181
- bottomColor: Uniform<Color>;
3182
- offset: Uniform<number>;
3183
- exponent: Uniform<number>;
3184
- }
3185
-
3186
2749
  /**
3187
2750
  * Adds random noise to the vertices within the specified radius to create a more rugged or natural look.
3188
2751
  */
3189
2752
  export declare const noiseBrush: <T extends BufferGeometry>(geometry: T, position: Vector3, radius: number, strength: number, direction?: Vector3, falloffFn?: (distance: number, radius: number) => number) => void;
3190
2753
 
3191
- declare interface NoiseDisplacementOptions {
3192
- time?: number;
3193
- intensity?: number;
3194
- axis?: Vector3;
3195
- scale?: number;
3196
- }
3197
-
3198
2754
  export declare function normalizeRgb(r: number, g: number, b: number): [number, number, number];
3199
2755
 
3200
2756
  /**
@@ -3714,9 +3270,6 @@ export declare type RandomStream = () => number;
3714
3270
 
3715
3271
  export declare function randomTransformVertices<T extends BufferGeometry>(geometry: T, axis?: Vector3, minScale?: number, maxScale?: number): T;
3716
3272
 
3717
- /** Resolve uniform ring spacing — `cell` wins over the `cellsX` density hint. */
3718
- export declare function resolveRingLatticeCell(width: number, _height: number, cell?: number, cellsX?: number): number;
3719
-
3720
3273
  export declare function rgbToHex(r: number, g: number, b: number): number;
3721
3274
 
3722
3275
  /**
@@ -3731,84 +3284,6 @@ export declare function rgbToHex(r: number, g: number, b: number): number;
3731
3284
  */
3732
3285
  export declare function rgbToHsl(r: number, g: number, b: number): [number, number, number];
3733
3286
 
3734
- /** Ring-spacing factor — overlap tightens as this approaches 1. */
3735
- export declare const RING_LATTICE_SPACING_FACTOR = 0.96;
3736
-
3737
- declare interface RingLatticeFramePartOptions {
3738
- width: number;
3739
- height: number;
3740
- centerY?: number;
3741
- frameThickness: number;
3742
- frameDepth: number;
3743
- }
3744
-
3745
- export declare interface RingLatticeGrid {
3746
- /** Requested ring-center spacing before the overlap factor. */
3747
- cell: number;
3748
- /** Effective center spacing (`cell × 0.96`). */
3749
- latticeCell: number;
3750
- /** Outer half-extent of each square ring profile. */
3751
- ringOuter: number;
3752
- /** Ring instance count. */
3753
- count: number;
3754
- }
3755
-
3756
- declare interface RingLatticeSpotOptions {
3757
- width: number;
3758
- height: number;
3759
- centerY?: number;
3760
- cell: number;
3761
- }
3762
-
3763
- /** Ring-center positions overscanning the opening (stencil trims the excess). */
3764
- export declare function ringLatticeSpots({ width, height, centerY, cell, }: RingLatticeSpotOptions): {
3765
- spots: [number, number][];
3766
- grid: RingLatticeGrid;
3767
- };
3768
-
3769
- /**
3770
- * Ring lattice window — overlapping square rings on a uniform grid (diaper /
3771
- * trellis fretwork), stencil-clipped to a rectangular opening.
3772
- */
3773
- export declare class RingLatticeWindow extends Group {
3774
- readonly lattice: InstancedMesh;
3775
- readonly frame: Mesh;
3776
- readonly glass?: Mesh<PlaneGeometry, MeshPhysicalMaterial>;
3777
- readonly cell: number;
3778
- readonly fittedGrid: RingLatticeGrid;
3779
- private readonly clipPlanesLocal;
3780
- private readonly clipPlanesWorld;
3781
- constructor({ width, height, cell: cellOption, cellsX, centerY, ringThickness, ringDepth, frameThickness, frameDepth, latticeColor, glass, glassColor, glassEmissive, glassEmissiveIntensity, }?: RingLatticeWindowOptions);
3782
- }
3783
-
3784
- declare interface RingLatticeWindowOptions {
3785
- /** Opening width (world units). */
3786
- width?: number;
3787
- /** Opening height (world units). */
3788
- height?: number;
3789
- /** Uniform ring-center spacing. Overrides `cellsX` when set. Defaults to `0.55`. */
3790
- cell?: number;
3791
- /** Density hint — `cell = width / cellsX` when `cell` is omitted. */
3792
- cellsX?: number;
3793
- /** Wall thickness of each square ring profile. Defaults to `0.05`. */
3794
- ringThickness?: number;
3795
- /** Extrusion depth of each ring. Defaults to `0.06`. */
3796
- ringDepth?: number;
3797
- /** Outer frame bar thickness. Defaults to `0.055`. */
3798
- frameThickness?: number;
3799
- /** Outer frame depth (Z). Defaults to `0.11`. */
3800
- frameDepth?: number;
3801
- /** Vertical center of the opening in local space. Defaults to `0`. */
3802
- centerY?: number;
3803
- /** Lattice + frame tint. Defaults to `#0c0f14`. */
3804
- latticeColor?: ColorRepresentation;
3805
- /** Optional glass pane recessed slightly on −Z. */
3806
- glass?: boolean;
3807
- glassColor?: ColorRepresentation;
3808
- glassEmissive?: ColorRepresentation;
3809
- glassEmissiveIntensity?: number;
3810
- }
3811
-
3812
3287
  /**
3813
3288
  * Single rock prefab — noisy sphere mesh.
3814
3289
  */
@@ -3996,256 +3471,6 @@ export declare interface ScatterRocksOptions extends RockScatterPlacementOptions
3996
3471
  color?: ColorRepresentation;
3997
3472
  }
3998
3473
 
3999
- /**
4000
- * SceneTransition provides smooth animated transitions between Three.js scenes.
4001
- *
4002
- * Supports multiple transition types:
4003
- * - Fade: Fade to a color (black, white, etc.) and back
4004
- * - Crossfade: Directly blend from one scene to another
4005
- * - Blur: Blur out the first scene and blur in the second
4006
- *
4007
- * @example
4008
- * ```typescript
4009
- * const sceneTransition = new SceneTransition(renderer);
4010
- *
4011
- * // Fade to black transition
4012
- * sceneTransition.fade(sceneA, sceneB, camera, {
4013
- * duration: 1000,
4014
- * color: 0x000000,
4015
- * easing: 'easeInOutCubic'
4016
- * });
4017
- *
4018
- * // Direct crossfade
4019
- * sceneTransition.crossfade(sceneA, sceneB, camera, {
4020
- * duration: 1500
4021
- * });
4022
- * ```
4023
- */
4024
- export declare class SceneTransition {
4025
- private renderer;
4026
- private currentScene;
4027
- private targetScene;
4028
- private camera;
4029
- private transitionProgress;
4030
- private transitionDuration;
4031
- private transitionStartTime;
4032
- private isTransitioning;
4033
- private transitionType;
4034
- private easingFunction;
4035
- private renderTargetA;
4036
- private renderTargetB;
4037
- private blendScene;
4038
- private blendCamera;
4039
- private fadeMaterial;
4040
- private crossfadeMaterial;
4041
- private fadeColor;
4042
- private onUpdateCallback?;
4043
- private onCompleteCallback?;
4044
- constructor(renderer: THREE.WebGLRenderer);
4045
- /**
4046
- * Fade transition: Fades to a color and then fades in the new scene
4047
- */
4048
- fade(fromScene: THREE.Scene, toScene: THREE.Scene, camera: THREE.Camera, options?: FadeTransitionOptions): void;
4049
- /**
4050
- * Crossfade transition: Directly blends from one scene to another
4051
- */
4052
- crossfade(fromScene: THREE.Scene, toScene: THREE.Scene, camera: THREE.Camera, options?: SceneTransitionOptions): void;
4053
- /**
4054
- * Blur transition: Blurs out first scene, then blurs in second scene
4055
- * Note: This uses the fade material with a neutral gray for a blur-like effect
4056
- * For true blur, you'd need post-processing passes
4057
- */
4058
- blur(fromScene: THREE.Scene, toScene: THREE.Scene, camera: THREE.Camera, options?: SceneTransitionOptions): void;
4059
- /**
4060
- * Internal method to start a transition
4061
- */
4062
- private startTransition;
4063
- /**
4064
- * Update the transition. Call this in your render loop.
4065
- */
4066
- update(): void;
4067
- /**
4068
- * Render the scene with transition blending
4069
- */
4070
- render(): void;
4071
- /**
4072
- * Get the current active scene
4073
- */
4074
- getCurrentScene(): THREE.Scene | null;
4075
- /**
4076
- * Check if a transition is currently in progress
4077
- */
4078
- getIsTransitioning(): boolean;
4079
- /**
4080
- * Get the current transition progress (0-1)
4081
- */
4082
- getProgress(): number;
4083
- /**
4084
- * Set the current scene (useful for initialization)
4085
- */
4086
- setCurrentScene(scene: THREE.Scene): void;
4087
- /**
4088
- * Resize the render targets when the renderer size changes
4089
- */
4090
- setSize(width: number, height: number): void;
4091
- /**
4092
- * Dispose of resources
4093
- */
4094
- dispose(): void;
4095
- }
4096
-
4097
- /**
4098
- * SceneTransitionFX provides advanced post-processing transitions between Three.js scenes.
4099
- *
4100
- * Uses EffectComposer for sophisticated visual effects:
4101
- * - Bloom: Bright bloom effect that peaks at transition midpoint, washing out to white
4102
- * - Blur: Progressive blur effect that peaks at midpoint, blurring scenes to oblivion
4103
- * - Fade: Classic fade through a color (black, white, or custom)
4104
- * - Glitch: Digital distortion/glitch effect with heavy artifacts
4105
- *
4106
- * Built-in shader passes for blur and fade are automatically created. For bloom and glitch
4107
- * effects, you'll need to provide those passes manually.
4108
- *
4109
- * Note: Requires post-processing imports from three/addons
4110
- *
4111
- * @example
4112
- * ```typescript
4113
- * import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js';
4114
- * import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';
4115
- * import { UnrealBloomPass } from 'three/addons/postprocessing/UnrealBloomPass.js';
4116
- * import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js';
4117
- *
4118
- * const composer = new EffectComposer(renderer);
4119
- * const renderPass = new RenderPass(sceneA, camera);
4120
- * composer.addPass(renderPass);
4121
- *
4122
- * // Pass ShaderPass to enable built-in blur and fade effects
4123
- * const sceneTransitionFX = new SceneTransitionFX(renderer, composer, ShaderPass);
4124
- *
4125
- * // Blur and fade transitions work out of the box
4126
- * sceneTransitionFX.blur(sceneA, sceneB, camera, { duration: 2000 });
4127
- * sceneTransitionFX.fade(sceneA, sceneB, camera, { duration: 2000, color: 0x000000 });
4128
- *
4129
- * // For bloom, provide the pass manually
4130
- * const bloomPass = new UnrealBloomPass(new THREE.Vector2(width, height), 0, 0.4, 0.85);
4131
- * bloomPass.enabled = false;
4132
- * composer.addPass(bloomPass);
4133
- * sceneTransitionFX.setBloomPass(bloomPass);
4134
- * sceneTransitionFX.bloom(sceneA, sceneB, camera, { duration: 2000, maxBloom: 15.0 });
4135
- * ```
4136
- */
4137
- export declare class SceneTransitionFX {
4138
- private renderer;
4139
- private composer;
4140
- private currentScene;
4141
- private targetScene;
4142
- private camera;
4143
- private transitionProgress;
4144
- private transitionDuration;
4145
- private transitionStartTime;
4146
- private isTransitioning;
4147
- private transitionType;
4148
- private easingFunction;
4149
- private renderPass;
4150
- private bloomPass;
4151
- private glitchPass;
4152
- private blurPass;
4153
- private fadePass;
4154
- private maxBloomStrength;
4155
- private maxBlurAmount;
4156
- private maxGlitchIntensity;
4157
- private fadeColor;
4158
- private onUpdateCallback?;
4159
- private onCompleteCallback?;
4160
- constructor(renderer: THREE.WebGLRenderer, composer: any, ShaderPass?: any);
4161
- /**
4162
- * Create default shader passes for blur and fade effects
4163
- */
4164
- private createDefaultPasses;
4165
- /**
4166
- * Set the bloom pass for bloom transitions
4167
- */
4168
- setBloomPass(bloomPass: any): void;
4169
- /**
4170
- * Set the glitch pass for glitch transitions
4171
- */
4172
- setGlitchPass(glitchPass: any): void;
4173
- /**
4174
- * Set the blur pass for blur transitions
4175
- */
4176
- setBlurPass(blurPass: any): void;
4177
- /**
4178
- * Set the fade pass for fade transitions
4179
- */
4180
- setFadePass(fadePass: any): void;
4181
- /**
4182
- * Bloom transition: Bright bloom effect that peaks at transition midpoint
4183
- */
4184
- bloom(fromScene: THREE.Scene, toScene: THREE.Scene, camera: THREE.Camera, options?: BloomTransitionOptions): void;
4185
- /**
4186
- * Blur transition: Progressively blur scenes to oblivion and back
4187
- */
4188
- blur(fromScene: THREE.Scene, toScene: THREE.Scene, camera: THREE.Camera, options?: BlurTransitionOptions): void;
4189
- /**
4190
- * Fade transition: Classic fade through a color (black, white, or custom)
4191
- */
4192
- fade(fromScene: THREE.Scene, toScene: THREE.Scene, camera: THREE.Camera, options?: FadeTransitionOptions_2): void;
4193
- /**
4194
- * Glitch transition: Digital distortion effect
4195
- */
4196
- glitch(fromScene: THREE.Scene, toScene: THREE.Scene, camera: THREE.Camera, options?: GlitchTransitionOptions): void;
4197
- /**
4198
- * Internal method to start a transition
4199
- */
4200
- private startTransition;
4201
- /**
4202
- * Update the transition. Call this in your render loop.
4203
- */
4204
- update(): void;
4205
- /**
4206
- * Render using the effect composer
4207
- */
4208
- render(): void;
4209
- /**
4210
- * Get the current active scene
4211
- */
4212
- getCurrentScene(): THREE.Scene | null;
4213
- /**
4214
- * Check if a transition is currently in progress
4215
- */
4216
- getIsTransitioning(): boolean;
4217
- /**
4218
- * Get the current transition progress (0-1)
4219
- */
4220
- getProgress(): number;
4221
- /**
4222
- * Set the current scene (useful for initialization)
4223
- */
4224
- setCurrentScene(scene: THREE.Scene): void;
4225
- /**
4226
- * Resize the composer when the renderer size changes
4227
- */
4228
- setSize(width: number, height: number): void;
4229
- /**
4230
- * Dispose of resources
4231
- */
4232
- dispose(): void;
4233
- }
4234
-
4235
- export declare interface SceneTransitionFXOptions {
4236
- duration?: number;
4237
- easing?: EasingFunction | keyof typeof Easing;
4238
- onUpdate?: (progress: number) => void;
4239
- onComplete?: () => void;
4240
- }
4241
-
4242
- export declare interface SceneTransitionOptions {
4243
- duration?: number;
4244
- easing?: EasingFunction | keyof typeof Easing;
4245
- onUpdate?: (progress: number) => void;
4246
- onComplete?: () => void;
4247
- }
4248
-
4249
3474
  /**
4250
3475
  * Set a random interval that will call the callback function with a random delay between minDelay and maxDelay.
4251
3476
  *
@@ -4538,11 +3763,11 @@ export declare class Star extends Mesh<StarGeometry, MeshStandardMaterial> {
4538
3763
  }
4539
3764
 
4540
3765
  export declare interface StarBurstShapeOptions {
4541
- /** Burst ray count. Defaults to `4`. */
3766
+ /** Burst ray count. Defaults to `4` point diffraction spike. */
4542
3767
  sides?: number;
4543
3768
  innerRadius?: number;
4544
3769
  outerRadius?: number;
4545
- /** Extrusion depth; keep small for flat starbursts. Defaults to `0.05`. */
3770
+ /** Extrusion depth (`orientation: "radial"` only — billboards are flat). Defaults to `0.05`. */
4546
3771
  depth?: number;
4547
3772
  }
4548
3773
 
@@ -4554,27 +3779,27 @@ export declare interface StarBurstShapeOptions {
4554
3779
  * every frame. Parenting to the camera is not supported: Three.js does not render
4555
3780
  * objects attached to the active camera.
4556
3781
  *
4557
- * **Styles**
3782
+ * **Orientation** — the only axis that distinguishes how stars are drawn:
3783
+ *
3784
+ * - `billboard` — screen-aligned via `SpriteNodeMaterial`, with per-star position, scale,
3785
+ * and rotation supplied as instanced attributes. The field stays visually fixed as the
3786
+ * camera orbits. Flat by construction: only the geometry's XY profile is used.
3787
+ * - `radial` — instanced 3D meshes rotated to face the shell center, drawn `DoubleSide` so
3788
+ * stars stay visible from inside the shell.
4558
3789
  *
4559
- * - `points` lightweight `Points` sprites using a canvas starburst texture.
4560
- * - `burst` instanced 3D starbursts ({@link BurstGeometry}) that face the shell center.
4561
- * Uses `DoubleSide` so stars remain visible when the camera sits inside the shell.
3790
+ * Both orientations render as a single instanced draw call, so the geometry you pass is a
3791
+ * matter of looks rather than cost.
4562
3792
  *
4563
3793
  * **Sizing** — `sizeMin` / `sizeMax` are angular extents (radians at unit distance),
4564
3794
  * multiplied by each star's distance from the origin so stars look similar regardless
4565
3795
  * of shell depth (`minRadius`–`maxRadius`).
4566
3796
  *
4567
- * **Rendering** — `frustumCulled` is disabled and materials use `depthWrite: false` so
4568
- * the field draws reliably as a background layer. For per-star color variation in burst
4569
- * mode, colors are written via `InstancedMesh.setColorAt`, not `vertexColors` on the
4570
- * base material.
4571
- *
4572
3797
  * @example
4573
3798
  * ```typescript
4574
3799
  * const stars = new StarFieldEffect({
4575
- * style: "burst",
4576
3800
  * count: 2500,
4577
3801
  * radius: 480,
3802
+ * rotationJitter: 0, // every burst locked vertical on screen
4578
3803
  * twinkle: true,
4579
3804
  * });
4580
3805
  *
@@ -4587,52 +3812,61 @@ export declare interface StarBurstShapeOptions {
4587
3812
  * }
4588
3813
  * ```
4589
3814
  *
4590
- * Call {@link dispose} when removing the effect to free geometry, materials, and the
4591
- * points sprite texture.
3815
+ * Call {@link dispose} when removing the effect to free geometry and materials.
4592
3816
  */
4593
3817
  export declare class StarFieldEffect extends Object3D {
4594
- readonly style: "points" | "burst";
3818
+ readonly orientation: StarFieldOrientation;
4595
3819
  private readonly field;
4596
3820
  private readonly twinkle;
4597
- private readonly baseSize;
4598
3821
  private readonly baseScales?;
4599
3822
  private readonly twinklePhases?;
4600
- /** Untwinkled per-point RGB (points style), multiplied by each star's pulse each frame. */
4601
- private baseColors?;
4602
- private spriteTexture?;
3823
+ /** Billboard scale attribute, rewritten each frame while twinkling. */
3824
+ private scaleAttribute?;
4603
3825
  private readonly dummy;
4604
3826
  constructor(options?: StarFieldEffectOptions);
4605
- get drawable(): Points | InstancedMesh;
3827
+ get mesh(): InstancedMesh;
4606
3828
  get geometry(): BufferGeometry;
4607
3829
  get material(): Material | Material[];
4608
- /** Release GPU resources held by the field (and sprite texture, if any). */
3830
+ /** Release GPU resources held by the field. */
4609
3831
  dispose(): void;
4610
3832
  /**
4611
3833
  * Animate twinkling. No-op when `twinkle` is `false`.
4612
3834
  *
4613
- * Both styles pulse with a per-star phase offset so stars twinkle out of sync:
4614
- * points modulate per-point brightness (via the color attribute), burst pulses
4615
- * each instance scale. Pass elapsed time in seconds (defaults to `performance.now()`).
3835
+ * Each star pulses on its own phase offset so the field twinkles out of sync. Billboards
3836
+ * rewrite the instanced scale attribute; radial stars rebuild each instance matrix.
3837
+ * Pass elapsed time in seconds (defaults to `performance.now()`).
4616
3838
  */
4617
3839
  update(elapsed?: number): void;
4618
- private createPointsField;
4619
- private createBurstField;
3840
+ /**
3841
+ * Screen-aligned stars. `SpriteNodeMaterial` builds its quad from the geometry's XY and
3842
+ * reads the sprite center from `positionNode` — it never consults `instanceMatrix` — so
3843
+ * every per-star value has to arrive as an instanced attribute.
3844
+ */
3845
+ private createBillboardField;
3846
+ /** Full 3D stars rotated to face the shell center. */
3847
+ private createRadialField;
4620
3848
  }
4621
3849
 
4622
3850
  export declare interface StarFieldEffectOptions {
4623
3851
  /**
4624
- * Rendering style.
3852
+ * How each star faces the viewer.
4625
3853
  *
4626
- * - `points` (default) — billboard sprites with a procedural starburst texture
4627
- * (not the default square `Points` marker).
4628
- * - `burst` instanced {@link BurstGeometry} meshes oriented toward the shell center.
3854
+ * - `billboard` (default) — every star is screen-aligned, so the field holds its
3855
+ * orientation as the camera orbits. Only the geometry's **XY profile** is drawn;
3856
+ * any Z extent is ignored.
3857
+ * - `radial` — full 3D geometry rotated to face the shell center. Depth is real here,
3858
+ * and stars shear as the camera moves, the way any world-space mesh does.
4629
3859
  */
4630
- style?: "points" | "burst";
4631
- /** Shape parameters for both styles; `burst` uses them for geometry, `points` for the sprite. */
3860
+ orientation?: StarFieldOrientation;
3861
+ /** Star shape used to build the default {@link BurstGeometry}. */
4632
3862
  burst?: StarBurstShapeOptions;
4633
- /** Override the burst mesh geometry (`style: "burst"` only). */
3863
+ /** Replace the star geometry entirely. Billboards use its XY profile; radial uses all of it. */
4634
3864
  geometry?: BufferGeometry;
4635
- /** Override the default field material. */
3865
+ /**
3866
+ * Override the default field material. In `billboard` mode this must be a
3867
+ * `SpriteNodeMaterial` — per-star position, scale, and rotation are assigned onto it
3868
+ * as node inputs.
3869
+ */
4636
3870
  material?: Material;
4637
3871
  /** Number of stars. Defaults to `1500`. */
4638
3872
  count?: number;
@@ -4653,8 +3887,26 @@ export declare interface StarFieldEffectOptions {
4653
3887
  color?: ColorRepresentation | ColorRepresentation[];
4654
3888
  /** Enable pulsing brightness; call {@link StarFieldEffect.update} each frame when `true`. */
4655
3889
  twinkle?: boolean;
3890
+ /**
3891
+ * Base star rotation, in radians. Defaults to `0`.
3892
+ *
3893
+ * Measured in screen space for `billboard` and world space for `radial` — the same knob
3894
+ * means different things, because a billboard re-aligns every frame and a radial star
3895
+ * does not.
3896
+ */
3897
+ rotation?: number;
3898
+ /**
3899
+ * Random rotation spread added per star, in radians. Defaults to `Math.PI * 2`.
3900
+ *
3901
+ * `0` aligns every star — with `billboard` that yields a coherent diffraction-spike field
3902
+ * that stays locked as the camera orbits. `2π` is fully random.
3903
+ */
3904
+ rotationJitter?: number;
4656
3905
  }
4657
3906
 
3907
+ /** How each star is turned to face the viewer. */
3908
+ export declare type StarFieldOrientation = "billboard" | "radial";
3909
+
4658
3910
  /**
4659
3911
  * Extruded star prism.
4660
3912
  */
@@ -4959,20 +4211,6 @@ export declare interface TreeOptions extends TreeGeometryOptions {
4959
4211
  */
4960
4212
  export declare const twistBrush: <T extends BufferGeometry>(geometry: T, position: Vector3, radius: number, strength: number, direction?: Vector3, falloffFn?: (distance: number, radius: number) => number) => void;
4961
4213
 
4962
- /**
4963
- * Updates the time uniform of the material's shader to animate the noise effect.
4964
- * @param {Material} material - The material to update.
4965
- * @param {number} deltaTime - The time increment to add.
4966
- */
4967
- export declare function updateNoiseDisplacementTime<T extends Material>(material: T, deltaTime: number): void;
4968
-
4969
- /**
4970
- * Updates the time uniform of the material's shader to animate the water effect.
4971
- * @param {Material} material - The material to update.
4972
- * @param {number} deltaTime - The time increment to add.
4973
- */
4974
- export declare function updateWaterDisplacementTime<T extends Material>(material: T, deltaTime: number): void;
4975
-
4976
4214
  /**
4977
4215
  * Wall-mounted oil-lamp sconce — iron mount and cap/bowl frame around an
4978
4216
  * emissive glass chimney. Pair {@link GlowHalo} and {@link FlameFlickerEffect}