genshin-engine 3.6.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/LICENSE +201 -0
- package/README.md +83 -0
- package/dist/index.d.ts +515 -0
- package/dist/index.js +1258 -0
- package/package.json +68 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
import { BufferAttribute, BufferGeometry, Camera, Color, ColorRepresentation, Data3DTexture, DataTexture, DirectionalLight, Frustum, HemisphereLight, InstancedBufferGeometry, OrthographicCamera, Scene, Vector2, Vector3, Vector3Like } from "three";
|
|
2
|
+
import { CSMShadowNode } from "three/examples/jsm/csm/CSMShadowNode.js";
|
|
3
|
+
import { MeshBasicNodeMaterial, MeshToonNodeMaterial, MeshToonNodeMaterialParameters, Node, RenderPipeline, RenderTarget, Renderer, TextureNode, UniformNode, WebGPURenderer } from "three/webgpu";
|
|
4
|
+
import BloomNode from "three/examples/jsm/tsl/display/BloomNode.js";
|
|
5
|
+
import GodraysNode from "three/examples/jsm/tsl/display/GodraysNode.js";
|
|
6
|
+
//#region src/atmosphere/SkyKeyframe.d.ts
|
|
7
|
+
export interface SkyKeyframe {
|
|
8
|
+
cloudLitColor: Color;
|
|
9
|
+
cloudShadeColor: Color;
|
|
10
|
+
hemisphereGroundColor: Color;
|
|
11
|
+
hemisphereIntensity: number;
|
|
12
|
+
hemisphereSkyColor: Color;
|
|
13
|
+
horizonColor: Color;
|
|
14
|
+
lightColor: Color;
|
|
15
|
+
lightIntensity: number;
|
|
16
|
+
minutes: number;
|
|
17
|
+
starIntensity: number;
|
|
18
|
+
zenithColor: Color;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/atmosphere/SkyState.d.ts
|
|
22
|
+
export interface SkyState extends Omit<SkyKeyframe, "minutes"> {
|
|
23
|
+
lightDirection: Vector3;
|
|
24
|
+
moonDirection: Vector3;
|
|
25
|
+
sunDirection: Vector3;
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/atmosphere/SkyUniforms.d.ts
|
|
29
|
+
export interface SkyUniforms {
|
|
30
|
+
cloudCoverage: UniformNode<"float", number>;
|
|
31
|
+
cloudDrift: UniformNode<"vec2", Vector2>;
|
|
32
|
+
cloudLitColor: UniformNode<"color", Color>;
|
|
33
|
+
cloudShadeColor: UniformNode<"color", Color>;
|
|
34
|
+
horizonColor: UniformNode<"color", Color>;
|
|
35
|
+
lightColor: UniformNode<"color", Color>;
|
|
36
|
+
moonDirection: UniformNode<"vec3", Vector3>;
|
|
37
|
+
starIntensity: UniformNode<"float", number>;
|
|
38
|
+
sunDirection: UniformNode<"vec3", Vector3>;
|
|
39
|
+
zenithColor: UniformNode<"color", Color>;
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/nodes/LightUniforms.d.ts
|
|
43
|
+
export interface LightUniforms {
|
|
44
|
+
lightColor: UniformNode<"color", Color>;
|
|
45
|
+
rimColor: UniformNode<"color", Color>;
|
|
46
|
+
rimStrength: UniformNode<"float", number>;
|
|
47
|
+
sunDirection: UniformNode<"vec3", Vector3>;
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/post/FogUniforms.d.ts
|
|
51
|
+
export interface FogUniforms {
|
|
52
|
+
baseHeight: UniformNode<"float", number>;
|
|
53
|
+
color: UniformNode<"color", Color>;
|
|
54
|
+
density: UniformNode<"float", number>;
|
|
55
|
+
heightFalloff: UniformNode<"float", number>;
|
|
56
|
+
startDistance: UniformNode<"float", number>;
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/post/PostUniforms.d.ts
|
|
60
|
+
export interface PostUniforms {
|
|
61
|
+
godraysColor: UniformNode<"color", Color>;
|
|
62
|
+
gradeIntensity: UniformNode<"float", number>;
|
|
63
|
+
outlineColor: UniformNode<"color", Color>;
|
|
64
|
+
outlineFadeDistance: UniformNode<"float", number>;
|
|
65
|
+
outlineThickness: UniformNode<"float", number>;
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/atmosphere/SkyTargets.d.ts
|
|
69
|
+
export interface SkyTargets {
|
|
70
|
+
fogUniforms: FogUniforms;
|
|
71
|
+
godraysLight: DirectionalLight;
|
|
72
|
+
hemisphere: HemisphereLight;
|
|
73
|
+
light: DirectionalLight;
|
|
74
|
+
lightDistance: number;
|
|
75
|
+
lightUniforms: LightUniforms;
|
|
76
|
+
postUniforms: PostUniforms;
|
|
77
|
+
skyUniforms: SkyUniforms;
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/atmosphere/SunLight.d.ts
|
|
81
|
+
export interface SunLight {
|
|
82
|
+
cascadedShadowNode: CSMShadowNode;
|
|
83
|
+
light: DirectionalLight;
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/atmosphere/SunLightOptions.d.ts
|
|
87
|
+
export interface SunLightOptions {
|
|
88
|
+
cascadeCount: number;
|
|
89
|
+
maxFar: number;
|
|
90
|
+
shadowMapSize: number;
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/atmosphere/applySkyState.d.ts
|
|
94
|
+
export declare const applySkyState: (skyState: SkyState, { fogUniforms, godraysLight, hemisphere, light, lightDistance, lightUniforms, postUniforms, skyUniforms }: SkyTargets) => void;
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/atmosphere/computeSunDirection.d.ts
|
|
97
|
+
export declare const computeSunDirection: (minutes: number, tilt: number, sunDirection: Vector3) => Vector3;
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/atmosphere/createSkyState.d.ts
|
|
100
|
+
export declare const createSkyState: () => SkyState;
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/atmosphere/createSkyUniforms.d.ts
|
|
103
|
+
export declare const createSkyUniforms: () => SkyUniforms;
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/atmosphere/createSunLight.d.ts
|
|
106
|
+
export declare const createSunLight: ({ cascadeCount, maxFar, shadowMapSize }: SunLightOptions) => SunLight;
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/atmosphere/sampleSkyState.d.ts
|
|
109
|
+
export declare const sampleSkyState: (skyKeyframes: readonly SkyKeyframe[], minutes: number, tilt: number, skyState: SkyState) => SkyState;
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/clock/GameClock.d.ts
|
|
112
|
+
export interface GameClock {
|
|
113
|
+
minutes: number;
|
|
114
|
+
minutesPerSecond: number;
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/clock/advanceGameClock.d.ts
|
|
118
|
+
export declare const advanceGameClock: (gameClock: GameClock, deltaSeconds: number) => void;
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/clock/constants.d.ts
|
|
121
|
+
export declare const MINUTES_PER_DAY = 1440;
|
|
122
|
+
export declare const GAME_MINUTES_PER_SECOND = 1;
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/kits/statue/createStatueGeometry.d.ts
|
|
125
|
+
export declare const createStatueGeometry: () => BufferGeometry;
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region src/kits/tree/BranchSegment.d.ts
|
|
128
|
+
export interface BranchSegment {
|
|
129
|
+
end: Vector3;
|
|
130
|
+
endRadius: number;
|
|
131
|
+
start: Vector3;
|
|
132
|
+
startRadius: number;
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region src/kits/tree/LeafCards.d.ts
|
|
136
|
+
export interface LeafCards {
|
|
137
|
+
indices: Uint32Array;
|
|
138
|
+
normals: Float32Array;
|
|
139
|
+
positions: Float32Array;
|
|
140
|
+
uvs: Float32Array;
|
|
141
|
+
}
|
|
142
|
+
//#endregion
|
|
143
|
+
//#region src/kits/tree/TreeGeometry.d.ts
|
|
144
|
+
export interface TreeGeometry {
|
|
145
|
+
branchGeometry: BufferGeometry;
|
|
146
|
+
leafGeometry: BufferGeometry;
|
|
147
|
+
}
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region src/kits/tree/TreeOptions.d.ts
|
|
150
|
+
export interface TreeOptions {
|
|
151
|
+
branchLength: number;
|
|
152
|
+
cardSize: number;
|
|
153
|
+
cardsPerCluster: number;
|
|
154
|
+
clusterRadius: number;
|
|
155
|
+
mainBranchCount: number;
|
|
156
|
+
seed: number;
|
|
157
|
+
trunkHeight: number;
|
|
158
|
+
trunkRadius: number;
|
|
159
|
+
}
|
|
160
|
+
//#endregion
|
|
161
|
+
//#region src/kits/tree/TreeSkeleton.d.ts
|
|
162
|
+
export interface TreeSkeleton {
|
|
163
|
+
branchSegments: BranchSegment[];
|
|
164
|
+
clusterCenters: Vector3[];
|
|
165
|
+
}
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region src/kits/tree/computeLeafCards.d.ts
|
|
168
|
+
export declare const computeLeafCards: (clusterCenters: readonly Vector3[], { cardSize, cardsPerCluster, clusterRadius, seed }: Pick<TreeOptions, "cardSize" | "cardsPerCluster" | "clusterRadius" | "seed">) => LeafCards;
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/kits/tree/computeTreeSkeleton.d.ts
|
|
171
|
+
export declare const computeTreeSkeleton: ({ branchLength, mainBranchCount, seed, trunkHeight, trunkRadius }: Pick<TreeOptions, "branchLength" | "mainBranchCount" | "seed" | "trunkHeight" | "trunkRadius">) => TreeSkeleton;
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/kits/tree/createTreeGeometry.d.ts
|
|
174
|
+
export declare const createTreeGeometry: (treeOptions: TreeOptions) => TreeGeometry;
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/materials/RampOptions.d.ts
|
|
177
|
+
export interface RampOptions {
|
|
178
|
+
resolution: number;
|
|
179
|
+
softness: number;
|
|
180
|
+
terminator: number;
|
|
181
|
+
}
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region src/materials/computeRampValues.d.ts
|
|
184
|
+
export declare const computeRampValues: ({ resolution, softness, terminator }: RampOptions) => Uint8Array;
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/materials/createRampTexture.d.ts
|
|
187
|
+
export declare const createRampTexture: (rampOptions: RampOptions) => DataTexture;
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region src/nodes/ToonMaterialOptions.d.ts
|
|
190
|
+
export interface ToonMaterialOptions {
|
|
191
|
+
color?: ColorRepresentation;
|
|
192
|
+
isOutlined?: boolean;
|
|
193
|
+
isVertexColors?: boolean;
|
|
194
|
+
lightUniforms: LightUniforms;
|
|
195
|
+
rampTexture: DataTexture;
|
|
196
|
+
}
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region src/nodes/ToonNodeMaterial.d.ts
|
|
199
|
+
export declare class ToonNodeMaterial extends MeshToonNodeMaterial {
|
|
200
|
+
emissiveNode: Node | null;
|
|
201
|
+
override readonly isMeshToonNodeMaterial: boolean;
|
|
202
|
+
constructor(parameters: MeshToonNodeMaterialParameters, isOutlined: boolean);
|
|
203
|
+
}
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region src/water/WaterUniforms.d.ts
|
|
206
|
+
export interface WaterUniforms {
|
|
207
|
+
causticStrength: UniformNode<"float", number>;
|
|
208
|
+
deepColor: UniformNode<"color", Color>;
|
|
209
|
+
deepDepth: UniformNode<"float", number>;
|
|
210
|
+
foamColor: UniformNode<"color", Color>;
|
|
211
|
+
foamDepth: UniformNode<"float", number>;
|
|
212
|
+
level: UniformNode<"float", number>;
|
|
213
|
+
shallowColor: UniformNode<"color", Color>;
|
|
214
|
+
underwaterFogColor: UniformNode<"color", Color>;
|
|
215
|
+
underwaterFogDensity: UniformNode<"float", number>;
|
|
216
|
+
}
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region src/nodes/createCausticsNode.d.ts
|
|
219
|
+
export declare const createCausticsNode: ({ lightColor }: Pick<LightUniforms, "lightColor">, { causticStrength, deepDepth, level }: Pick<WaterUniforms, "causticStrength" | "deepDepth" | "level">) => Node<"vec3">;
|
|
220
|
+
//#endregion
|
|
221
|
+
//#region src/nodes/createGenshinRenderer.d.ts
|
|
222
|
+
export declare const createGenshinRenderer: (canvas: HTMLCanvasElement) => WebGPURenderer;
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region src/wind/WindUniforms.d.ts
|
|
225
|
+
export interface WindUniforms {
|
|
226
|
+
direction: UniformNode<"vec2", Vector2>;
|
|
227
|
+
gustSpeed: UniformNode<"float", number>;
|
|
228
|
+
gustStrength: UniformNode<"float", number>;
|
|
229
|
+
gustWidth: UniformNode<"float", number>;
|
|
230
|
+
strength: UniformNode<"float", number>;
|
|
231
|
+
}
|
|
232
|
+
//#endregion
|
|
233
|
+
//#region src/nodes/createLeafMaterial.d.ts
|
|
234
|
+
export declare const createLeafMaterial: (toonMaterialOptions: ToonMaterialOptions, windUniforms?: WindUniforms) => ToonNodeMaterial;
|
|
235
|
+
//#endregion
|
|
236
|
+
//#region src/nodes/createLightUniforms.d.ts
|
|
237
|
+
export declare const createLightUniforms: () => LightUniforms;
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/nodes/createRimNode.d.ts
|
|
240
|
+
export declare const createRimNode: ({ rimColor, rimStrength, sunDirection }: LightUniforms) => Node<"vec3">;
|
|
241
|
+
//#endregion
|
|
242
|
+
//#region src/nodes/createSkyNode.d.ts
|
|
243
|
+
export declare const createSkyNode: ({ cloudCoverage, cloudDrift, cloudLitColor, cloudShadeColor, horizonColor, lightColor, moonDirection, starIntensity, sunDirection, zenithColor }: SkyUniforms) => Node<"vec3">;
|
|
244
|
+
//#endregion
|
|
245
|
+
//#region src/nodes/createToonMaterial.d.ts
|
|
246
|
+
export declare const createToonMaterial: ({ color, isOutlined, isVertexColors, lightUniforms, rampTexture }: ToonMaterialOptions) => ToonNodeMaterial;
|
|
247
|
+
//#endregion
|
|
248
|
+
//#region src/nodes/createWaterMaterial.d.ts
|
|
249
|
+
export declare const createWaterMaterial: ({ lightColor, sunDirection }: Pick<LightUniforms, "lightColor" | "sunDirection">, { horizonColor, zenithColor }: Pick<SkyUniforms, "horizonColor" | "zenithColor">, { deepColor, deepDepth, foamColor, foamDepth, shallowColor }: WaterUniforms) => MeshBasicNodeMaterial;
|
|
250
|
+
//#endregion
|
|
251
|
+
//#region src/nodes/createWindNode.d.ts
|
|
252
|
+
export declare const createWindNode: ({ direction, gustSpeed, gustStrength, gustWidth, strength }: WindUniforms, groundPosition: Node<"vec2">) => Node<"vec2">;
|
|
253
|
+
//#endregion
|
|
254
|
+
//#region src/noise/createSimplexNoise.d.ts
|
|
255
|
+
export declare const createSimplexNoise: (seed: number) => ((x: number, y: number) => number);
|
|
256
|
+
//#endregion
|
|
257
|
+
//#region src/post/GradeOptions.d.ts
|
|
258
|
+
export interface GradeOptions {
|
|
259
|
+
contrast: number;
|
|
260
|
+
highlightTint: readonly [number, number, number];
|
|
261
|
+
saturation: number;
|
|
262
|
+
shadowTint: readonly [number, number, number];
|
|
263
|
+
size: number;
|
|
264
|
+
}
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region src/post/PostPipeline.d.ts
|
|
267
|
+
export interface PostPipeline {
|
|
268
|
+
bloomNode?: BloomNode;
|
|
269
|
+
godraysNode?: GodraysNode;
|
|
270
|
+
renderPipeline: RenderPipeline;
|
|
271
|
+
}
|
|
272
|
+
//#endregion
|
|
273
|
+
//#region src/renderer/AntialiasingMode.d.ts
|
|
274
|
+
export declare enum AntialiasingMode {
|
|
275
|
+
Smaa = "Smaa",
|
|
276
|
+
Traa = "Traa"
|
|
277
|
+
}
|
|
278
|
+
//#endregion
|
|
279
|
+
//#region src/renderer/QualityTierSettings.d.ts
|
|
280
|
+
export interface QualityTierSettings {
|
|
281
|
+
antialiasingMode: AntialiasingMode;
|
|
282
|
+
cascadeCount: number;
|
|
283
|
+
godraysStepCount: number;
|
|
284
|
+
grassDensity: number;
|
|
285
|
+
isBloomEnabled: boolean;
|
|
286
|
+
maxPixelRatio: number;
|
|
287
|
+
shadowMapSize: number;
|
|
288
|
+
}
|
|
289
|
+
//#endregion
|
|
290
|
+
//#region src/post/PostPipelineOptions.d.ts
|
|
291
|
+
export interface PostPipelineOptions {
|
|
292
|
+
camera: Camera;
|
|
293
|
+
fogUniforms: FogUniforms;
|
|
294
|
+
godraysLight: DirectionalLight;
|
|
295
|
+
gradeLutTexture: Data3DTexture;
|
|
296
|
+
postUniforms: PostUniforms;
|
|
297
|
+
qualityTierSettings: QualityTierSettings;
|
|
298
|
+
renderer: Renderer;
|
|
299
|
+
scene: Scene;
|
|
300
|
+
}
|
|
301
|
+
//#endregion
|
|
302
|
+
//#region src/post/computeGradeLut.d.ts
|
|
303
|
+
export declare const computeGradeLut: ({ contrast, highlightTint, saturation, shadowTint, size }: GradeOptions) => Uint8Array;
|
|
304
|
+
//#endregion
|
|
305
|
+
//#region src/post/createFogUniforms.d.ts
|
|
306
|
+
export declare const createFogUniforms: () => FogUniforms;
|
|
307
|
+
//#endregion
|
|
308
|
+
//#region src/post/createGodraysLight.d.ts
|
|
309
|
+
export declare const createGodraysLight: (shadowMapSize: number, halfExtent: number) => DirectionalLight;
|
|
310
|
+
//#endregion
|
|
311
|
+
//#region src/post/createGradeLutTexture.d.ts
|
|
312
|
+
export declare const createGradeLutTexture: (gradeOptions: GradeOptions) => Data3DTexture;
|
|
313
|
+
//#endregion
|
|
314
|
+
//#region src/post/createHeightFogNode.d.ts
|
|
315
|
+
export declare const createHeightFogNode: (colorNode: Node<"vec4">, depthNode: TextureNode, camera: Camera, { baseHeight, color, density, heightFalloff, startDistance }: FogUniforms) => Node<"vec4">;
|
|
316
|
+
//#endregion
|
|
317
|
+
//#region src/post/createPostPipeline.d.ts
|
|
318
|
+
export declare const createPostPipeline: ({ camera, fogUniforms, godraysLight, gradeLutTexture, postUniforms: { godraysColor, gradeIntensity, outlineColor, outlineFadeDistance, outlineThickness }, qualityTierSettings: { antialiasingMode, godraysStepCount, isBloomEnabled }, renderer, scene }: PostPipelineOptions) => PostPipeline;
|
|
319
|
+
//#endregion
|
|
320
|
+
//#region src/post/createPostUniforms.d.ts
|
|
321
|
+
export declare const createPostUniforms: () => PostUniforms;
|
|
322
|
+
//#endregion
|
|
323
|
+
//#region src/random/createSeededRandom.d.ts
|
|
324
|
+
export declare const createSeededRandom: (seed: number) => (() => number);
|
|
325
|
+
//#endregion
|
|
326
|
+
//#region src/renderer/QualityTier.d.ts
|
|
327
|
+
export declare enum QualityTier {
|
|
328
|
+
High = "High",
|
|
329
|
+
Low = "Low",
|
|
330
|
+
Medium = "Medium"
|
|
331
|
+
}
|
|
332
|
+
//#endregion
|
|
333
|
+
//#region src/renderer/QualityTierSettingsMap.d.ts
|
|
334
|
+
export declare const QualityTierSettingsMap: Readonly<Record<QualityTier, QualityTierSettings>>;
|
|
335
|
+
//#endregion
|
|
336
|
+
//#region src/terrain/TerrainSelection.d.ts
|
|
337
|
+
export interface TerrainSelection {
|
|
338
|
+
count: number;
|
|
339
|
+
keys: Float64Array;
|
|
340
|
+
}
|
|
341
|
+
//#endregion
|
|
342
|
+
//#region src/streaming/TileStreamer.d.ts
|
|
343
|
+
export interface TileStreamer<TTile> {
|
|
344
|
+
dispose: () => void;
|
|
345
|
+
get: (key: number) => TTile | undefined;
|
|
346
|
+
has: (key: number) => boolean;
|
|
347
|
+
receive: (key: number, tile: TTile) => void;
|
|
348
|
+
update: (wanted: TerrainSelection, drawn: TerrainSelection) => void;
|
|
349
|
+
}
|
|
350
|
+
//#endregion
|
|
351
|
+
//#region src/streaming/TileStreamerOptions.d.ts
|
|
352
|
+
export interface TileStreamerOptions<TTile> {
|
|
353
|
+
disposeTile: (tile: TTile) => void;
|
|
354
|
+
maxCachedCount: number;
|
|
355
|
+
maxPendingCount: number;
|
|
356
|
+
requestTile: (key: number) => void;
|
|
357
|
+
}
|
|
358
|
+
//#endregion
|
|
359
|
+
//#region src/streaming/createTileStreamer.d.ts
|
|
360
|
+
export declare const createTileStreamer: <TTile>({ disposeTile, maxCachedCount, maxPendingCount, requestTile }: TileStreamerOptions<TTile>) => TileStreamer<TTile>;
|
|
361
|
+
//#endregion
|
|
362
|
+
//#region src/terrain/TerrainOptions.d.ts
|
|
363
|
+
export interface TerrainOptions {
|
|
364
|
+
cellsPerSide: number;
|
|
365
|
+
finestRange: number;
|
|
366
|
+
finestTileSize: number;
|
|
367
|
+
levelCount: number;
|
|
368
|
+
maxHeight: number;
|
|
369
|
+
minHeight: number;
|
|
370
|
+
morphShare: number;
|
|
371
|
+
}
|
|
372
|
+
//#endregion
|
|
373
|
+
//#region src/terrain/TerrainTile.d.ts
|
|
374
|
+
export interface TerrainTile {
|
|
375
|
+
coarsePositions: Float32Array;
|
|
376
|
+
colors: Float32Array;
|
|
377
|
+
key: number;
|
|
378
|
+
normals: Float32Array;
|
|
379
|
+
positions: Float32Array;
|
|
380
|
+
}
|
|
381
|
+
//#endregion
|
|
382
|
+
//#region src/terrain/TerrainTileOptions.d.ts
|
|
383
|
+
export interface TerrainTileOptions extends Pick<TerrainOptions, "cellsPerSide" | "finestTileSize"> {
|
|
384
|
+
getHeight: (x: number, z: number) => number;
|
|
385
|
+
key: number;
|
|
386
|
+
writeColor: (colors: Float32Array, offset: number, height: number, slope: number, x: number, z: number) => void;
|
|
387
|
+
}
|
|
388
|
+
//#endregion
|
|
389
|
+
//#region src/terrain/computeTerrainIndices.d.ts
|
|
390
|
+
export declare const computeTerrainIndices: (cellsPerSide: number) => Uint16Array | Uint32Array;
|
|
391
|
+
//#endregion
|
|
392
|
+
//#region src/terrain/computeTerrainTile.d.ts
|
|
393
|
+
export declare const computeTerrainTile: ({ cellsPerSide, finestTileSize, getHeight, key, writeColor }: TerrainTileOptions) => TerrainTile;
|
|
394
|
+
//#endregion
|
|
395
|
+
//#region src/terrain/constants.d.ts
|
|
396
|
+
export declare const TILE_INDEX_OFFSET: number;
|
|
397
|
+
export declare const TILE_INDEX_SPAN: number;
|
|
398
|
+
export declare const TERRAIN_LAYER = 1;
|
|
399
|
+
//#endregion
|
|
400
|
+
//#region src/terrain/createTerrainMaterial.d.ts
|
|
401
|
+
export declare const createTerrainMaterial: ({ finestRange, morphShare }: Pick<TerrainOptions, "finestRange" | "morphShare">, toonMaterialOptions: Pick<ToonMaterialOptions, "color" | "lightUniforms" | "rampTexture">, waterUniforms?: WaterUniforms) => ToonNodeMaterial;
|
|
402
|
+
//#endregion
|
|
403
|
+
//#region src/terrain/createTerrainSelection.d.ts
|
|
404
|
+
export declare const createTerrainSelection: (capacity: number) => TerrainSelection;
|
|
405
|
+
//#endregion
|
|
406
|
+
//#region src/terrain/createTerrainTileGeometry.d.ts
|
|
407
|
+
export declare const createTerrainTileGeometry: ({ coarsePositions, colors, normals, positions }: TerrainTile, index: BufferAttribute) => BufferGeometry;
|
|
408
|
+
//#endregion
|
|
409
|
+
//#region src/terrain/getParentTerrainTileKey.d.ts
|
|
410
|
+
export declare const getParentTerrainTileKey: (key: number) => number;
|
|
411
|
+
//#endregion
|
|
412
|
+
//#region src/terrain/getTerrainTileColumn.d.ts
|
|
413
|
+
export declare const getTerrainTileColumn: (key: number) => number;
|
|
414
|
+
//#endregion
|
|
415
|
+
//#region src/terrain/getTerrainTileKey.d.ts
|
|
416
|
+
export declare const getTerrainTileKey: (level: number, column: number, row: number) => number;
|
|
417
|
+
//#endregion
|
|
418
|
+
//#region src/terrain/getTerrainTileLevel.d.ts
|
|
419
|
+
export declare const getTerrainTileLevel: (key: number) => number;
|
|
420
|
+
//#endregion
|
|
421
|
+
//#region src/terrain/getTerrainTileRow.d.ts
|
|
422
|
+
export declare const getTerrainTileRow: (key: number) => number;
|
|
423
|
+
//#endregion
|
|
424
|
+
//#region src/terrain/resolveTerrainDraws.d.ts
|
|
425
|
+
export declare const resolveTerrainDraws: ({ levelCount }: Pick<TerrainOptions, "levelCount">, wanted: TerrainSelection, checkTileLoaded: (key: number) => boolean, draws: TerrainSelection) => TerrainSelection;
|
|
426
|
+
//#endregion
|
|
427
|
+
//#region src/terrain/selectTerrainTiles.d.ts
|
|
428
|
+
export declare const selectTerrainTiles: (terrainOptions: TerrainOptions, eye: Vector3Like, frustum: Frustum | undefined, selection: TerrainSelection) => TerrainSelection;
|
|
429
|
+
//#endregion
|
|
430
|
+
//#region src/vegetation/GrassBlade.d.ts
|
|
431
|
+
export interface GrassBlade {
|
|
432
|
+
indices: Uint16Array;
|
|
433
|
+
positions: Float32Array;
|
|
434
|
+
}
|
|
435
|
+
//#endregion
|
|
436
|
+
//#region src/vegetation/GrassRing.d.ts
|
|
437
|
+
export interface GrassRing {
|
|
438
|
+
cellsPerSide: number;
|
|
439
|
+
fadeEnd: number;
|
|
440
|
+
fadeStart: number;
|
|
441
|
+
innerRadius: number;
|
|
442
|
+
scale: number;
|
|
443
|
+
spacing: number;
|
|
444
|
+
}
|
|
445
|
+
//#endregion
|
|
446
|
+
//#region src/vegetation/GroundCapture.d.ts
|
|
447
|
+
export interface GroundCapture {
|
|
448
|
+
camera: OrthographicCamera;
|
|
449
|
+
center: UniformNode<"vec2", Vector2>;
|
|
450
|
+
material: MeshBasicNodeMaterial;
|
|
451
|
+
renderTarget: RenderTarget;
|
|
452
|
+
size: number;
|
|
453
|
+
}
|
|
454
|
+
//#endregion
|
|
455
|
+
//#region src/vegetation/GrassOptions.d.ts
|
|
456
|
+
export interface GrassOptions {
|
|
457
|
+
bladeHeight: number;
|
|
458
|
+
bladeWidth: number;
|
|
459
|
+
cameraGround: UniformNode<"vec2", Vector2>;
|
|
460
|
+
density: UniformNode<"float", number>;
|
|
461
|
+
groundCapture: GroundCapture;
|
|
462
|
+
lightUniforms: LightUniforms;
|
|
463
|
+
rampTexture: DataTexture;
|
|
464
|
+
ring: GrassRing;
|
|
465
|
+
waterUniforms: Pick<WaterUniforms, "level">;
|
|
466
|
+
windUniforms: WindUniforms;
|
|
467
|
+
}
|
|
468
|
+
//#endregion
|
|
469
|
+
//#region src/vegetation/computeGrassBlade.d.ts
|
|
470
|
+
export declare const computeGrassBlade: (segmentCount: number) => GrassBlade;
|
|
471
|
+
//#endregion
|
|
472
|
+
//#region src/vegetation/createGrassGeometry.d.ts
|
|
473
|
+
export declare const createGrassGeometry: (segmentCount: number, bladeCount: number) => InstancedBufferGeometry;
|
|
474
|
+
//#endregion
|
|
475
|
+
//#region src/vegetation/createGrassMaterial.d.ts
|
|
476
|
+
export declare const createGrassMaterial: ({ bladeHeight, bladeWidth, cameraGround, density, groundCapture, lightUniforms, rampTexture, ring, waterUniforms, windUniforms }: GrassOptions) => ToonNodeMaterial;
|
|
477
|
+
//#endregion
|
|
478
|
+
//#region src/vegetation/createGroundCapture.d.ts
|
|
479
|
+
export declare const createGroundCapture: (size: number, resolution: number) => GroundCapture;
|
|
480
|
+
//#endregion
|
|
481
|
+
//#region src/vegetation/renderGroundCapture.d.ts
|
|
482
|
+
export declare const renderGroundCapture: (renderer: Renderer, scene: Scene, { camera, center, material, renderTarget }: GroundCapture, { maxHeight }: Pick<TerrainOptions, "maxHeight">, worldCenter: Vector3Like, origin: Vector3Like) => void;
|
|
483
|
+
//#endregion
|
|
484
|
+
//#region src/water/UnderwaterFogState.d.ts
|
|
485
|
+
export interface UnderwaterFogState {
|
|
486
|
+
aboveDensity: number;
|
|
487
|
+
aboveHeightFalloff: number;
|
|
488
|
+
aboveStartDistance: number;
|
|
489
|
+
isUnderwater: boolean;
|
|
490
|
+
}
|
|
491
|
+
//#endregion
|
|
492
|
+
//#region src/water/createUnderwaterFogState.d.ts
|
|
493
|
+
export declare const createUnderwaterFogState: () => UnderwaterFogState;
|
|
494
|
+
//#endregion
|
|
495
|
+
//#region src/water/createWaterUniforms.d.ts
|
|
496
|
+
export declare const createWaterUniforms: () => WaterUniforms;
|
|
497
|
+
//#endregion
|
|
498
|
+
//#region src/water/updateUnderwaterFog.d.ts
|
|
499
|
+
export declare const updateUnderwaterFog: (eyeHeight: number, { level, underwaterFogColor, underwaterFogDensity }: Pick<WaterUniforms, "level" | "underwaterFogColor" | "underwaterFogDensity">, { color, density, heightFalloff, startDistance }: FogUniforms, underwaterFogState: UnderwaterFogState) => void;
|
|
500
|
+
//#endregion
|
|
501
|
+
//#region src/wind/createWindUniforms.d.ts
|
|
502
|
+
export declare const createWindUniforms: () => WindUniforms;
|
|
503
|
+
//#endregion
|
|
504
|
+
//#region src/world/GroundPoint.d.ts
|
|
505
|
+
export interface GroundPoint {
|
|
506
|
+
x: number;
|
|
507
|
+
z: number;
|
|
508
|
+
}
|
|
509
|
+
//#endregion
|
|
510
|
+
//#region src/world/computeOriginShift.d.ts
|
|
511
|
+
export declare const computeOriginShift: (cameraPosition: Vector3, threshold: number, step: number, shift: Vector3) => boolean;
|
|
512
|
+
//#endregion
|
|
513
|
+
//#region src/world/computeOutlineDistance.d.ts
|
|
514
|
+
export declare const computeOutlineDistance: (outline: readonly GroundPoint[], x: number, z: number) => number;
|
|
515
|
+
//#endregion
|