three-low-poly 0.9.27 → 0.9.28
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 +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +311 -77
- package/dist/index.iife.js +8 -8
- package/dist/index.iife.js.map +1 -1
- package/dist/index.mjs +1085 -886
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -648,6 +648,59 @@ export declare interface BookshelfOptions extends BookshelfGeometryOptions {
|
|
|
648
648
|
color?: ColorRepresentation;
|
|
649
649
|
}
|
|
650
650
|
|
|
651
|
+
/**
|
|
652
|
+
* Boulder prefab — a {@link BoulderGeometry} lumped by coherent 3D noise, with a
|
|
653
|
+
* matte flat-shaded stone material. Centered on the origin; casts and receives
|
|
654
|
+
* shadows. Vary `seed` per instance for a field of unique boulders.
|
|
655
|
+
*/
|
|
656
|
+
export declare class Boulder extends Mesh<BoulderGeometry, MeshStandardMaterial> {
|
|
657
|
+
readonly radius: number;
|
|
658
|
+
constructor({ color, flatShading, ...geometryOptions }?: BoulderOptions);
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* Boulder — an icosphere lumped by coherent 3D fbm ({@link fbm3}) displaced along
|
|
663
|
+
* each vertex's radial direction. The 3D counterpart to the terrain heightfields:
|
|
664
|
+
* same noise strategy, applied over a closed surface instead of a height map.
|
|
665
|
+
*
|
|
666
|
+
* The icosphere is welded (`mergeVertices` after stripping seam UVs) so coincident
|
|
667
|
+
* vertices share one displacement — the coherent noise then moves neighbors together,
|
|
668
|
+
* so the surface stays watertight and never cracks (the failure mode of displacing a
|
|
669
|
+
* non-indexed polyhedron along normals). Real baked geometry, so shadows, raycasts,
|
|
670
|
+
* and physics colliders match what's drawn, on WebGL and WebGPU/TSL alike.
|
|
671
|
+
*
|
|
672
|
+
* Centered on the origin. Pair with a `flatShading` material for a faceted low-poly
|
|
673
|
+
* look. Vary `seed` per instance to fill a field with unique boulders.
|
|
674
|
+
*/
|
|
675
|
+
export declare class BoulderGeometry extends BufferGeometry {
|
|
676
|
+
readonly radius: number;
|
|
677
|
+
constructor({ radius, detail, noiseHeight, noiseScale, octaves, persistence, seed, }?: BoulderGeometryOptions);
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
export declare interface BoulderGeometryOptions {
|
|
681
|
+
/** Base radius before displacement (world units). Defaults to `1`. */
|
|
682
|
+
radius?: number;
|
|
683
|
+
/** Icosahedron subdivision — more detail = more, finer facets. Defaults to `2`. */
|
|
684
|
+
detail?: number;
|
|
685
|
+
/** Radial relief amplitude (world units, ±). Keep below `radius`. Defaults to `0.35`. */
|
|
686
|
+
noiseHeight?: number;
|
|
687
|
+
/** Noise frequency over the unit sphere — higher packs more, smaller lumps. Defaults to `1.6`. */
|
|
688
|
+
noiseScale?: number;
|
|
689
|
+
/** fbm octaves (detail layers). Defaults to `3`. */
|
|
690
|
+
octaves?: number;
|
|
691
|
+
/** fbm gain per octave (0–1); lower is smoother, higher is rougher. Defaults to `0.5`. */
|
|
692
|
+
persistence?: number;
|
|
693
|
+
/** Seed for reproducible shape. Defaults to `1`. */
|
|
694
|
+
seed?: number;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
export declare interface BoulderOptions extends BoulderGeometryOptions {
|
|
698
|
+
/** Stone tint. Defaults to `#6f6f6f`. */
|
|
699
|
+
color?: ColorRepresentation;
|
|
700
|
+
/** Faceted low-poly shading. Defaults to `true`. */
|
|
701
|
+
flatShading?: boolean;
|
|
702
|
+
}
|
|
703
|
+
|
|
651
704
|
export declare enum BoxSide {
|
|
652
705
|
LEFT = "left",
|
|
653
706
|
RIGHT = "right",
|
|
@@ -1784,6 +1837,90 @@ export declare interface DollyClipOptions extends CameraClipTiming {
|
|
|
1784
1837
|
ease?: EasingFunction;
|
|
1785
1838
|
}
|
|
1786
1839
|
|
|
1840
|
+
/**
|
|
1841
|
+
* Fine dust drifting through a lit interior — tiny additive specks slowly
|
|
1842
|
+
* settling and wafting, twinkling as they catch the light and all but vanishing
|
|
1843
|
+
* in shadow. This is the thing that sells a light shaft as volumetric. Additive
|
|
1844
|
+
* spheres read the same from any angle, so no billboarding is needed.
|
|
1845
|
+
*
|
|
1846
|
+
* Call {@link DustMotesEffect.update} each frame with elapsed time in seconds.
|
|
1847
|
+
*
|
|
1848
|
+
* @example
|
|
1849
|
+
* ```typescript
|
|
1850
|
+
* const dust = new DustMotesEffect({
|
|
1851
|
+
* count: 150,
|
|
1852
|
+
* width: 8,
|
|
1853
|
+
* height: 9,
|
|
1854
|
+
* depth: 8,
|
|
1855
|
+
* color: "#aebfe6",
|
|
1856
|
+
* });
|
|
1857
|
+
* scene.add(dust);
|
|
1858
|
+
*
|
|
1859
|
+
* onFrame((dt) => dust.update(dt));
|
|
1860
|
+
* ```
|
|
1861
|
+
*/
|
|
1862
|
+
export declare class DustMotesEffect extends InstancedMesh {
|
|
1863
|
+
private readonly width;
|
|
1864
|
+
private readonly height;
|
|
1865
|
+
private readonly depth;
|
|
1866
|
+
private readonly floorY;
|
|
1867
|
+
private readonly waft;
|
|
1868
|
+
private readonly scaleMin;
|
|
1869
|
+
private readonly scaleMax;
|
|
1870
|
+
private readonly px;
|
|
1871
|
+
private readonly py;
|
|
1872
|
+
private readonly pz;
|
|
1873
|
+
private readonly settle;
|
|
1874
|
+
private readonly twinkle;
|
|
1875
|
+
private readonly phase;
|
|
1876
|
+
private readonly dummy;
|
|
1877
|
+
private clock;
|
|
1878
|
+
constructor(options?: DustMotesEffectOptions);
|
|
1879
|
+
/**
|
|
1880
|
+
* Advance the drift and twinkle. Pass elapsed frame time in seconds.
|
|
1881
|
+
*/
|
|
1882
|
+
update(dt: number): void;
|
|
1883
|
+
/** Release geometry and materials held by the field. */
|
|
1884
|
+
dispose(): this;
|
|
1885
|
+
private respawn;
|
|
1886
|
+
private writeMatrices;
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
export declare interface DustMotesEffectOptions {
|
|
1890
|
+
/** Number of dust instances. Defaults to `150`. */
|
|
1891
|
+
count?: number;
|
|
1892
|
+
/** Horizontal spread (world units). Defaults to `12`. */
|
|
1893
|
+
width?: number;
|
|
1894
|
+
/** Vertical spawn span (world units). Defaults to `8`. */
|
|
1895
|
+
height?: number;
|
|
1896
|
+
/** Depth spread (world units). Defaults to `12`. */
|
|
1897
|
+
depth?: number;
|
|
1898
|
+
/** World Y of the volume floor; motes respawn at the top after settling past it. Defaults to `0`. */
|
|
1899
|
+
floorY?: number;
|
|
1900
|
+
/** Speck tint. Defaults to `#aebfe6`. */
|
|
1901
|
+
color?: ColorRepresentation;
|
|
1902
|
+
/** Speck radius (world units). Defaults to `0.02`. */
|
|
1903
|
+
radius?: number;
|
|
1904
|
+
/** Base material opacity. Defaults to `0.9`. */
|
|
1905
|
+
opacity?: number;
|
|
1906
|
+
/** Override the default additive speck material. */
|
|
1907
|
+
material?: Material;
|
|
1908
|
+
/** Minimum settle (fall) speed (units/s). Defaults to `0.1`. */
|
|
1909
|
+
settleMin?: number;
|
|
1910
|
+
/** Maximum settle (fall) speed (units/s). Defaults to `0.35`. */
|
|
1911
|
+
settleMax?: number;
|
|
1912
|
+
/** Lateral waft amplitude (units/s). Defaults to `0.08`. */
|
|
1913
|
+
waft?: number;
|
|
1914
|
+
/** Smallest twinkle scale multiplier. Defaults to `0.6`. */
|
|
1915
|
+
scaleMin?: number;
|
|
1916
|
+
/** Largest twinkle scale multiplier. Defaults to `1.2`. */
|
|
1917
|
+
scaleMax?: number;
|
|
1918
|
+
/** Minimum twinkle frequency (rad/s). Defaults to `0.7`. */
|
|
1919
|
+
twinkleMin?: number;
|
|
1920
|
+
/** Maximum twinkle frequency (rad/s). Defaults to `1.6`. */
|
|
1921
|
+
twinkleMax?: number;
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1787
1924
|
/**
|
|
1788
1925
|
* Easing functions for interpolating values over time.
|
|
1789
1926
|
*
|
|
@@ -2618,44 +2755,6 @@ export declare function hexToHsl(hex: number): [number, number, number];
|
|
|
2618
2755
|
*/
|
|
2619
2756
|
export declare function hexToRgb(hex: number): [number, number, number];
|
|
2620
2757
|
|
|
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
2758
|
/**
|
|
2660
2759
|
* Example usage:
|
|
2661
2760
|
* ```
|
|
@@ -3031,43 +3130,6 @@ export declare interface MossyRockOptions extends MossyRockGeometryOptions {
|
|
|
3031
3130
|
mossOpacity?: number;
|
|
3032
3131
|
}
|
|
3033
3132
|
|
|
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
3133
|
/**
|
|
3072
3134
|
* Fast seeded PRNG — portfolio Gotham/Water parity.
|
|
3073
3135
|
* Returns a closure yielding floats in [0, 1).
|
|
@@ -3844,6 +3906,51 @@ export declare interface RowOfBooksOptions<T extends Material = Material> {
|
|
|
3844
3906
|
seed?: number;
|
|
3845
3907
|
}
|
|
3846
3908
|
|
|
3909
|
+
/**
|
|
3910
|
+
* Scatter a field of instanced boulders inside a horizontal bounds region — a "created
|
|
3911
|
+
* layer" of the noise-lumped {@link BoulderGeometry}. Unlike {@link scatterRocks}, which
|
|
3912
|
+
* rotates a single shared shape, this generates several distinct boulder geometries
|
|
3913
|
+
* (see `variants`) and distributes instances across them, so the field reads as unique
|
|
3914
|
+
* rocks while staying to a few draw calls.
|
|
3915
|
+
*
|
|
3916
|
+
* Returns a {@link Group} of {@link InstancedMesh}es (one per variant), each sharing the
|
|
3917
|
+
* stone material. Pass a `seed` for a reproducible field. Dispose each child's geometry
|
|
3918
|
+
* and the shared material when removing it.
|
|
3919
|
+
*
|
|
3920
|
+
* @example
|
|
3921
|
+
* ```ts
|
|
3922
|
+
* const boulders = scatterBoulders({ count: 24, width: 12, depth: 12, seed: 1337 });
|
|
3923
|
+
* scene.add(boulders);
|
|
3924
|
+
* ```
|
|
3925
|
+
*/
|
|
3926
|
+
export declare function scatterBoulders({ count, width, depth, heightJitter, scaleMin, scaleMax, seed, radius, detail, noiseHeight, noiseScale, octaves, persistence, variants, material, color, }?: ScatterBouldersOptions): Group;
|
|
3927
|
+
|
|
3928
|
+
export declare interface ScatterBouldersOptions extends RockScatterPlacementOptions {
|
|
3929
|
+
/** Base radius for each boulder geometry. Defaults to `1`. */
|
|
3930
|
+
radius?: number;
|
|
3931
|
+
/** Icosphere subdivision per boulder. Defaults to `2`. */
|
|
3932
|
+
detail?: number;
|
|
3933
|
+
/** Radial relief amplitude per boulder. Defaults to `0.35`. */
|
|
3934
|
+
noiseHeight?: number;
|
|
3935
|
+
/** Noise frequency per boulder. Defaults to `1.6`. */
|
|
3936
|
+
noiseScale?: number;
|
|
3937
|
+
/** fbm octaves per boulder. Defaults to `3`. */
|
|
3938
|
+
octaves?: number;
|
|
3939
|
+
/** fbm gain per octave. Defaults to `0.5`. */
|
|
3940
|
+
persistence?: number;
|
|
3941
|
+
/**
|
|
3942
|
+
* Distinct boulder geometries generated and distributed across the field. Each is
|
|
3943
|
+
* a real, unique lumped shape (unlike rotating one shared mesh); instances round-robin
|
|
3944
|
+
* across them, so the field stays batch-friendly (one draw call per variant).
|
|
3945
|
+
* Defaults to `4`.
|
|
3946
|
+
*/
|
|
3947
|
+
variants?: number;
|
|
3948
|
+
/** Override the default stone material (shared across all instances). */
|
|
3949
|
+
material?: Material;
|
|
3950
|
+
/** Stone tint when `material` is omitted. Defaults to `#6f6f6f`. */
|
|
3951
|
+
color?: ColorRepresentation;
|
|
3952
|
+
}
|
|
3953
|
+
|
|
3847
3954
|
/**
|
|
3848
3955
|
* Scatter instanced mossy rocks inside a horizontal bounds region.
|
|
3849
3956
|
*
|
|
@@ -4490,6 +4597,8 @@ export declare class StarFieldEffect extends Object3D {
|
|
|
4490
4597
|
private readonly baseSize;
|
|
4491
4598
|
private readonly baseScales?;
|
|
4492
4599
|
private readonly twinklePhases?;
|
|
4600
|
+
/** Untwinkled per-point RGB (points style), multiplied by each star's pulse each frame. */
|
|
4601
|
+
private baseColors?;
|
|
4493
4602
|
private spriteTexture?;
|
|
4494
4603
|
private readonly dummy;
|
|
4495
4604
|
constructor(options?: StarFieldEffectOptions);
|
|
@@ -4501,8 +4610,9 @@ export declare class StarFieldEffect extends Object3D {
|
|
|
4501
4610
|
/**
|
|
4502
4611
|
* Animate twinkling. No-op when `twinkle` is `false`.
|
|
4503
4612
|
*
|
|
4504
|
-
*
|
|
4505
|
-
*
|
|
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()`).
|
|
4506
4616
|
*/
|
|
4507
4617
|
update(elapsed?: number): void;
|
|
4508
4618
|
private createPointsField;
|
|
@@ -4604,6 +4714,130 @@ export declare interface StoneFencePostOptions extends StoneFencePostGeometryOpt
|
|
|
4604
4714
|
color?: ColorRepresentation;
|
|
4605
4715
|
}
|
|
4606
4716
|
|
|
4717
|
+
/**
|
|
4718
|
+
* Rounded terrain mound prefab — a {@link TerrainMoundGeometry} with a matte,
|
|
4719
|
+
* flat-shaded material. Base sits on Y=0; drop it into a scene as a diorama
|
|
4720
|
+
* ground or a small rise. Casts and receives shadows.
|
|
4721
|
+
*/
|
|
4722
|
+
export declare class TerrainMound extends Mesh<TerrainMoundGeometry, MeshStandardMaterial> {
|
|
4723
|
+
readonly radius: number;
|
|
4724
|
+
readonly height: number;
|
|
4725
|
+
constructor({ color, flatShading, ...geometryOptions }?: TerrainMoundOptions);
|
|
4726
|
+
}
|
|
4727
|
+
|
|
4728
|
+
/**
|
|
4729
|
+
* Rounded terrain cap — a circular disc bulged into a gentle dome, then broken up
|
|
4730
|
+
* with coherent fbm noise so it reads as rolling terrain rather than a smooth lens.
|
|
4731
|
+
* The relief tapers to a clean circular rim seated on the Y=0 plane.
|
|
4732
|
+
*
|
|
4733
|
+
* Displacement is baked into real vertices (no shader), so shadows, raycasts, and
|
|
4734
|
+
* any physics collider derived from the mesh match exactly what's drawn — and it
|
|
4735
|
+
* renders identically on WebGL and WebGPU/TSL. Pair with a `flatShading` material
|
|
4736
|
+
* for a faceted low-poly look; the coherent noise keeps neighboring vertices moving
|
|
4737
|
+
* together, so faces never tear.
|
|
4738
|
+
*
|
|
4739
|
+
* Local frame: base on Y=0, peak toward +Y, centered on the origin.
|
|
4740
|
+
*/
|
|
4741
|
+
export declare class TerrainMoundGeometry extends BufferGeometry {
|
|
4742
|
+
readonly radius: number;
|
|
4743
|
+
readonly height: number;
|
|
4744
|
+
constructor({ radius, height, radialSegments, angularSegments, noiseHeight, noiseScale, octaves, persistence, rim, seed, }?: TerrainMoundGeometryOptions);
|
|
4745
|
+
}
|
|
4746
|
+
|
|
4747
|
+
export declare interface TerrainMoundGeometryOptions {
|
|
4748
|
+
/** Footprint radius (world units). Defaults to `8`. */
|
|
4749
|
+
radius?: number;
|
|
4750
|
+
/** Dome peak height at the center. Defaults to `1.2`. */
|
|
4751
|
+
height?: number;
|
|
4752
|
+
/** Concentric rings from center to rim. Defaults to `40`. */
|
|
4753
|
+
radialSegments?: number;
|
|
4754
|
+
/** Segments around the circumference. Defaults to `64`. */
|
|
4755
|
+
angularSegments?: number;
|
|
4756
|
+
/** Amplitude of the terrain relief added on top of the dome. Defaults to `0.5`. */
|
|
4757
|
+
noiseHeight?: number;
|
|
4758
|
+
/** Noise frequency — higher packs more, smaller bumps into the footprint. Defaults to `0.35`. */
|
|
4759
|
+
noiseScale?: number;
|
|
4760
|
+
/** fbm octaves (detail layers). Defaults to `4`. */
|
|
4761
|
+
octaves?: number;
|
|
4762
|
+
/** fbm gain per octave (0–1); lower is smoother, higher is rougher. Defaults to `0.5`. */
|
|
4763
|
+
persistence?: number;
|
|
4764
|
+
/** Normalized radius (0–1) where the rim begins fading relief to a flat edge. Defaults to `0.82`. */
|
|
4765
|
+
rim?: number;
|
|
4766
|
+
/** Seed for reproducible terrain. Defaults to `1`. */
|
|
4767
|
+
seed?: number;
|
|
4768
|
+
}
|
|
4769
|
+
|
|
4770
|
+
export declare interface TerrainMoundOptions extends TerrainMoundGeometryOptions {
|
|
4771
|
+
/** Surface tint. Defaults to `#3a5a3a`. */
|
|
4772
|
+
color?: ColorRepresentation;
|
|
4773
|
+
/** Faceted low-poly shading. Defaults to `true`. */
|
|
4774
|
+
flatShading?: boolean;
|
|
4775
|
+
}
|
|
4776
|
+
|
|
4777
|
+
/**
|
|
4778
|
+
* Rectangular terrain patch prefab — a {@link TerrainPlaneGeometry} with a matte,
|
|
4779
|
+
* flat-shaded material. Base grid on Y=0; drop it into a scene as a diorama ground
|
|
4780
|
+
* or a tileable terrain field. Casts and receives shadows.
|
|
4781
|
+
*/
|
|
4782
|
+
export declare class TerrainPlane extends Mesh<TerrainPlaneGeometry, MeshStandardMaterial> {
|
|
4783
|
+
readonly width: number;
|
|
4784
|
+
readonly depth: number;
|
|
4785
|
+
constructor({ color, flatShading, ...geometryOptions }?: TerrainPlaneOptions);
|
|
4786
|
+
}
|
|
4787
|
+
|
|
4788
|
+
/**
|
|
4789
|
+
* Rectangular terrain patch — a flat grid displaced on Y by the shared coherent fbm
|
|
4790
|
+
* sampler ({@link fbm2}). The rectangular counterpart to {@link TerrainMoundGeometry}:
|
|
4791
|
+
* same noise strategy, grid layout instead of a radial disc.
|
|
4792
|
+
*
|
|
4793
|
+
* A pure heightfield (Y is single-valued per XZ) so faces can never fold, and it's
|
|
4794
|
+
* baked into real vertices — shadows, raycasts, and physics colliders match what's
|
|
4795
|
+
* drawn, on WebGL and WebGPU/TSL alike. Pair with a `flatShading` material for a
|
|
4796
|
+
* faceted low-poly look. Leave `edgeFalloff` at `0` for a tileable field; raise it to
|
|
4797
|
+
* seat the edges flat at Y=0.
|
|
4798
|
+
*
|
|
4799
|
+
* Local frame: base grid on Y=0, relief toward ±Y, centered on the origin.
|
|
4800
|
+
*/
|
|
4801
|
+
export declare class TerrainPlaneGeometry extends BufferGeometry {
|
|
4802
|
+
readonly width: number;
|
|
4803
|
+
readonly depth: number;
|
|
4804
|
+
constructor({ width, depth, widthSegments, depthSegments, noiseHeight, noiseScale, octaves, persistence, edgeFalloff, seed, }?: TerrainPlaneGeometryOptions);
|
|
4805
|
+
}
|
|
4806
|
+
|
|
4807
|
+
export declare interface TerrainPlaneGeometryOptions {
|
|
4808
|
+
/** Extent along X (world units). Defaults to `16`. */
|
|
4809
|
+
width?: number;
|
|
4810
|
+
/** Extent along Z (world units). Defaults to `16`. */
|
|
4811
|
+
depth?: number;
|
|
4812
|
+
/** Grid segments along X. Defaults to `48`. */
|
|
4813
|
+
widthSegments?: number;
|
|
4814
|
+
/** Grid segments along Z. Defaults to `48`. */
|
|
4815
|
+
depthSegments?: number;
|
|
4816
|
+
/** Amplitude of the terrain relief (world units, ±). Defaults to `0.8`. */
|
|
4817
|
+
noiseHeight?: number;
|
|
4818
|
+
/** Noise frequency — higher packs more, smaller features into the footprint. Defaults to `0.35`. */
|
|
4819
|
+
noiseScale?: number;
|
|
4820
|
+
/** fbm octaves (detail layers). Defaults to `4`. */
|
|
4821
|
+
octaves?: number;
|
|
4822
|
+
/** fbm gain per octave (0–1); lower is smoother, higher is rougher. Defaults to `0.5`. */
|
|
4823
|
+
persistence?: number;
|
|
4824
|
+
/**
|
|
4825
|
+
* Border band (0–1 fraction of the half-extent) over which relief fades to a flat
|
|
4826
|
+
* edge at Y=0. `0` leaves a raw, seamless heightfield (tileable); higher values
|
|
4827
|
+
* seat the slab like a contained diorama patch. Defaults to `0`.
|
|
4828
|
+
*/
|
|
4829
|
+
edgeFalloff?: number;
|
|
4830
|
+
/** Seed for reproducible terrain. Defaults to `1`. */
|
|
4831
|
+
seed?: number;
|
|
4832
|
+
}
|
|
4833
|
+
|
|
4834
|
+
export declare interface TerrainPlaneOptions extends TerrainPlaneGeometryOptions {
|
|
4835
|
+
/** Surface tint. Defaults to `#3a5a3a`. */
|
|
4836
|
+
color?: ColorRepresentation;
|
|
4837
|
+
/** Faceted low-poly shading. Defaults to `true`. */
|
|
4838
|
+
flatShading?: boolean;
|
|
4839
|
+
}
|
|
4840
|
+
|
|
4607
4841
|
/**
|
|
4608
4842
|
* Material indices
|
|
4609
4843
|
* 0: Base
|