three-low-poly 0.9.27 → 1.0.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 +2 -14
- package/dist/index.cjs +1 -358
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +311 -865
- package/dist/index.iife.js +1 -358
- package/dist/index.iife.js.map +1 -1
- package/dist/index.mjs +1394 -1738
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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,16 @@ 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
22
|
import { Points } from 'three';
|
|
26
23
|
import { Quaternion } from 'three';
|
|
27
|
-
import { ShaderMaterial } from 'three';
|
|
28
24
|
import { Shape } from 'three';
|
|
29
25
|
import { ShapeGeometry } from 'three';
|
|
30
26
|
import { SphereGeometry } from 'three';
|
|
31
|
-
import * as THREE from 'three';
|
|
32
|
-
import { Uniform } from 'three';
|
|
33
27
|
import { Vector2 } from 'three';
|
|
34
28
|
import { Vector3 } from 'three';
|
|
35
29
|
|
|
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
30
|
/**
|
|
101
31
|
* Align a BufferGeometry to a surface by adjusting its vertices.
|
|
102
32
|
*/
|
|
@@ -288,105 +218,6 @@ declare interface ArchedOutlineTarget {
|
|
|
288
218
|
closePath(): unknown;
|
|
289
219
|
}
|
|
290
220
|
|
|
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
221
|
/**
|
|
391
222
|
* Geometric and mathematical role of the vectors as axes in 3D space.
|
|
392
223
|
*
|
|
@@ -514,31 +345,6 @@ export declare const Axis: {
|
|
|
514
345
|
XYZ: Vector3;
|
|
515
346
|
};
|
|
516
347
|
|
|
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
348
|
export declare class Bone extends Mesh<BoneGeometry, MeshStandardMaterial> {
|
|
543
349
|
constructor();
|
|
544
350
|
}
|
|
@@ -648,6 +454,59 @@ export declare interface BookshelfOptions extends BookshelfGeometryOptions {
|
|
|
648
454
|
color?: ColorRepresentation;
|
|
649
455
|
}
|
|
650
456
|
|
|
457
|
+
/**
|
|
458
|
+
* Boulder prefab — a {@link BoulderGeometry} lumped by coherent 3D noise, with a
|
|
459
|
+
* matte flat-shaded stone material. Centered on the origin; casts and receives
|
|
460
|
+
* shadows. Vary `seed` per instance for a field of unique boulders.
|
|
461
|
+
*/
|
|
462
|
+
export declare class Boulder extends Mesh<BoulderGeometry, MeshStandardMaterial> {
|
|
463
|
+
readonly radius: number;
|
|
464
|
+
constructor({ color, flatShading, ...geometryOptions }?: BoulderOptions);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Boulder — an icosphere lumped by coherent 3D fbm ({@link fbm3}) displaced along
|
|
469
|
+
* each vertex's radial direction. The 3D counterpart to the terrain heightfields:
|
|
470
|
+
* same noise strategy, applied over a closed surface instead of a height map.
|
|
471
|
+
*
|
|
472
|
+
* The icosphere is welded (`mergeVertices` after stripping seam UVs) so coincident
|
|
473
|
+
* vertices share one displacement — the coherent noise then moves neighbors together,
|
|
474
|
+
* so the surface stays watertight and never cracks (the failure mode of displacing a
|
|
475
|
+
* non-indexed polyhedron along normals). Real baked geometry, so shadows, raycasts,
|
|
476
|
+
* and physics colliders match what's drawn, on WebGL and WebGPU/TSL alike.
|
|
477
|
+
*
|
|
478
|
+
* Centered on the origin. Pair with a `flatShading` material for a faceted low-poly
|
|
479
|
+
* look. Vary `seed` per instance to fill a field with unique boulders.
|
|
480
|
+
*/
|
|
481
|
+
export declare class BoulderGeometry extends BufferGeometry {
|
|
482
|
+
readonly radius: number;
|
|
483
|
+
constructor({ radius, detail, noiseHeight, noiseScale, octaves, persistence, seed, }?: BoulderGeometryOptions);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export declare interface BoulderGeometryOptions {
|
|
487
|
+
/** Base radius before displacement (world units). Defaults to `1`. */
|
|
488
|
+
radius?: number;
|
|
489
|
+
/** Icosahedron subdivision — more detail = more, finer facets. Defaults to `2`. */
|
|
490
|
+
detail?: number;
|
|
491
|
+
/** Radial relief amplitude (world units, ±). Keep below `radius`. Defaults to `0.35`. */
|
|
492
|
+
noiseHeight?: number;
|
|
493
|
+
/** Noise frequency over the unit sphere — higher packs more, smaller lumps. Defaults to `1.6`. */
|
|
494
|
+
noiseScale?: number;
|
|
495
|
+
/** fbm octaves (detail layers). Defaults to `3`. */
|
|
496
|
+
octaves?: number;
|
|
497
|
+
/** fbm gain per octave (0–1); lower is smoother, higher is rougher. Defaults to `0.5`. */
|
|
498
|
+
persistence?: number;
|
|
499
|
+
/** Seed for reproducible shape. Defaults to `1`. */
|
|
500
|
+
seed?: number;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
export declare interface BoulderOptions extends BoulderGeometryOptions {
|
|
504
|
+
/** Stone tint. Defaults to `#6f6f6f`. */
|
|
505
|
+
color?: ColorRepresentation;
|
|
506
|
+
/** Faceted low-poly shading. Defaults to `true`. */
|
|
507
|
+
flatShading?: boolean;
|
|
508
|
+
}
|
|
509
|
+
|
|
651
510
|
export declare enum BoxSide {
|
|
652
511
|
LEFT = "left",
|
|
653
512
|
RIGHT = "right",
|
|
@@ -685,9 +544,6 @@ export declare function buildDiamondLatticeParts({ width, height, centerY, grid,
|
|
|
685
544
|
*/
|
|
686
545
|
export declare function buildGregorianLatticeParts({ width, height, centerY, cellsX, cellsY, mullionThickness: barT, mullionDepth: barD, }: GregorianLatticePartOptions): BoxGeometry[];
|
|
687
546
|
|
|
688
|
-
/** Outer frame bars — shared topology across lattice window openings. */
|
|
689
|
-
export declare function buildRingLatticeFrameParts({ width, height, centerY, frameThickness: barT, frameDepth: barD, }: RingLatticeFramePartOptions): BoxGeometry[];
|
|
690
|
-
|
|
691
547
|
export declare class BunsenBurner extends Group {
|
|
692
548
|
constructor();
|
|
693
549
|
}
|
|
@@ -861,87 +717,6 @@ export declare interface CameraSnapshot {
|
|
|
861
717
|
target: Vector3;
|
|
862
718
|
}
|
|
863
719
|
|
|
864
|
-
/**
|
|
865
|
-
* CameraTransition provides smooth animated transitions between perspective and orthographic cameras.
|
|
866
|
-
*
|
|
867
|
-
* The transition works by rendering both camera views to separate render targets and blending between them.
|
|
868
|
-
* This provides a true, accurate transition between the two camera types.
|
|
869
|
-
*
|
|
870
|
-
* @example
|
|
871
|
-
* ```typescript
|
|
872
|
-
* const transition = new CameraTransition(
|
|
873
|
-
* perspectiveCamera,
|
|
874
|
-
* orthographicCamera,
|
|
875
|
-
* renderer
|
|
876
|
-
* );
|
|
877
|
-
*
|
|
878
|
-
* transition.transitionTo(orthographicCamera, {
|
|
879
|
-
* duration: 1000,
|
|
880
|
-
* easing: 'easeInOutCubic'
|
|
881
|
-
* });
|
|
882
|
-
* ```
|
|
883
|
-
*/
|
|
884
|
-
export declare class CameraTransition {
|
|
885
|
-
private perspectiveCamera;
|
|
886
|
-
private orthographicCamera;
|
|
887
|
-
private renderer;
|
|
888
|
-
private scene;
|
|
889
|
-
private currentCamera;
|
|
890
|
-
private targetCamera;
|
|
891
|
-
private transitionProgress;
|
|
892
|
-
private transitionDuration;
|
|
893
|
-
private transitionStartTime;
|
|
894
|
-
private isTransitioning;
|
|
895
|
-
private easingFunction;
|
|
896
|
-
private renderTargetA;
|
|
897
|
-
private renderTargetB;
|
|
898
|
-
private blendScene;
|
|
899
|
-
private blendCamera;
|
|
900
|
-
private blendMaterial;
|
|
901
|
-
private onUpdateCallback?;
|
|
902
|
-
private onCompleteCallback?;
|
|
903
|
-
constructor(perspectiveCamera: THREE.PerspectiveCamera, orthographicCamera: THREE.OrthographicCamera, renderer: THREE.WebGLRenderer);
|
|
904
|
-
/**
|
|
905
|
-
* Start a transition to the target camera
|
|
906
|
-
*/
|
|
907
|
-
transitionTo(targetCamera: THREE.PerspectiveCamera | THREE.OrthographicCamera, options?: CameraTransitionOptions): void;
|
|
908
|
-
/**
|
|
909
|
-
* Update the transition. Call this in your render loop.
|
|
910
|
-
*/
|
|
911
|
-
update(scene: THREE.Scene): THREE.Camera;
|
|
912
|
-
/**
|
|
913
|
-
* Render the scene with camera transition blending
|
|
914
|
-
*/
|
|
915
|
-
render(scene: THREE.Scene): void;
|
|
916
|
-
/**
|
|
917
|
-
* Get the current active camera
|
|
918
|
-
*/
|
|
919
|
-
getCurrentCamera(): THREE.Camera;
|
|
920
|
-
/**
|
|
921
|
-
* Check if a transition is currently in progress
|
|
922
|
-
*/
|
|
923
|
-
getIsTransitioning(): boolean;
|
|
924
|
-
/**
|
|
925
|
-
* Get the current transition progress (0-1)
|
|
926
|
-
*/
|
|
927
|
-
getProgress(): number;
|
|
928
|
-
/**
|
|
929
|
-
* Resize the render targets when the renderer size changes
|
|
930
|
-
*/
|
|
931
|
-
setSize(width: number, height: number): void;
|
|
932
|
-
/**
|
|
933
|
-
* Dispose of resources
|
|
934
|
-
*/
|
|
935
|
-
dispose(): void;
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
export declare interface CameraTransitionOptions {
|
|
939
|
-
duration?: number;
|
|
940
|
-
easing?: EasingFunction | keyof typeof Easing;
|
|
941
|
-
onUpdate?: (progress: number) => void;
|
|
942
|
-
onComplete?: () => void;
|
|
943
|
-
}
|
|
944
|
-
|
|
945
720
|
/**
|
|
946
721
|
* Candle prefab — wax stick and emissive flame (separate material groups).
|
|
947
722
|
*/
|
|
@@ -1275,12 +1050,6 @@ export declare function createHexagonalTilesByRadius(options: HexagonalTileRadiu
|
|
|
1275
1050
|
*/
|
|
1276
1051
|
export declare const createLogarithmicCurvePoints: (start: Vector2, end: Vector2, base: number, factor: number, segments?: number) => Vector2[];
|
|
1277
1052
|
|
|
1278
|
-
/**
|
|
1279
|
-
* Four clipping planes for a rectangular opening (shadow + mesh clip).
|
|
1280
|
-
* Fragments are discarded when `dot(normal, position) > constant`.
|
|
1281
|
-
*/
|
|
1282
|
-
export declare function createOpeningClippingPlanes(width: number, height: number, centerY?: number): Plane[];
|
|
1283
|
-
|
|
1284
1053
|
/** Circle the scene — showcase reel orbit. */
|
|
1285
1054
|
export declare function createOrbitClip(options: OrbitClipOptions): CameraClip;
|
|
1286
1055
|
|
|
@@ -1387,9 +1156,6 @@ export declare const createQuadraticCurvePoints: (start: Vector2, control: Vecto
|
|
|
1387
1156
|
*/
|
|
1388
1157
|
export declare function createRandom(seed?: number): RandomSource;
|
|
1389
1158
|
|
|
1390
|
-
/** Hollow square profile extruded for one lattice ring (local XY, facing +Z). */
|
|
1391
|
-
export declare function createRingLatticeGeometry(outer: number, wall: number, depth: number): ExtrudeGeometry;
|
|
1392
|
-
|
|
1393
1159
|
/**
|
|
1394
1160
|
* Function to create sigmoid curve points
|
|
1395
1161
|
*
|
|
@@ -1423,22 +1189,6 @@ export declare function createWobbleClip(options: WobbleClipOptions): CameraClip
|
|
|
1423
1189
|
/** Focus punch — smooth FOV narrow toward a target. Restores FOV on cancel; keeps end FOV on complete. */
|
|
1424
1190
|
export declare function createZoomClip(options: ZoomClipOptions): CameraClip;
|
|
1425
1191
|
|
|
1426
|
-
export declare const crossfadeShader: {
|
|
1427
|
-
uniforms: {
|
|
1428
|
-
tDiffuseA: {
|
|
1429
|
-
value: null;
|
|
1430
|
-
};
|
|
1431
|
-
tDiffuseB: {
|
|
1432
|
-
value: null;
|
|
1433
|
-
};
|
|
1434
|
-
mixRatio: {
|
|
1435
|
-
value: number;
|
|
1436
|
-
};
|
|
1437
|
-
};
|
|
1438
|
-
vertexShader: string;
|
|
1439
|
-
fragmentShader: string;
|
|
1440
|
-
};
|
|
1441
|
-
|
|
1442
1192
|
/**
|
|
1443
1193
|
* Cross headstone prefab.
|
|
1444
1194
|
*/
|
|
@@ -1515,45 +1265,6 @@ export declare function cubicUVMappingBatch(vertices: [number, number, number][]
|
|
|
1515
1265
|
*/
|
|
1516
1266
|
export declare function cylindricalUVMapping(vertices: [number, number, number][]): [number, number][];
|
|
1517
1267
|
|
|
1518
|
-
export declare class DaySkybox extends Mesh {
|
|
1519
|
-
geometry: BoxGeometry;
|
|
1520
|
-
material: ShaderMaterial & {
|
|
1521
|
-
uniforms: DaySkyUniforms;
|
|
1522
|
-
};
|
|
1523
|
-
constructor(size?: number);
|
|
1524
|
-
}
|
|
1525
|
-
|
|
1526
|
-
/**
|
|
1527
|
-
* Shader for a day skybox.
|
|
1528
|
-
*
|
|
1529
|
-
* Example:
|
|
1530
|
-
* ```
|
|
1531
|
-
* this.material = new ShaderMaterial({
|
|
1532
|
-
* uniforms: daySkyShader.uniforms,
|
|
1533
|
-
* vertexShader: daySkyShader.vertexShader,
|
|
1534
|
-
* fragmentShader: daySkyShader.fragmentShader,
|
|
1535
|
-
* side: BackSide,
|
|
1536
|
-
* }) as ShaderMaterial & { uniforms: DaySkyUniforms };
|
|
1537
|
-
* ```
|
|
1538
|
-
*/
|
|
1539
|
-
export declare const daySkyShader: {
|
|
1540
|
-
uniforms: {
|
|
1541
|
-
topColor: {
|
|
1542
|
-
value: Color;
|
|
1543
|
-
};
|
|
1544
|
-
bottomColor: {
|
|
1545
|
-
value: Color;
|
|
1546
|
-
};
|
|
1547
|
-
};
|
|
1548
|
-
vertexShader: string;
|
|
1549
|
-
fragmentShader: string;
|
|
1550
|
-
};
|
|
1551
|
-
|
|
1552
|
-
export declare interface DaySkyUniforms {
|
|
1553
|
-
topColor: Uniform<Color>;
|
|
1554
|
-
bottomColor: Uniform<Color>;
|
|
1555
|
-
}
|
|
1556
|
-
|
|
1557
1268
|
/**
|
|
1558
1269
|
* Derive an independent sub-stream seed from a master seed and domain salt.
|
|
1559
1270
|
*
|
|
@@ -1784,6 +1495,90 @@ export declare interface DollyClipOptions extends CameraClipTiming {
|
|
|
1784
1495
|
ease?: EasingFunction;
|
|
1785
1496
|
}
|
|
1786
1497
|
|
|
1498
|
+
/**
|
|
1499
|
+
* Fine dust drifting through a lit interior — tiny additive specks slowly
|
|
1500
|
+
* settling and wafting, twinkling as they catch the light and all but vanishing
|
|
1501
|
+
* in shadow. This is the thing that sells a light shaft as volumetric. Additive
|
|
1502
|
+
* spheres read the same from any angle, so no billboarding is needed.
|
|
1503
|
+
*
|
|
1504
|
+
* Call {@link DustMotesEffect.update} each frame with elapsed time in seconds.
|
|
1505
|
+
*
|
|
1506
|
+
* @example
|
|
1507
|
+
* ```typescript
|
|
1508
|
+
* const dust = new DustMotesEffect({
|
|
1509
|
+
* count: 150,
|
|
1510
|
+
* width: 8,
|
|
1511
|
+
* height: 9,
|
|
1512
|
+
* depth: 8,
|
|
1513
|
+
* color: "#aebfe6",
|
|
1514
|
+
* });
|
|
1515
|
+
* scene.add(dust);
|
|
1516
|
+
*
|
|
1517
|
+
* onFrame((dt) => dust.update(dt));
|
|
1518
|
+
* ```
|
|
1519
|
+
*/
|
|
1520
|
+
export declare class DustMotesEffect extends InstancedMesh {
|
|
1521
|
+
private readonly width;
|
|
1522
|
+
private readonly height;
|
|
1523
|
+
private readonly depth;
|
|
1524
|
+
private readonly floorY;
|
|
1525
|
+
private readonly waft;
|
|
1526
|
+
private readonly scaleMin;
|
|
1527
|
+
private readonly scaleMax;
|
|
1528
|
+
private readonly px;
|
|
1529
|
+
private readonly py;
|
|
1530
|
+
private readonly pz;
|
|
1531
|
+
private readonly settle;
|
|
1532
|
+
private readonly twinkle;
|
|
1533
|
+
private readonly phase;
|
|
1534
|
+
private readonly dummy;
|
|
1535
|
+
private clock;
|
|
1536
|
+
constructor(options?: DustMotesEffectOptions);
|
|
1537
|
+
/**
|
|
1538
|
+
* Advance the drift and twinkle. Pass elapsed frame time in seconds.
|
|
1539
|
+
*/
|
|
1540
|
+
update(dt: number): void;
|
|
1541
|
+
/** Release geometry and materials held by the field. */
|
|
1542
|
+
dispose(): this;
|
|
1543
|
+
private respawn;
|
|
1544
|
+
private writeMatrices;
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
export declare interface DustMotesEffectOptions {
|
|
1548
|
+
/** Number of dust instances. Defaults to `150`. */
|
|
1549
|
+
count?: number;
|
|
1550
|
+
/** Horizontal spread (world units). Defaults to `12`. */
|
|
1551
|
+
width?: number;
|
|
1552
|
+
/** Vertical spawn span (world units). Defaults to `8`. */
|
|
1553
|
+
height?: number;
|
|
1554
|
+
/** Depth spread (world units). Defaults to `12`. */
|
|
1555
|
+
depth?: number;
|
|
1556
|
+
/** World Y of the volume floor; motes respawn at the top after settling past it. Defaults to `0`. */
|
|
1557
|
+
floorY?: number;
|
|
1558
|
+
/** Speck tint. Defaults to `#aebfe6`. */
|
|
1559
|
+
color?: ColorRepresentation;
|
|
1560
|
+
/** Speck radius (world units). Defaults to `0.02`. */
|
|
1561
|
+
radius?: number;
|
|
1562
|
+
/** Base material opacity. Defaults to `0.9`. */
|
|
1563
|
+
opacity?: number;
|
|
1564
|
+
/** Override the default additive speck material. */
|
|
1565
|
+
material?: Material;
|
|
1566
|
+
/** Minimum settle (fall) speed (units/s). Defaults to `0.1`. */
|
|
1567
|
+
settleMin?: number;
|
|
1568
|
+
/** Maximum settle (fall) speed (units/s). Defaults to `0.35`. */
|
|
1569
|
+
settleMax?: number;
|
|
1570
|
+
/** Lateral waft amplitude (units/s). Defaults to `0.08`. */
|
|
1571
|
+
waft?: number;
|
|
1572
|
+
/** Smallest twinkle scale multiplier. Defaults to `0.6`. */
|
|
1573
|
+
scaleMin?: number;
|
|
1574
|
+
/** Largest twinkle scale multiplier. Defaults to `1.2`. */
|
|
1575
|
+
scaleMax?: number;
|
|
1576
|
+
/** Minimum twinkle frequency (rad/s). Defaults to `0.7`. */
|
|
1577
|
+
twinkleMin?: number;
|
|
1578
|
+
/** Maximum twinkle frequency (rad/s). Defaults to `1.6`. */
|
|
1579
|
+
twinkleMax?: number;
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1787
1582
|
/**
|
|
1788
1583
|
* Easing functions for interpolating values over time.
|
|
1789
1584
|
*
|
|
@@ -2027,49 +1822,6 @@ export declare interface ErlenmeyerFlaskOptions extends ErlenmeyerFlaskGeometryO
|
|
|
2027
1822
|
opacity?: number;
|
|
2028
1823
|
}
|
|
2029
1824
|
|
|
2030
|
-
export declare const fadeShader: {
|
|
2031
|
-
uniforms: {
|
|
2032
|
-
tDiffuse: {
|
|
2033
|
-
value: null;
|
|
2034
|
-
};
|
|
2035
|
-
fadeAmount: {
|
|
2036
|
-
value: number;
|
|
2037
|
-
};
|
|
2038
|
-
fadeColor: {
|
|
2039
|
-
value: null;
|
|
2040
|
-
};
|
|
2041
|
-
};
|
|
2042
|
-
vertexShader: string;
|
|
2043
|
-
fragmentShader: string;
|
|
2044
|
-
};
|
|
2045
|
-
|
|
2046
|
-
declare interface FadeTransitionOptions extends SceneTransitionOptions {
|
|
2047
|
-
color?: THREE.ColorRepresentation;
|
|
2048
|
-
}
|
|
2049
|
-
|
|
2050
|
-
declare interface FadeTransitionOptions_2 extends SceneTransitionFXOptions {
|
|
2051
|
-
color?: THREE.ColorRepresentation;
|
|
2052
|
-
}
|
|
2053
|
-
|
|
2054
|
-
export declare const fadeTransitionSceneShader: {
|
|
2055
|
-
uniforms: {
|
|
2056
|
-
tDiffuseA: {
|
|
2057
|
-
value: null;
|
|
2058
|
-
};
|
|
2059
|
-
tDiffuseB: {
|
|
2060
|
-
value: null;
|
|
2061
|
-
};
|
|
2062
|
-
mixRatio: {
|
|
2063
|
-
value: number;
|
|
2064
|
-
};
|
|
2065
|
-
fadeColor: {
|
|
2066
|
-
value: null;
|
|
2067
|
-
};
|
|
2068
|
-
};
|
|
2069
|
-
vertexShader: string;
|
|
2070
|
-
fragmentShader: string;
|
|
2071
|
-
};
|
|
2072
|
-
|
|
2073
1825
|
export declare const Falloff: {
|
|
2074
1826
|
linear: (distance: number, radius: number) => number;
|
|
2075
1827
|
quadratic: (distance: number, radius: number) => number;
|
|
@@ -2267,10 +2019,6 @@ export declare class GearShape extends Shape {
|
|
|
2267
2019
|
*/
|
|
2268
2020
|
export declare function getAnalogousColors(baseHue: number): [number, number, number];
|
|
2269
2021
|
|
|
2270
|
-
declare interface GlitchTransitionOptions extends SceneTransitionFXOptions {
|
|
2271
|
-
maxIntensity?: number;
|
|
2272
|
-
}
|
|
2273
|
-
|
|
2274
2022
|
/**
|
|
2275
2023
|
* Soft additive glow billboard — reads as light without a {@link PointLight}.
|
|
2276
2024
|
* Pair with {@link FlameFlickerEffect} for organic pulse, or use alone for
|
|
@@ -2618,44 +2366,6 @@ export declare function hexToHsl(hex: number): [number, number, number];
|
|
|
2618
2366
|
*/
|
|
2619
2367
|
export declare function hexToRgb(hex: number): [number, number, number];
|
|
2620
2368
|
|
|
2621
|
-
/**
|
|
2622
|
-
* Hill prefab — hemispherical terrain mound.
|
|
2623
|
-
*/
|
|
2624
|
-
export declare class Hill extends Mesh<HillGeometry, MeshStandardMaterial> {
|
|
2625
|
-
readonly radius: number;
|
|
2626
|
-
readonly height: number;
|
|
2627
|
-
constructor({ color, ...geometryOptions }?: HillOptions);
|
|
2628
|
-
}
|
|
2629
|
-
|
|
2630
|
-
/**
|
|
2631
|
-
* Hemispherical hill — a sphere cap scaled on Y, base on the Y=0 plane.
|
|
2632
|
-
*/
|
|
2633
|
-
export declare class HillGeometry extends BufferGeometry {
|
|
2634
|
-
readonly radius: number;
|
|
2635
|
-
readonly height: number;
|
|
2636
|
-
constructor({ radius, height, widthSegments, heightSegments, phiStart, phiLength, }?: HillGeometryOptions);
|
|
2637
|
-
}
|
|
2638
|
-
|
|
2639
|
-
export declare interface HillGeometryOptions {
|
|
2640
|
-
/** Base sphere radius before vertical squash. Defaults to `3`. */
|
|
2641
|
-
radius?: number;
|
|
2642
|
-
/** Peak height. Defaults to `0.6`. */
|
|
2643
|
-
height?: number;
|
|
2644
|
-
/** Horizontal segments. Defaults to `64`. */
|
|
2645
|
-
widthSegments?: number;
|
|
2646
|
-
/** Vertical segments. Defaults to `16`. */
|
|
2647
|
-
heightSegments?: number;
|
|
2648
|
-
/** Azimuth start angle (radians). Defaults to `0`. */
|
|
2649
|
-
phiStart?: number;
|
|
2650
|
-
/** Azimuth sweep (radians). Defaults to `2π`. */
|
|
2651
|
-
phiLength?: number;
|
|
2652
|
-
}
|
|
2653
|
-
|
|
2654
|
-
export declare interface HillOptions extends HillGeometryOptions {
|
|
2655
|
-
/** Surface tint. Defaults to `#00ff00`. */
|
|
2656
|
-
color?: ColorRepresentation;
|
|
2657
|
-
}
|
|
2658
|
-
|
|
2659
2369
|
/**
|
|
2660
2370
|
* Example usage:
|
|
2661
2371
|
* ```
|
|
@@ -3031,108 +2741,17 @@ export declare interface MossyRockOptions extends MossyRockGeometryOptions {
|
|
|
3031
2741
|
mossOpacity?: number;
|
|
3032
2742
|
}
|
|
3033
2743
|
|
|
3034
|
-
/**
|
|
3035
|
-
* Mound prefab — flat-topped terrain cap.
|
|
3036
|
-
*/
|
|
3037
|
-
export declare class Mound extends Mesh<MoundGeometry, MeshStandardMaterial> {
|
|
3038
|
-
readonly radius: number;
|
|
3039
|
-
constructor({ color, radius, ...geometryOptions }?: MoundOptions);
|
|
3040
|
-
}
|
|
3041
|
-
|
|
3042
|
-
/**
|
|
3043
|
-
* Mound-like geometry with a flat top — sphere cap, base on Y=0.
|
|
3044
|
-
*/
|
|
3045
|
-
export declare class MoundGeometry extends BufferGeometry {
|
|
3046
|
-
readonly radius: number;
|
|
3047
|
-
readonly thetaLength: number;
|
|
3048
|
-
constructor({ radius, widthSegments, heightSegments, phiStart, phiLength, thetaLength, }?: MoundGeometryOptions);
|
|
3049
|
-
}
|
|
3050
|
-
|
|
3051
|
-
export declare interface MoundGeometryOptions {
|
|
3052
|
-
/** Sphere radius. Defaults to a cap width of `5` at `thetaLength`. */
|
|
3053
|
-
radius?: number;
|
|
3054
|
-
/** Horizontal segments. Defaults to `64`. */
|
|
3055
|
-
widthSegments?: number;
|
|
3056
|
-
/** Vertical segments. Defaults to `32`. */
|
|
3057
|
-
heightSegments?: number;
|
|
3058
|
-
/** Azimuth start angle (radians). Defaults to `0`. */
|
|
3059
|
-
phiStart?: number;
|
|
3060
|
-
/** Azimuth sweep (radians). Defaults to `2π`. */
|
|
3061
|
-
phiLength?: number;
|
|
3062
|
-
/** Polar sweep from the north pole (radians). Defaults to `π/10`. */
|
|
3063
|
-
thetaLength?: number;
|
|
3064
|
-
}
|
|
3065
|
-
|
|
3066
|
-
export declare interface MoundOptions extends MoundGeometryOptions {
|
|
3067
|
-
/** Surface tint. Defaults to `#00ff00`. */
|
|
3068
|
-
color?: ColorRepresentation;
|
|
3069
|
-
}
|
|
3070
|
-
|
|
3071
2744
|
/**
|
|
3072
2745
|
* Fast seeded PRNG — portfolio Gotham/Water parity.
|
|
3073
2746
|
* Returns a closure yielding floats in [0, 1).
|
|
3074
2747
|
*/
|
|
3075
2748
|
export declare function mulberry32(seed: number): RandomStream;
|
|
3076
2749
|
|
|
3077
|
-
export declare class NightSkybox extends Mesh {
|
|
3078
|
-
geometry: SphereGeometry;
|
|
3079
|
-
material: ShaderMaterial & {
|
|
3080
|
-
uniforms: NightSkyUniforms;
|
|
3081
|
-
};
|
|
3082
|
-
constructor(size?: number);
|
|
3083
|
-
}
|
|
3084
|
-
|
|
3085
|
-
/**
|
|
3086
|
-
* Shader for a night skybox.
|
|
3087
|
-
*
|
|
3088
|
-
* Example:
|
|
3089
|
-
* ```
|
|
3090
|
-
* this.material = new ShaderMaterial({
|
|
3091
|
-
* vertexShader: nightSkyShader.vertexShader,
|
|
3092
|
-
* fragmentShader: nightSkyShader.fragmentShader,
|
|
3093
|
-
* uniforms: nightSkyShader.uniforms,
|
|
3094
|
-
* side: BackSide,
|
|
3095
|
-
* }) as ShaderMaterial & { uniforms: NightSkyUniforms };
|
|
3096
|
-
* ```
|
|
3097
|
-
*/
|
|
3098
|
-
export declare const nightSkyShader: {
|
|
3099
|
-
uniforms: {
|
|
3100
|
-
topColor: {
|
|
3101
|
-
value: Color;
|
|
3102
|
-
};
|
|
3103
|
-
bottomColor: {
|
|
3104
|
-
value: Color;
|
|
3105
|
-
};
|
|
3106
|
-
offset: {
|
|
3107
|
-
value: number;
|
|
3108
|
-
};
|
|
3109
|
-
exponent: {
|
|
3110
|
-
value: number;
|
|
3111
|
-
};
|
|
3112
|
-
};
|
|
3113
|
-
vertexShader: string;
|
|
3114
|
-
fragmentShader: string;
|
|
3115
|
-
};
|
|
3116
|
-
|
|
3117
|
-
export declare interface NightSkyUniforms {
|
|
3118
|
-
topColor: Uniform<Color>;
|
|
3119
|
-
bottomColor: Uniform<Color>;
|
|
3120
|
-
offset: Uniform<number>;
|
|
3121
|
-
exponent: Uniform<number>;
|
|
3122
|
-
}
|
|
3123
|
-
|
|
3124
2750
|
/**
|
|
3125
2751
|
* Adds random noise to the vertices within the specified radius to create a more rugged or natural look.
|
|
3126
2752
|
*/
|
|
3127
2753
|
export declare const noiseBrush: <T extends BufferGeometry>(geometry: T, position: Vector3, radius: number, strength: number, direction?: Vector3, falloffFn?: (distance: number, radius: number) => number) => void;
|
|
3128
2754
|
|
|
3129
|
-
declare interface NoiseDisplacementOptions {
|
|
3130
|
-
time?: number;
|
|
3131
|
-
intensity?: number;
|
|
3132
|
-
axis?: Vector3;
|
|
3133
|
-
scale?: number;
|
|
3134
|
-
}
|
|
3135
|
-
|
|
3136
2755
|
export declare function normalizeRgb(r: number, g: number, b: number): [number, number, number];
|
|
3137
2756
|
|
|
3138
2757
|
/**
|
|
@@ -3652,9 +3271,6 @@ export declare type RandomStream = () => number;
|
|
|
3652
3271
|
|
|
3653
3272
|
export declare function randomTransformVertices<T extends BufferGeometry>(geometry: T, axis?: Vector3, minScale?: number, maxScale?: number): T;
|
|
3654
3273
|
|
|
3655
|
-
/** Resolve uniform ring spacing — `cell` wins over the `cellsX` density hint. */
|
|
3656
|
-
export declare function resolveRingLatticeCell(width: number, _height: number, cell?: number, cellsX?: number): number;
|
|
3657
|
-
|
|
3658
3274
|
export declare function rgbToHex(r: number, g: number, b: number): number;
|
|
3659
3275
|
|
|
3660
3276
|
/**
|
|
@@ -3669,84 +3285,6 @@ export declare function rgbToHex(r: number, g: number, b: number): number;
|
|
|
3669
3285
|
*/
|
|
3670
3286
|
export declare function rgbToHsl(r: number, g: number, b: number): [number, number, number];
|
|
3671
3287
|
|
|
3672
|
-
/** Ring-spacing factor — overlap tightens as this approaches 1. */
|
|
3673
|
-
export declare const RING_LATTICE_SPACING_FACTOR = 0.96;
|
|
3674
|
-
|
|
3675
|
-
declare interface RingLatticeFramePartOptions {
|
|
3676
|
-
width: number;
|
|
3677
|
-
height: number;
|
|
3678
|
-
centerY?: number;
|
|
3679
|
-
frameThickness: number;
|
|
3680
|
-
frameDepth: number;
|
|
3681
|
-
}
|
|
3682
|
-
|
|
3683
|
-
export declare interface RingLatticeGrid {
|
|
3684
|
-
/** Requested ring-center spacing before the overlap factor. */
|
|
3685
|
-
cell: number;
|
|
3686
|
-
/** Effective center spacing (`cell × 0.96`). */
|
|
3687
|
-
latticeCell: number;
|
|
3688
|
-
/** Outer half-extent of each square ring profile. */
|
|
3689
|
-
ringOuter: number;
|
|
3690
|
-
/** Ring instance count. */
|
|
3691
|
-
count: number;
|
|
3692
|
-
}
|
|
3693
|
-
|
|
3694
|
-
declare interface RingLatticeSpotOptions {
|
|
3695
|
-
width: number;
|
|
3696
|
-
height: number;
|
|
3697
|
-
centerY?: number;
|
|
3698
|
-
cell: number;
|
|
3699
|
-
}
|
|
3700
|
-
|
|
3701
|
-
/** Ring-center positions overscanning the opening (stencil trims the excess). */
|
|
3702
|
-
export declare function ringLatticeSpots({ width, height, centerY, cell, }: RingLatticeSpotOptions): {
|
|
3703
|
-
spots: [number, number][];
|
|
3704
|
-
grid: RingLatticeGrid;
|
|
3705
|
-
};
|
|
3706
|
-
|
|
3707
|
-
/**
|
|
3708
|
-
* Ring lattice window — overlapping square rings on a uniform grid (diaper /
|
|
3709
|
-
* trellis fretwork), stencil-clipped to a rectangular opening.
|
|
3710
|
-
*/
|
|
3711
|
-
export declare class RingLatticeWindow extends Group {
|
|
3712
|
-
readonly lattice: InstancedMesh;
|
|
3713
|
-
readonly frame: Mesh;
|
|
3714
|
-
readonly glass?: Mesh<PlaneGeometry, MeshPhysicalMaterial>;
|
|
3715
|
-
readonly cell: number;
|
|
3716
|
-
readonly fittedGrid: RingLatticeGrid;
|
|
3717
|
-
private readonly clipPlanesLocal;
|
|
3718
|
-
private readonly clipPlanesWorld;
|
|
3719
|
-
constructor({ width, height, cell: cellOption, cellsX, centerY, ringThickness, ringDepth, frameThickness, frameDepth, latticeColor, glass, glassColor, glassEmissive, glassEmissiveIntensity, }?: RingLatticeWindowOptions);
|
|
3720
|
-
}
|
|
3721
|
-
|
|
3722
|
-
declare interface RingLatticeWindowOptions {
|
|
3723
|
-
/** Opening width (world units). */
|
|
3724
|
-
width?: number;
|
|
3725
|
-
/** Opening height (world units). */
|
|
3726
|
-
height?: number;
|
|
3727
|
-
/** Uniform ring-center spacing. Overrides `cellsX` when set. Defaults to `0.55`. */
|
|
3728
|
-
cell?: number;
|
|
3729
|
-
/** Density hint — `cell = width / cellsX` when `cell` is omitted. */
|
|
3730
|
-
cellsX?: number;
|
|
3731
|
-
/** Wall thickness of each square ring profile. Defaults to `0.05`. */
|
|
3732
|
-
ringThickness?: number;
|
|
3733
|
-
/** Extrusion depth of each ring. Defaults to `0.06`. */
|
|
3734
|
-
ringDepth?: number;
|
|
3735
|
-
/** Outer frame bar thickness. Defaults to `0.055`. */
|
|
3736
|
-
frameThickness?: number;
|
|
3737
|
-
/** Outer frame depth (Z). Defaults to `0.11`. */
|
|
3738
|
-
frameDepth?: number;
|
|
3739
|
-
/** Vertical center of the opening in local space. Defaults to `0`. */
|
|
3740
|
-
centerY?: number;
|
|
3741
|
-
/** Lattice + frame tint. Defaults to `#0c0f14`. */
|
|
3742
|
-
latticeColor?: ColorRepresentation;
|
|
3743
|
-
/** Optional glass pane recessed slightly on −Z. */
|
|
3744
|
-
glass?: boolean;
|
|
3745
|
-
glassColor?: ColorRepresentation;
|
|
3746
|
-
glassEmissive?: ColorRepresentation;
|
|
3747
|
-
glassEmissiveIntensity?: number;
|
|
3748
|
-
}
|
|
3749
|
-
|
|
3750
3288
|
/**
|
|
3751
3289
|
* Single rock prefab — noisy sphere mesh.
|
|
3752
3290
|
*/
|
|
@@ -3844,6 +3382,51 @@ export declare interface RowOfBooksOptions<T extends Material = Material> {
|
|
|
3844
3382
|
seed?: number;
|
|
3845
3383
|
}
|
|
3846
3384
|
|
|
3385
|
+
/**
|
|
3386
|
+
* Scatter a field of instanced boulders inside a horizontal bounds region — a "created
|
|
3387
|
+
* layer" of the noise-lumped {@link BoulderGeometry}. Unlike {@link scatterRocks}, which
|
|
3388
|
+
* rotates a single shared shape, this generates several distinct boulder geometries
|
|
3389
|
+
* (see `variants`) and distributes instances across them, so the field reads as unique
|
|
3390
|
+
* rocks while staying to a few draw calls.
|
|
3391
|
+
*
|
|
3392
|
+
* Returns a {@link Group} of {@link InstancedMesh}es (one per variant), each sharing the
|
|
3393
|
+
* stone material. Pass a `seed` for a reproducible field. Dispose each child's geometry
|
|
3394
|
+
* and the shared material when removing it.
|
|
3395
|
+
*
|
|
3396
|
+
* @example
|
|
3397
|
+
* ```ts
|
|
3398
|
+
* const boulders = scatterBoulders({ count: 24, width: 12, depth: 12, seed: 1337 });
|
|
3399
|
+
* scene.add(boulders);
|
|
3400
|
+
* ```
|
|
3401
|
+
*/
|
|
3402
|
+
export declare function scatterBoulders({ count, width, depth, heightJitter, scaleMin, scaleMax, seed, radius, detail, noiseHeight, noiseScale, octaves, persistence, variants, material, color, }?: ScatterBouldersOptions): Group;
|
|
3403
|
+
|
|
3404
|
+
export declare interface ScatterBouldersOptions extends RockScatterPlacementOptions {
|
|
3405
|
+
/** Base radius for each boulder geometry. Defaults to `1`. */
|
|
3406
|
+
radius?: number;
|
|
3407
|
+
/** Icosphere subdivision per boulder. Defaults to `2`. */
|
|
3408
|
+
detail?: number;
|
|
3409
|
+
/** Radial relief amplitude per boulder. Defaults to `0.35`. */
|
|
3410
|
+
noiseHeight?: number;
|
|
3411
|
+
/** Noise frequency per boulder. Defaults to `1.6`. */
|
|
3412
|
+
noiseScale?: number;
|
|
3413
|
+
/** fbm octaves per boulder. Defaults to `3`. */
|
|
3414
|
+
octaves?: number;
|
|
3415
|
+
/** fbm gain per octave. Defaults to `0.5`. */
|
|
3416
|
+
persistence?: number;
|
|
3417
|
+
/**
|
|
3418
|
+
* Distinct boulder geometries generated and distributed across the field. Each is
|
|
3419
|
+
* a real, unique lumped shape (unlike rotating one shared mesh); instances round-robin
|
|
3420
|
+
* across them, so the field stays batch-friendly (one draw call per variant).
|
|
3421
|
+
* Defaults to `4`.
|
|
3422
|
+
*/
|
|
3423
|
+
variants?: number;
|
|
3424
|
+
/** Override the default stone material (shared across all instances). */
|
|
3425
|
+
material?: Material;
|
|
3426
|
+
/** Stone tint when `material` is omitted. Defaults to `#6f6f6f`. */
|
|
3427
|
+
color?: ColorRepresentation;
|
|
3428
|
+
}
|
|
3429
|
+
|
|
3847
3430
|
/**
|
|
3848
3431
|
* Scatter instanced mossy rocks inside a horizontal bounds region.
|
|
3849
3432
|
*
|
|
@@ -3889,256 +3472,6 @@ export declare interface ScatterRocksOptions extends RockScatterPlacementOptions
|
|
|
3889
3472
|
color?: ColorRepresentation;
|
|
3890
3473
|
}
|
|
3891
3474
|
|
|
3892
|
-
/**
|
|
3893
|
-
* SceneTransition provides smooth animated transitions between Three.js scenes.
|
|
3894
|
-
*
|
|
3895
|
-
* Supports multiple transition types:
|
|
3896
|
-
* - Fade: Fade to a color (black, white, etc.) and back
|
|
3897
|
-
* - Crossfade: Directly blend from one scene to another
|
|
3898
|
-
* - Blur: Blur out the first scene and blur in the second
|
|
3899
|
-
*
|
|
3900
|
-
* @example
|
|
3901
|
-
* ```typescript
|
|
3902
|
-
* const sceneTransition = new SceneTransition(renderer);
|
|
3903
|
-
*
|
|
3904
|
-
* // Fade to black transition
|
|
3905
|
-
* sceneTransition.fade(sceneA, sceneB, camera, {
|
|
3906
|
-
* duration: 1000,
|
|
3907
|
-
* color: 0x000000,
|
|
3908
|
-
* easing: 'easeInOutCubic'
|
|
3909
|
-
* });
|
|
3910
|
-
*
|
|
3911
|
-
* // Direct crossfade
|
|
3912
|
-
* sceneTransition.crossfade(sceneA, sceneB, camera, {
|
|
3913
|
-
* duration: 1500
|
|
3914
|
-
* });
|
|
3915
|
-
* ```
|
|
3916
|
-
*/
|
|
3917
|
-
export declare class SceneTransition {
|
|
3918
|
-
private renderer;
|
|
3919
|
-
private currentScene;
|
|
3920
|
-
private targetScene;
|
|
3921
|
-
private camera;
|
|
3922
|
-
private transitionProgress;
|
|
3923
|
-
private transitionDuration;
|
|
3924
|
-
private transitionStartTime;
|
|
3925
|
-
private isTransitioning;
|
|
3926
|
-
private transitionType;
|
|
3927
|
-
private easingFunction;
|
|
3928
|
-
private renderTargetA;
|
|
3929
|
-
private renderTargetB;
|
|
3930
|
-
private blendScene;
|
|
3931
|
-
private blendCamera;
|
|
3932
|
-
private fadeMaterial;
|
|
3933
|
-
private crossfadeMaterial;
|
|
3934
|
-
private fadeColor;
|
|
3935
|
-
private onUpdateCallback?;
|
|
3936
|
-
private onCompleteCallback?;
|
|
3937
|
-
constructor(renderer: THREE.WebGLRenderer);
|
|
3938
|
-
/**
|
|
3939
|
-
* Fade transition: Fades to a color and then fades in the new scene
|
|
3940
|
-
*/
|
|
3941
|
-
fade(fromScene: THREE.Scene, toScene: THREE.Scene, camera: THREE.Camera, options?: FadeTransitionOptions): void;
|
|
3942
|
-
/**
|
|
3943
|
-
* Crossfade transition: Directly blends from one scene to another
|
|
3944
|
-
*/
|
|
3945
|
-
crossfade(fromScene: THREE.Scene, toScene: THREE.Scene, camera: THREE.Camera, options?: SceneTransitionOptions): void;
|
|
3946
|
-
/**
|
|
3947
|
-
* Blur transition: Blurs out first scene, then blurs in second scene
|
|
3948
|
-
* Note: This uses the fade material with a neutral gray for a blur-like effect
|
|
3949
|
-
* For true blur, you'd need post-processing passes
|
|
3950
|
-
*/
|
|
3951
|
-
blur(fromScene: THREE.Scene, toScene: THREE.Scene, camera: THREE.Camera, options?: SceneTransitionOptions): void;
|
|
3952
|
-
/**
|
|
3953
|
-
* Internal method to start a transition
|
|
3954
|
-
*/
|
|
3955
|
-
private startTransition;
|
|
3956
|
-
/**
|
|
3957
|
-
* Update the transition. Call this in your render loop.
|
|
3958
|
-
*/
|
|
3959
|
-
update(): void;
|
|
3960
|
-
/**
|
|
3961
|
-
* Render the scene with transition blending
|
|
3962
|
-
*/
|
|
3963
|
-
render(): void;
|
|
3964
|
-
/**
|
|
3965
|
-
* Get the current active scene
|
|
3966
|
-
*/
|
|
3967
|
-
getCurrentScene(): THREE.Scene | null;
|
|
3968
|
-
/**
|
|
3969
|
-
* Check if a transition is currently in progress
|
|
3970
|
-
*/
|
|
3971
|
-
getIsTransitioning(): boolean;
|
|
3972
|
-
/**
|
|
3973
|
-
* Get the current transition progress (0-1)
|
|
3974
|
-
*/
|
|
3975
|
-
getProgress(): number;
|
|
3976
|
-
/**
|
|
3977
|
-
* Set the current scene (useful for initialization)
|
|
3978
|
-
*/
|
|
3979
|
-
setCurrentScene(scene: THREE.Scene): void;
|
|
3980
|
-
/**
|
|
3981
|
-
* Resize the render targets when the renderer size changes
|
|
3982
|
-
*/
|
|
3983
|
-
setSize(width: number, height: number): void;
|
|
3984
|
-
/**
|
|
3985
|
-
* Dispose of resources
|
|
3986
|
-
*/
|
|
3987
|
-
dispose(): void;
|
|
3988
|
-
}
|
|
3989
|
-
|
|
3990
|
-
/**
|
|
3991
|
-
* SceneTransitionFX provides advanced post-processing transitions between Three.js scenes.
|
|
3992
|
-
*
|
|
3993
|
-
* Uses EffectComposer for sophisticated visual effects:
|
|
3994
|
-
* - Bloom: Bright bloom effect that peaks at transition midpoint, washing out to white
|
|
3995
|
-
* - Blur: Progressive blur effect that peaks at midpoint, blurring scenes to oblivion
|
|
3996
|
-
* - Fade: Classic fade through a color (black, white, or custom)
|
|
3997
|
-
* - Glitch: Digital distortion/glitch effect with heavy artifacts
|
|
3998
|
-
*
|
|
3999
|
-
* Built-in shader passes for blur and fade are automatically created. For bloom and glitch
|
|
4000
|
-
* effects, you'll need to provide those passes manually.
|
|
4001
|
-
*
|
|
4002
|
-
* Note: Requires post-processing imports from three/addons
|
|
4003
|
-
*
|
|
4004
|
-
* @example
|
|
4005
|
-
* ```typescript
|
|
4006
|
-
* import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js';
|
|
4007
|
-
* import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';
|
|
4008
|
-
* import { UnrealBloomPass } from 'three/addons/postprocessing/UnrealBloomPass.js';
|
|
4009
|
-
* import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js';
|
|
4010
|
-
*
|
|
4011
|
-
* const composer = new EffectComposer(renderer);
|
|
4012
|
-
* const renderPass = new RenderPass(sceneA, camera);
|
|
4013
|
-
* composer.addPass(renderPass);
|
|
4014
|
-
*
|
|
4015
|
-
* // Pass ShaderPass to enable built-in blur and fade effects
|
|
4016
|
-
* const sceneTransitionFX = new SceneTransitionFX(renderer, composer, ShaderPass);
|
|
4017
|
-
*
|
|
4018
|
-
* // Blur and fade transitions work out of the box
|
|
4019
|
-
* sceneTransitionFX.blur(sceneA, sceneB, camera, { duration: 2000 });
|
|
4020
|
-
* sceneTransitionFX.fade(sceneA, sceneB, camera, { duration: 2000, color: 0x000000 });
|
|
4021
|
-
*
|
|
4022
|
-
* // For bloom, provide the pass manually
|
|
4023
|
-
* const bloomPass = new UnrealBloomPass(new THREE.Vector2(width, height), 0, 0.4, 0.85);
|
|
4024
|
-
* bloomPass.enabled = false;
|
|
4025
|
-
* composer.addPass(bloomPass);
|
|
4026
|
-
* sceneTransitionFX.setBloomPass(bloomPass);
|
|
4027
|
-
* sceneTransitionFX.bloom(sceneA, sceneB, camera, { duration: 2000, maxBloom: 15.0 });
|
|
4028
|
-
* ```
|
|
4029
|
-
*/
|
|
4030
|
-
export declare class SceneTransitionFX {
|
|
4031
|
-
private renderer;
|
|
4032
|
-
private composer;
|
|
4033
|
-
private currentScene;
|
|
4034
|
-
private targetScene;
|
|
4035
|
-
private camera;
|
|
4036
|
-
private transitionProgress;
|
|
4037
|
-
private transitionDuration;
|
|
4038
|
-
private transitionStartTime;
|
|
4039
|
-
private isTransitioning;
|
|
4040
|
-
private transitionType;
|
|
4041
|
-
private easingFunction;
|
|
4042
|
-
private renderPass;
|
|
4043
|
-
private bloomPass;
|
|
4044
|
-
private glitchPass;
|
|
4045
|
-
private blurPass;
|
|
4046
|
-
private fadePass;
|
|
4047
|
-
private maxBloomStrength;
|
|
4048
|
-
private maxBlurAmount;
|
|
4049
|
-
private maxGlitchIntensity;
|
|
4050
|
-
private fadeColor;
|
|
4051
|
-
private onUpdateCallback?;
|
|
4052
|
-
private onCompleteCallback?;
|
|
4053
|
-
constructor(renderer: THREE.WebGLRenderer, composer: any, ShaderPass?: any);
|
|
4054
|
-
/**
|
|
4055
|
-
* Create default shader passes for blur and fade effects
|
|
4056
|
-
*/
|
|
4057
|
-
private createDefaultPasses;
|
|
4058
|
-
/**
|
|
4059
|
-
* Set the bloom pass for bloom transitions
|
|
4060
|
-
*/
|
|
4061
|
-
setBloomPass(bloomPass: any): void;
|
|
4062
|
-
/**
|
|
4063
|
-
* Set the glitch pass for glitch transitions
|
|
4064
|
-
*/
|
|
4065
|
-
setGlitchPass(glitchPass: any): void;
|
|
4066
|
-
/**
|
|
4067
|
-
* Set the blur pass for blur transitions
|
|
4068
|
-
*/
|
|
4069
|
-
setBlurPass(blurPass: any): void;
|
|
4070
|
-
/**
|
|
4071
|
-
* Set the fade pass for fade transitions
|
|
4072
|
-
*/
|
|
4073
|
-
setFadePass(fadePass: any): void;
|
|
4074
|
-
/**
|
|
4075
|
-
* Bloom transition: Bright bloom effect that peaks at transition midpoint
|
|
4076
|
-
*/
|
|
4077
|
-
bloom(fromScene: THREE.Scene, toScene: THREE.Scene, camera: THREE.Camera, options?: BloomTransitionOptions): void;
|
|
4078
|
-
/**
|
|
4079
|
-
* Blur transition: Progressively blur scenes to oblivion and back
|
|
4080
|
-
*/
|
|
4081
|
-
blur(fromScene: THREE.Scene, toScene: THREE.Scene, camera: THREE.Camera, options?: BlurTransitionOptions): void;
|
|
4082
|
-
/**
|
|
4083
|
-
* Fade transition: Classic fade through a color (black, white, or custom)
|
|
4084
|
-
*/
|
|
4085
|
-
fade(fromScene: THREE.Scene, toScene: THREE.Scene, camera: THREE.Camera, options?: FadeTransitionOptions_2): void;
|
|
4086
|
-
/**
|
|
4087
|
-
* Glitch transition: Digital distortion effect
|
|
4088
|
-
*/
|
|
4089
|
-
glitch(fromScene: THREE.Scene, toScene: THREE.Scene, camera: THREE.Camera, options?: GlitchTransitionOptions): void;
|
|
4090
|
-
/**
|
|
4091
|
-
* Internal method to start a transition
|
|
4092
|
-
*/
|
|
4093
|
-
private startTransition;
|
|
4094
|
-
/**
|
|
4095
|
-
* Update the transition. Call this in your render loop.
|
|
4096
|
-
*/
|
|
4097
|
-
update(): void;
|
|
4098
|
-
/**
|
|
4099
|
-
* Render using the effect composer
|
|
4100
|
-
*/
|
|
4101
|
-
render(): void;
|
|
4102
|
-
/**
|
|
4103
|
-
* Get the current active scene
|
|
4104
|
-
*/
|
|
4105
|
-
getCurrentScene(): THREE.Scene | null;
|
|
4106
|
-
/**
|
|
4107
|
-
* Check if a transition is currently in progress
|
|
4108
|
-
*/
|
|
4109
|
-
getIsTransitioning(): boolean;
|
|
4110
|
-
/**
|
|
4111
|
-
* Get the current transition progress (0-1)
|
|
4112
|
-
*/
|
|
4113
|
-
getProgress(): number;
|
|
4114
|
-
/**
|
|
4115
|
-
* Set the current scene (useful for initialization)
|
|
4116
|
-
*/
|
|
4117
|
-
setCurrentScene(scene: THREE.Scene): void;
|
|
4118
|
-
/**
|
|
4119
|
-
* Resize the composer when the renderer size changes
|
|
4120
|
-
*/
|
|
4121
|
-
setSize(width: number, height: number): void;
|
|
4122
|
-
/**
|
|
4123
|
-
* Dispose of resources
|
|
4124
|
-
*/
|
|
4125
|
-
dispose(): void;
|
|
4126
|
-
}
|
|
4127
|
-
|
|
4128
|
-
export declare interface SceneTransitionFXOptions {
|
|
4129
|
-
duration?: number;
|
|
4130
|
-
easing?: EasingFunction | keyof typeof Easing;
|
|
4131
|
-
onUpdate?: (progress: number) => void;
|
|
4132
|
-
onComplete?: () => void;
|
|
4133
|
-
}
|
|
4134
|
-
|
|
4135
|
-
export declare interface SceneTransitionOptions {
|
|
4136
|
-
duration?: number;
|
|
4137
|
-
easing?: EasingFunction | keyof typeof Easing;
|
|
4138
|
-
onUpdate?: (progress: number) => void;
|
|
4139
|
-
onComplete?: () => void;
|
|
4140
|
-
}
|
|
4141
|
-
|
|
4142
3475
|
/**
|
|
4143
3476
|
* Set a random interval that will call the callback function with a random delay between minDelay and maxDelay.
|
|
4144
3477
|
*
|
|
@@ -4490,6 +3823,8 @@ export declare class StarFieldEffect extends Object3D {
|
|
|
4490
3823
|
private readonly baseSize;
|
|
4491
3824
|
private readonly baseScales?;
|
|
4492
3825
|
private readonly twinklePhases?;
|
|
3826
|
+
/** Untwinkled per-point RGB (points style), multiplied by each star's pulse each frame. */
|
|
3827
|
+
private baseColors?;
|
|
4493
3828
|
private spriteTexture?;
|
|
4494
3829
|
private readonly dummy;
|
|
4495
3830
|
constructor(options?: StarFieldEffectOptions);
|
|
@@ -4501,8 +3836,9 @@ export declare class StarFieldEffect extends Object3D {
|
|
|
4501
3836
|
/**
|
|
4502
3837
|
* Animate twinkling. No-op when `twinkle` is `false`.
|
|
4503
3838
|
*
|
|
4504
|
-
*
|
|
4505
|
-
*
|
|
3839
|
+
* Both styles pulse with a per-star phase offset so stars twinkle out of sync:
|
|
3840
|
+
* points modulate per-point brightness (via the color attribute), burst pulses
|
|
3841
|
+
* each instance scale. Pass elapsed time in seconds (defaults to `performance.now()`).
|
|
4506
3842
|
*/
|
|
4507
3843
|
update(elapsed?: number): void;
|
|
4508
3844
|
private createPointsField;
|
|
@@ -4604,6 +3940,130 @@ export declare interface StoneFencePostOptions extends StoneFencePostGeometryOpt
|
|
|
4604
3940
|
color?: ColorRepresentation;
|
|
4605
3941
|
}
|
|
4606
3942
|
|
|
3943
|
+
/**
|
|
3944
|
+
* Rounded terrain mound prefab — a {@link TerrainMoundGeometry} with a matte,
|
|
3945
|
+
* flat-shaded material. Base sits on Y=0; drop it into a scene as a diorama
|
|
3946
|
+
* ground or a small rise. Casts and receives shadows.
|
|
3947
|
+
*/
|
|
3948
|
+
export declare class TerrainMound extends Mesh<TerrainMoundGeometry, MeshStandardMaterial> {
|
|
3949
|
+
readonly radius: number;
|
|
3950
|
+
readonly height: number;
|
|
3951
|
+
constructor({ color, flatShading, ...geometryOptions }?: TerrainMoundOptions);
|
|
3952
|
+
}
|
|
3953
|
+
|
|
3954
|
+
/**
|
|
3955
|
+
* Rounded terrain cap — a circular disc bulged into a gentle dome, then broken up
|
|
3956
|
+
* with coherent fbm noise so it reads as rolling terrain rather than a smooth lens.
|
|
3957
|
+
* The relief tapers to a clean circular rim seated on the Y=0 plane.
|
|
3958
|
+
*
|
|
3959
|
+
* Displacement is baked into real vertices (no shader), so shadows, raycasts, and
|
|
3960
|
+
* any physics collider derived from the mesh match exactly what's drawn — and it
|
|
3961
|
+
* renders identically on WebGL and WebGPU/TSL. Pair with a `flatShading` material
|
|
3962
|
+
* for a faceted low-poly look; the coherent noise keeps neighboring vertices moving
|
|
3963
|
+
* together, so faces never tear.
|
|
3964
|
+
*
|
|
3965
|
+
* Local frame: base on Y=0, peak toward +Y, centered on the origin.
|
|
3966
|
+
*/
|
|
3967
|
+
export declare class TerrainMoundGeometry extends BufferGeometry {
|
|
3968
|
+
readonly radius: number;
|
|
3969
|
+
readonly height: number;
|
|
3970
|
+
constructor({ radius, height, radialSegments, angularSegments, noiseHeight, noiseScale, octaves, persistence, rim, seed, }?: TerrainMoundGeometryOptions);
|
|
3971
|
+
}
|
|
3972
|
+
|
|
3973
|
+
export declare interface TerrainMoundGeometryOptions {
|
|
3974
|
+
/** Footprint radius (world units). Defaults to `8`. */
|
|
3975
|
+
radius?: number;
|
|
3976
|
+
/** Dome peak height at the center. Defaults to `1.2`. */
|
|
3977
|
+
height?: number;
|
|
3978
|
+
/** Concentric rings from center to rim. Defaults to `40`. */
|
|
3979
|
+
radialSegments?: number;
|
|
3980
|
+
/** Segments around the circumference. Defaults to `64`. */
|
|
3981
|
+
angularSegments?: number;
|
|
3982
|
+
/** Amplitude of the terrain relief added on top of the dome. Defaults to `0.5`. */
|
|
3983
|
+
noiseHeight?: number;
|
|
3984
|
+
/** Noise frequency — higher packs more, smaller bumps into the footprint. Defaults to `0.35`. */
|
|
3985
|
+
noiseScale?: number;
|
|
3986
|
+
/** fbm octaves (detail layers). Defaults to `4`. */
|
|
3987
|
+
octaves?: number;
|
|
3988
|
+
/** fbm gain per octave (0–1); lower is smoother, higher is rougher. Defaults to `0.5`. */
|
|
3989
|
+
persistence?: number;
|
|
3990
|
+
/** Normalized radius (0–1) where the rim begins fading relief to a flat edge. Defaults to `0.82`. */
|
|
3991
|
+
rim?: number;
|
|
3992
|
+
/** Seed for reproducible terrain. Defaults to `1`. */
|
|
3993
|
+
seed?: number;
|
|
3994
|
+
}
|
|
3995
|
+
|
|
3996
|
+
export declare interface TerrainMoundOptions extends TerrainMoundGeometryOptions {
|
|
3997
|
+
/** Surface tint. Defaults to `#3a5a3a`. */
|
|
3998
|
+
color?: ColorRepresentation;
|
|
3999
|
+
/** Faceted low-poly shading. Defaults to `true`. */
|
|
4000
|
+
flatShading?: boolean;
|
|
4001
|
+
}
|
|
4002
|
+
|
|
4003
|
+
/**
|
|
4004
|
+
* Rectangular terrain patch prefab — a {@link TerrainPlaneGeometry} with a matte,
|
|
4005
|
+
* flat-shaded material. Base grid on Y=0; drop it into a scene as a diorama ground
|
|
4006
|
+
* or a tileable terrain field. Casts and receives shadows.
|
|
4007
|
+
*/
|
|
4008
|
+
export declare class TerrainPlane extends Mesh<TerrainPlaneGeometry, MeshStandardMaterial> {
|
|
4009
|
+
readonly width: number;
|
|
4010
|
+
readonly depth: number;
|
|
4011
|
+
constructor({ color, flatShading, ...geometryOptions }?: TerrainPlaneOptions);
|
|
4012
|
+
}
|
|
4013
|
+
|
|
4014
|
+
/**
|
|
4015
|
+
* Rectangular terrain patch — a flat grid displaced on Y by the shared coherent fbm
|
|
4016
|
+
* sampler ({@link fbm2}). The rectangular counterpart to {@link TerrainMoundGeometry}:
|
|
4017
|
+
* same noise strategy, grid layout instead of a radial disc.
|
|
4018
|
+
*
|
|
4019
|
+
* A pure heightfield (Y is single-valued per XZ) so faces can never fold, and it's
|
|
4020
|
+
* baked into real vertices — shadows, raycasts, and physics colliders match what's
|
|
4021
|
+
* drawn, on WebGL and WebGPU/TSL alike. Pair with a `flatShading` material for a
|
|
4022
|
+
* faceted low-poly look. Leave `edgeFalloff` at `0` for a tileable field; raise it to
|
|
4023
|
+
* seat the edges flat at Y=0.
|
|
4024
|
+
*
|
|
4025
|
+
* Local frame: base grid on Y=0, relief toward ±Y, centered on the origin.
|
|
4026
|
+
*/
|
|
4027
|
+
export declare class TerrainPlaneGeometry extends BufferGeometry {
|
|
4028
|
+
readonly width: number;
|
|
4029
|
+
readonly depth: number;
|
|
4030
|
+
constructor({ width, depth, widthSegments, depthSegments, noiseHeight, noiseScale, octaves, persistence, edgeFalloff, seed, }?: TerrainPlaneGeometryOptions);
|
|
4031
|
+
}
|
|
4032
|
+
|
|
4033
|
+
export declare interface TerrainPlaneGeometryOptions {
|
|
4034
|
+
/** Extent along X (world units). Defaults to `16`. */
|
|
4035
|
+
width?: number;
|
|
4036
|
+
/** Extent along Z (world units). Defaults to `16`. */
|
|
4037
|
+
depth?: number;
|
|
4038
|
+
/** Grid segments along X. Defaults to `48`. */
|
|
4039
|
+
widthSegments?: number;
|
|
4040
|
+
/** Grid segments along Z. Defaults to `48`. */
|
|
4041
|
+
depthSegments?: number;
|
|
4042
|
+
/** Amplitude of the terrain relief (world units, ±). Defaults to `0.8`. */
|
|
4043
|
+
noiseHeight?: number;
|
|
4044
|
+
/** Noise frequency — higher packs more, smaller features into the footprint. Defaults to `0.35`. */
|
|
4045
|
+
noiseScale?: number;
|
|
4046
|
+
/** fbm octaves (detail layers). Defaults to `4`. */
|
|
4047
|
+
octaves?: number;
|
|
4048
|
+
/** fbm gain per octave (0–1); lower is smoother, higher is rougher. Defaults to `0.5`. */
|
|
4049
|
+
persistence?: number;
|
|
4050
|
+
/**
|
|
4051
|
+
* Border band (0–1 fraction of the half-extent) over which relief fades to a flat
|
|
4052
|
+
* edge at Y=0. `0` leaves a raw, seamless heightfield (tileable); higher values
|
|
4053
|
+
* seat the slab like a contained diorama patch. Defaults to `0`.
|
|
4054
|
+
*/
|
|
4055
|
+
edgeFalloff?: number;
|
|
4056
|
+
/** Seed for reproducible terrain. Defaults to `1`. */
|
|
4057
|
+
seed?: number;
|
|
4058
|
+
}
|
|
4059
|
+
|
|
4060
|
+
export declare interface TerrainPlaneOptions extends TerrainPlaneGeometryOptions {
|
|
4061
|
+
/** Surface tint. Defaults to `#3a5a3a`. */
|
|
4062
|
+
color?: ColorRepresentation;
|
|
4063
|
+
/** Faceted low-poly shading. Defaults to `true`. */
|
|
4064
|
+
flatShading?: boolean;
|
|
4065
|
+
}
|
|
4066
|
+
|
|
4607
4067
|
/**
|
|
4608
4068
|
* Material indices
|
|
4609
4069
|
* 0: Base
|
|
@@ -4725,20 +4185,6 @@ export declare interface TreeOptions extends TreeGeometryOptions {
|
|
|
4725
4185
|
*/
|
|
4726
4186
|
export declare const twistBrush: <T extends BufferGeometry>(geometry: T, position: Vector3, radius: number, strength: number, direction?: Vector3, falloffFn?: (distance: number, radius: number) => number) => void;
|
|
4727
4187
|
|
|
4728
|
-
/**
|
|
4729
|
-
* Updates the time uniform of the material's shader to animate the noise effect.
|
|
4730
|
-
* @param {Material} material - The material to update.
|
|
4731
|
-
* @param {number} deltaTime - The time increment to add.
|
|
4732
|
-
*/
|
|
4733
|
-
export declare function updateNoiseDisplacementTime<T extends Material>(material: T, deltaTime: number): void;
|
|
4734
|
-
|
|
4735
|
-
/**
|
|
4736
|
-
* Updates the time uniform of the material's shader to animate the water effect.
|
|
4737
|
-
* @param {Material} material - The material to update.
|
|
4738
|
-
* @param {number} deltaTime - The time increment to add.
|
|
4739
|
-
*/
|
|
4740
|
-
export declare function updateWaterDisplacementTime<T extends Material>(material: T, deltaTime: number): void;
|
|
4741
|
-
|
|
4742
4188
|
/**
|
|
4743
4189
|
* Wall-mounted oil-lamp sconce — iron mount and cap/bowl frame around an
|
|
4744
4190
|
* emissive glass chimney. Pair {@link GlowHalo} and {@link FlameFlickerEffect}
|