@threenative/core 0.3.11 → 0.3.13
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 +1 -1
- package/capabilities.json +1988 -204
- package/dist/{assets-YUbXa3-Y.d.ts → assets-CfMKnOsK.d.ts} +78 -1
- package/dist/camera-shake-CZKOfGn4.d.ts +46 -0
- package/dist/{canvas-layer-vCtanIeB.d.ts → canvas-layer-G7ttVy7y.d.ts} +1 -1
- package/dist/chunk-4SRAQFTU.js +133 -0
- package/dist/chunk-CFGTPFUH.js +231 -0
- package/dist/chunk-DIPIJICH.js +8916 -0
- package/dist/chunk-EEABDLUC.js +2237 -0
- package/dist/chunk-EFWZWLPY.js +1895 -0
- package/dist/chunk-GXY7B3JG.js +46 -0
- package/dist/chunk-GYUZJQ7U.js +280 -0
- package/dist/chunk-H4J6IAJE.js +504 -0
- package/dist/chunk-KIRUKTBQ.js +187 -0
- package/dist/chunk-QWJEMUUT.js +94 -0
- package/dist/chunk-SV4QVUTQ.js +31 -0
- package/dist/chunk-U4YHUKKL.js +615 -0
- package/dist/chunk-VP43GIWW.js +18 -0
- package/dist/chunk-XDTZ4QMO.js +160 -0
- package/dist/default-tone-mapping-GgKPTiBP.d.ts +4 -0
- package/dist/{game-DzMcitDO.d.ts → game-k8K3hZai.d.ts} +85 -9
- package/dist/hot.d.ts +5 -4
- package/dist/hot.js +5 -52
- package/dist/index.d.ts +633 -1351
- package/dist/index.js +12873 -23068
- package/dist/{model-lod-CTpZ6imz.d.ts → model-lod-DPTzeCcD.d.ts} +35 -3
- package/dist/playtest.d.ts +5 -4
- package/dist/playtest.js +25 -75
- package/dist/quality-BYqKGAwo.d.ts +868 -0
- package/dist/react-css.js +1 -215
- package/dist/react.d.ts +3 -2
- package/dist/render-environment.d.ts +170 -0
- package/dist/render-environment.js +352 -0
- package/dist/{renderer-rZm0hVqq.d.ts → renderer-BtOSseYf.d.ts} +42 -35
- package/dist/spells/index.d.ts +643 -0
- package/dist/spells/index.js +1558 -0
- package/dist/spells/ultra/index.d.ts +1600 -0
- package/dist/spells/ultra/index.js +6804 -0
- package/dist/terrain-jobs-worker.js +1 -123
- package/dist/two-sided-foliage-W523J3UM.js +1 -0
- package/dist/ui-layer.js +6 -384
- package/dist/worker.js +13 -43
- package/dist/world.d.ts +988 -268
- package/dist/world.js +17464 -18290
- package/mcp/animation-server.mjs +1 -1
- package/mcp/animation.mjs +2 -3
- package/mcp/engine-server.mjs +245 -52
- package/mcp/servers.mjs +10 -3
- package/mcp/terrain.mjs +8 -0
- package/package.json +19 -7
- package/patches/three@0.187.0-prd269-upgrade.patch +2102 -0
- package/patches/three@0.187.0.patch +2004 -407
- package/src/animation-batch.ts +193 -0
- package/src/animation-layers.ts +7 -3
- package/src/animation.ts +209 -29
- package/src/asset-cache.ts +3 -3
- package/src/asset-memo.ts +202 -0
- package/src/assets.ts +437 -125
- package/src/auto-batch.ts +190 -44
- package/src/card-lod.ts +152 -0
- package/src/compressed-texture-preparation.ts +1008 -0
- package/src/compute-driven.ts +1 -1
- package/src/config.ts +8 -0
- package/src/debug.ts +103 -22
- package/src/dev-global.ts +54 -0
- package/src/engine-hooks.ts +37 -0
- package/src/frame-budget.ts +50 -23
- package/src/game-boot-phase.ts +269 -0
- package/src/game-dev-tools.ts +86 -0
- package/src/game-frame-loop.ts +958 -0
- package/src/game-renderer-metrics.ts +77 -0
- package/src/game-startup.ts +1076 -0
- package/src/game-ui.ts +84 -0
- package/src/game-validate.ts +70 -0
- package/src/game.ts +198 -2264
- package/src/gamepad-mappings.ts +269 -0
- package/src/generated/console-markers.ts +13 -0
- package/src/geometry-capture.ts +28 -4
- package/src/gpu-readings.ts +98 -0
- package/src/gpu-scene-bvh.ts +149 -36
- package/src/hot.ts +4 -7
- package/src/index.ts +141 -9
- package/src/input.ts +237 -25
- package/src/instanced-batch-lod.ts +3 -8
- package/src/interpolation.ts +171 -40
- package/src/launch-diagnostics.ts +22 -12
- package/src/look/ao-admission.ts +25 -0
- package/src/look/auto-exposure.ts +5 -16
- package/src/look/default-tone-mapping.ts +41 -5
- package/src/look/filmic-tone-mapping.ts +15 -13
- package/src/look/local-exposure.ts +2 -7
- package/src/look/look-diagnostics.ts +3 -3
- package/src/look/quad-pass.ts +21 -0
- package/src/look/quality.ts +14 -5
- package/src/look/unreal-bloom.ts +4 -13
- package/src/look/world-environment.ts +113 -103
- package/src/loop.ts +29 -0
- package/src/merge-parts.ts +20 -24
- package/src/model-lod.ts +139 -17
- package/src/particle-kinds.ts +515 -0
- package/src/particle-significance.ts +12 -0
- package/src/particles.ts +19 -10
- package/src/picking.ts +17 -3
- package/src/platform.ts +23 -4
- package/src/playtest.ts +27 -1
- package/src/profiling/FrameStages.ts +5 -6
- package/src/profiling/Spans.ts +3 -17
- package/src/profiling/debug-telemetry.ts +2 -6
- package/src/profiling/render-list-validate.ts +6 -15
- package/src/projection-apply.ts +4 -1
- package/src/projection-marker.ts +2 -1
- package/src/projection-plan.ts +9 -6
- package/src/quiet-markers.ts +3 -10
- package/src/render/cpu-bvh.ts +100 -0
- package/src/render/depth-pyramid.ts +6 -14
- package/src/render/environment/environmentContribution.ts +202 -0
- package/src/render/environment/environmentRadiance.ts +44 -0
- package/src/render/environment/environmentSampleCache.ts +56 -0
- package/src/render/environment/environmentSampling.ts +201 -0
- package/src/render/environment/environmentSnapshot.ts +71 -0
- package/src/render/environment/gate.ts +57 -0
- package/src/render/mesh-pool.ts +4 -20
- package/src/render/probe-trace.ts +872 -0
- package/src/render/probe-volume.ts +780 -34
- package/src/render/radiance-cache.ts +17 -0
- package/src/render/resolution-subrect.ts +2 -0
- package/src/render/rough-diffuse.ts +46 -12
- package/src/render/soft-shadow.ts +27 -12
- package/src/render/virtual-shadow-adaptive.ts +55 -0
- package/src/render/virtual-shadow-casters.ts +175 -0
- package/src/render/virtual-shadow-layers.ts +76 -0
- package/src/render/virtual-shadow-level.ts +224 -0
- package/src/render/virtual-shadow-markers.ts +193 -0
- package/src/render/virtual-shadow-options.ts +370 -0
- package/src/render/virtual-shadow-pages.ts +5 -0
- package/src/render/virtual-shadow-partial.ts +13 -0
- package/src/render/virtual-shadow.ts +231 -1008
- package/src/render/world-impostor-surface.ts +402 -40
- package/src/render/world-impostor.ts +5 -2
- package/src/render-camera-cull.ts +98 -3
- package/src/render-environment.ts +41 -0
- package/src/render-pass-budget.ts +34 -7
- package/src/renderProjection.ts +22 -0
- package/src/renderer-config.ts +36 -0
- package/src/renderer-facts.ts +37 -0
- package/src/renderer.ts +144 -65
- package/src/resolution-scaler.ts +3 -2
- package/src/scene-entry-inspectors.ts +61 -0
- package/src/snow-field.ts +2 -1
- package/src/spells/cast-pool.ts +361 -0
- package/src/spells/index.ts +177 -0
- package/src/spells/mechanisms.ts +295 -0
- package/src/spells/reaction-field.ts +415 -0
- package/src/spells/spell-lights.ts +139 -0
- package/src/spells/spell-world.ts +187 -0
- package/src/spells/spell.ts +397 -0
- package/src/spells/spells.ts +283 -0
- package/src/spells/ultra/engine/camera.ts +184 -0
- package/src/spells/ultra/engine/quality.ts +96 -0
- package/src/spells/ultra/index.ts +52 -0
- package/src/spells/ultra/main.ts +305 -0
- package/src/spells/ultra/scene/arenaMaterial.ts +325 -0
- package/src/spells/ultra/spells/cast.ts +233 -0
- package/src/spells/ultra/spells/fire.ts +1267 -0
- package/src/spells/ultra/vfx/FluidVolume.ts +816 -0
- package/src/spells/ultra/vfx/FluidVolume.tsl.ts +855 -0
- package/src/spells/ultra/vfx/FxTarget.ts +61 -0
- package/src/spells/ultra/vfx/GroundField.ts +1399 -0
- package/src/spells/ultra/vfx/Particles.ts +1475 -0
- package/src/spells/ultra/vfx/Ribbons.ts +645 -0
- package/src/spells/ultra/vfx/Shockwaves.ts +286 -0
- package/src/spells/ultra/vfx/Volumes.ts +489 -0
- package/src/spells/ultra/vfx/common.ts +1195 -0
- package/src/spells/ultra/vfx/noise.ts +441 -0
- package/src/startup-offscreen-bytes.ts +78 -0
- package/src/startup-readiness.ts +128 -34
- package/src/static-transform.ts +25 -19
- package/src/streamed-textures.ts +112 -0
- package/src/streaming.ts +68 -4
- package/src/texture-streaming.ts +331 -0
- package/src/version.ts +1 -1
- package/src/warmup.ts +56 -8
- package/src/water-surface.ts +9 -3
- package/src/worker.ts +12 -2
- package/src/world-bundle-safety.ts +446 -0
- package/src/world-cell-batches.ts +1178 -0
- package/src/world-cell-chunks.ts +1128 -0
- package/src/world-cell-data.ts +995 -0
- package/src/world-cell-impostors.ts +1461 -0
- package/src/world-cell-lod-bias.ts +151 -0
- package/src/world-cell-models.ts +1074 -0
- package/src/world-cell-options.ts +177 -0
- package/src/world-cell-placements.ts +798 -0
- package/src/world-cell-prewarm.ts +592 -0
- package/src/world-cell-readiness.ts +357 -0
- package/src/world-cell-records.ts +401 -0
- package/src/world-cell-render-bundles.ts +459 -0
- package/src/world-cell-render-gpu-dress.ts +710 -0
- package/src/world-cell-render-main-cull.ts +540 -0
- package/src/world-cell-render-shadow-claims.ts +198 -0
- package/src/world-cell-render-util.ts +259 -0
- package/src/world-cell-render.ts +1501 -0
- package/src/world-cell-residency.ts +754 -0
- package/src/world-cell-stale.ts +238 -0
- package/src/world-cells.ts +1335 -10418
- package/src/world-chunk-shadow.ts +308 -0
- package/src/world-collar.ts +315 -0
- package/src/world-gpu-flags.ts +131 -0
- package/src/world-gpu-readback.ts +881 -0
- package/src/world-gpu-reference.ts +524 -0
- package/src/world-gpu-scene.ts +256 -2286
- package/src/world-gpu-shadow.ts +203 -0
- package/src/world-gpu-types.ts +409 -0
- package/src/world-gpu-validation.ts +518 -0
- package/src/world-heightfield.ts +802 -0
- package/src/world-load-limiter.ts +111 -0
- package/src/world-model-sections.ts +80 -0
- package/src/world-noise.ts +241 -0
- package/src/world-package.ts +42 -0
- package/src/world-region.ts +1 -1
- package/src/world-river-ribbon.ts +282 -0
- package/src/world-root-frame.ts +39 -0
- package/src/world-shore-field.ts +91 -0
- package/src/world-static-pose.ts +163 -0
- package/src/world-surface-sampler.ts +48 -0
- package/src/world-terrain-splat.ts +361 -153
- package/src/world-tile-budget.ts +249 -0
- package/src/world-tile-geometry.ts +469 -0
- package/src/world-tile-lod.ts +408 -0
- package/src/world-tile-observation.ts +566 -0
- package/src/world-tile-stitch.ts +166 -0
- package/src/world-tiles.ts +247 -1755
- package/src/world-validate.ts +6 -14
- package/src/world-warm.ts +51 -0
- package/src/world-water-bodies.ts +359 -0
- package/src/world.ts +48 -741
package/dist/world.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { I as IComputeDriven, a as
|
|
3
|
-
import { I as IRendererLike } from './renderer-
|
|
4
|
-
import { I as IAssetLoader } from './assets-
|
|
1
|
+
import { Group, Vector3, BufferGeometry, Mesh, Object3D, LOD, Camera, Matrix4, Material, Box3, Texture, Data3DTexture } from 'three';
|
|
2
|
+
import { I as IComputeDriven, a as IGPUReadbackSample, b as ILodView, c as IModelLodPolicy } from './model-lod-DPTzeCcD.js';
|
|
3
|
+
import { I as IRendererLike } from './renderer-BtOSseYf.js';
|
|
4
|
+
import { I as IAssetLoader } from './assets-CfMKnOsK.js';
|
|
5
5
|
import { Node } from 'three/webgpu';
|
|
6
|
+
import './default-tone-mapping-GgKPTiBP.js';
|
|
6
7
|
|
|
7
8
|
interface IWorldErosionOptions {
|
|
8
9
|
readonly depositionRate: number;
|
|
@@ -14,7 +15,464 @@ interface IWorldErosionOptions {
|
|
|
14
15
|
readonly timeStep: number;
|
|
15
16
|
}
|
|
16
17
|
|
|
18
|
+
/**
|
|
19
|
+
* `Heightfield`: one height buffer shared by world queries, rendered geometry, and a physics
|
|
20
|
+
* heightfield. Split out of `world.ts` so `world-tiles.ts` reads the field it streams without
|
|
21
|
+
* importing the module that re-exports the tiles (PRD-797); `world.ts` re-exports all of it, so
|
|
22
|
+
* `@threenative/core/world` keeps its surface.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
interface IHeightfieldOrigin {
|
|
26
|
+
readonly x: number;
|
|
27
|
+
readonly z: number;
|
|
28
|
+
}
|
|
29
|
+
interface IHeightfieldOptions {
|
|
30
|
+
readonly columns: number;
|
|
31
|
+
readonly depth: number;
|
|
32
|
+
readonly heights: Float32Array;
|
|
33
|
+
readonly origin: IHeightfieldOrigin;
|
|
34
|
+
readonly rows: number;
|
|
35
|
+
readonly width: number;
|
|
36
|
+
readonly worldPasses?: IHeightfieldWorldPassOptions;
|
|
37
|
+
}
|
|
38
|
+
/** A rectangular window of a heightfield's canonical samples, in grid indices. */
|
|
39
|
+
/** Hands out the union of every window `updateHeights` wrote since the last `take`. */
|
|
40
|
+
interface IHeightfieldChangeTracker {
|
|
41
|
+
/** The changed window since the previous take, or undefined when nothing changed. */
|
|
42
|
+
take(): IHeightfieldRegionBounds | undefined;
|
|
43
|
+
/** Stop tracking. Idempotent. */
|
|
44
|
+
dispose(): void;
|
|
45
|
+
}
|
|
46
|
+
interface IHeightfieldRegionBounds {
|
|
47
|
+
/** First column (x index), inclusive. */
|
|
48
|
+
readonly column: number;
|
|
49
|
+
/** Number of columns covered. */
|
|
50
|
+
readonly columns: number;
|
|
51
|
+
/** First row (z index), inclusive. */
|
|
52
|
+
readonly row: number;
|
|
53
|
+
/** Number of rows covered. */
|
|
54
|
+
readonly rows: number;
|
|
55
|
+
}
|
|
56
|
+
/** A rectangular window plus the replacement samples written over it. */
|
|
57
|
+
interface IHeightfieldRegion extends IHeightfieldRegionBounds {
|
|
58
|
+
/** Row-major samples, `columns * rows` long and read with the region's own stride. */
|
|
59
|
+
readonly heights: Float32Array;
|
|
60
|
+
}
|
|
61
|
+
interface IHeightfieldWorldPassOptions {
|
|
62
|
+
/** Maximum TSL compute dispatches submitted by one rendered frame. */
|
|
63
|
+
readonly dispatchBudget: number;
|
|
64
|
+
/** Reserved GPU path; true is rejected until GPU readback owns the canonical field. */
|
|
65
|
+
readonly gpu?: boolean;
|
|
66
|
+
/** Every physical coefficient is game supplied; core owns no terrain preset. */
|
|
67
|
+
readonly erosion: IWorldErosionOptions;
|
|
68
|
+
}
|
|
69
|
+
interface IHeightfieldSamplerOptions extends Omit<IHeightfieldOptions, "heights"> {
|
|
70
|
+
/** Game-owned terrain function. It is evaluated once and never retained. */
|
|
71
|
+
readonly sampleHeight: (x: number, z: number) => number;
|
|
72
|
+
}
|
|
73
|
+
interface IStoredHeightfieldChannels {
|
|
74
|
+
readonly flow?: Float32Array;
|
|
75
|
+
readonly moisture?: Float32Array;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* One height buffer shared by world queries, rendered geometry, and a physics heightfield.
|
|
79
|
+
*
|
|
80
|
+
* The game supplies every value, so changing the terrain's shape never requires a package edit.
|
|
81
|
+
* `fromSampler` evaluates that game function exactly once at each vertex and retains only the
|
|
82
|
+
* resulting numbers. Queries interpolate those same numbers instead of evaluating the function
|
|
83
|
+
* again.
|
|
84
|
+
*
|
|
85
|
+
* @situation build terrain geometry and collision from one game-authored height function
|
|
86
|
+
* @situation generate a terrain a player can walk across
|
|
87
|
+
* @situation query the same ground height or normal that a player sees and collides with
|
|
88
|
+
* @situation ask how high the ground is here
|
|
89
|
+
* @situation build islands and coastlines from terrain
|
|
90
|
+
* @situation keep a collider or other copy of a deforming terrain in step without rescanning the whole field (`trackChanges`)
|
|
91
|
+
* @constraint sampleHeight owns the terrain shape and stays in game source; the framework stores and interpolates its output
|
|
92
|
+
* @constraint rows and columns are vertex counts; geometry is row-major z-then-x and collider export transposes once into Rapier's column-major matrix order
|
|
93
|
+
* @override rows, columns, width, depth, origin, and sampleHeight are explicit on every field
|
|
94
|
+
* @example const field = Heightfield.fromSampler({ rows: 65, columns: 65, width: 64, depth: 64, origin: { x: 0, z: 0 }, sampleHeight: terrainHeight });
|
|
95
|
+
*/
|
|
96
|
+
declare class Heightfield extends Group implements IComputeDriven {
|
|
97
|
+
#private;
|
|
98
|
+
readonly columns: number;
|
|
99
|
+
readonly depth: number;
|
|
100
|
+
readonly origin: IHeightfieldOrigin;
|
|
101
|
+
readonly rows: number;
|
|
102
|
+
readonly width: number;
|
|
103
|
+
readonly processCadence: "render";
|
|
104
|
+
readonly warmupNodes: readonly unknown[];
|
|
105
|
+
constructor(options: IHeightfieldOptions & IStoredHeightfieldChannels);
|
|
106
|
+
static fromSampler(options: IHeightfieldSamplerOptions): Heightfield;
|
|
107
|
+
sample(channel: string, x: number, z: number): number;
|
|
108
|
+
get released(): boolean;
|
|
109
|
+
get generationComplete(): boolean;
|
|
110
|
+
get gpuHeightSample(): IGPUReadbackSample | undefined;
|
|
111
|
+
attachRenderer(renderer: IRendererLike): void;
|
|
112
|
+
process(renderer?: IRendererLike | undefined): void;
|
|
113
|
+
debug(): Record<string, unknown>;
|
|
114
|
+
detach(): void;
|
|
115
|
+
/** A copy of the canonical row-major samples, safe for game-side analysis. */
|
|
116
|
+
get heights(): Float32Array;
|
|
117
|
+
/** A copy of the normalized routed-flow channel, when world passes were requested. */
|
|
118
|
+
get flow(): Float32Array | undefined;
|
|
119
|
+
/** Bytes retained by this field's CPU channels and its conservative GPU allowance. */
|
|
120
|
+
get memoryBytes(): number;
|
|
121
|
+
heightAt(x: number, z: number): number;
|
|
122
|
+
/**
|
|
123
|
+
* The drawn surface's height under `(x, z)`: the triangle plane `toGeometry` emits, not the
|
|
124
|
+
* bilinear `heightAt`.
|
|
125
|
+
*
|
|
126
|
+
* A heightfield renders as two triangles per cell and collides as the same two, so a prop or a
|
|
127
|
+
* player grounded on the bilinear height stands up to half a cell's relief off the surface the
|
|
128
|
+
* eye sees — worst on a saddle, where the two disagree by the cell's whole diagonal. This answers
|
|
129
|
+
* the plane the drawn triangle actually is, from the canonical samples, so a caller needs neither
|
|
130
|
+
* the geometry nor a matrix to ask.
|
|
131
|
+
* @situation ground a prop or a player on the same triangle the eye sees and the collider uses
|
|
132
|
+
* @constraint the point must be inside the field; a query outside it throws like `heightAt`
|
|
133
|
+
* @example const resting = field.surfaceAt(player.position.x, player.position.z);
|
|
134
|
+
*/
|
|
135
|
+
surfaceAt(x: number, z: number): number;
|
|
136
|
+
normalAt(x: number, z: number, target?: Vector3): Vector3;
|
|
137
|
+
/**
|
|
138
|
+
* Monotonic sample version, incremented by every `updateHeights` call.
|
|
139
|
+
*
|
|
140
|
+
* A renderer or collider that caches derived data compares this against its own last-seen value
|
|
141
|
+
* instead of diffing the whole grid each frame.
|
|
142
|
+
*/
|
|
143
|
+
get version(): number;
|
|
144
|
+
/**
|
|
145
|
+
* Overwrite one rectangular window of the canonical samples.
|
|
146
|
+
*
|
|
147
|
+
* Height is the one buffer queries, rendered geometry and collider export share, so a second
|
|
148
|
+
* terrain representation is never needed: a simulation writes its surface here and every
|
|
149
|
+
* consumer already reads it. The whole window is validated before any sample changes, so a
|
|
150
|
+
* malformed call leaves the field untouched rather than half-written.
|
|
151
|
+
* @situation deform terrain, snow or water in place and have queries and collision follow
|
|
152
|
+
* @constraint the region must lie inside the field; an out-of-bounds window throws and writes nothing
|
|
153
|
+
* @constraint heights is `columns * rows` long, row-major, and every sample must be finite
|
|
154
|
+
*/
|
|
155
|
+
updateHeights(region: IHeightfieldRegion): void;
|
|
156
|
+
/**
|
|
157
|
+
* Follow which samples change, independently of every other follower.
|
|
158
|
+
*
|
|
159
|
+
* A consumer that mirrors the surface — a collider, a GPU copy, a cache — needs the window that
|
|
160
|
+
* changed since *it* last looked; comparing the whole field instead costs every sample on every
|
|
161
|
+
* change. Each tracker keeps its own union of the windows `updateHeights` wrote, so two
|
|
162
|
+
* consumers never take each other's changes.
|
|
163
|
+
*
|
|
164
|
+
* ```ts
|
|
165
|
+
* const changes = field.trackChanges();
|
|
166
|
+
* const changed = changes.take(); // undefined when nothing was written
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
trackChanges(): IHeightfieldChangeTracker;
|
|
170
|
+
/** The collider sample at `row`, `column`: what `toColliderHeights()` holds there, without a copy. */
|
|
171
|
+
colliderHeight(row: number, column: number): number;
|
|
172
|
+
/**
|
|
173
|
+
* Rewrite an existing `toGeometry()` result from the current canonical samples.
|
|
174
|
+
*
|
|
175
|
+
* Positions carry over unchanged because only the surface moves; y and normals are refreshed
|
|
176
|
+
* from the same sampler queries use, which is what keeps a rendered vertex and a height query
|
|
177
|
+
* from disagreeing. Pass a region to touch only the window a simulation just changed.
|
|
178
|
+
* @situation redraw a terrain, snow or water mesh after its samples changed
|
|
179
|
+
* @constraint geometry must come from `toGeometry()` with the same rows and columns
|
|
180
|
+
*/
|
|
181
|
+
refreshGeometry(geometry: BufferGeometry, bounds?: IHeightfieldRegionBounds): void;
|
|
182
|
+
/** The same values transposed once into Rapier's column-major height-matrix order. */
|
|
183
|
+
toColliderHeights(): Float32Array;
|
|
184
|
+
/** Builds an ordinary Three.js geometry without choosing its surface. */
|
|
185
|
+
toGeometry(): BufferGeometry;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* `HeightfieldCollar`: the far ring a heightfield grows past its playable square, and the band of it
|
|
190
|
+
* a collider follows.
|
|
191
|
+
*
|
|
192
|
+
* A landscape renders its square at full detail and its surroundings at a fraction of it, because
|
|
193
|
+
* the surroundings' triangles are (Unreal `ALandscapeMeshProxyActor`, HLOD). The mechanism is the
|
|
194
|
+
* same everywhere: one vertex per boundary sample, one ring per distance step, and a quad grid
|
|
195
|
+
* between them whose innermost ring is the square's own edge. What a ring is worth in metres, what
|
|
196
|
+
* it looks like and where the ground stops being walkable are the game's decisions, so they arrive
|
|
197
|
+
* as options: `ringDistance` is its framing curve and `height` is its own surface.
|
|
198
|
+
*/
|
|
199
|
+
|
|
200
|
+
/** One ring vertex: where it stands and which ring and boundary sample it belongs to. */
|
|
201
|
+
interface IHeightfieldCollarSite {
|
|
202
|
+
/** Metres past the square's edge along the framing curve. */
|
|
203
|
+
readonly distance: number;
|
|
204
|
+
/** Ring number, 0 at the square's own edge. */
|
|
205
|
+
readonly ring: number;
|
|
206
|
+
/** Index along the perimeter walk, 0 at the ring's own (-x, -z) corner. */
|
|
207
|
+
readonly vertex: number;
|
|
208
|
+
readonly x: number;
|
|
209
|
+
readonly z: number;
|
|
210
|
+
}
|
|
211
|
+
/** The collar quad a world point falls in, in ring and perimeter indices. */
|
|
212
|
+
interface IHeightfieldCollarQuad {
|
|
213
|
+
/** Share from `from` to `to` along the perimeter, 0..1. */
|
|
214
|
+
readonly edgeShare: number;
|
|
215
|
+
/** Perimeter index at or before the point. */
|
|
216
|
+
readonly from: number;
|
|
217
|
+
/** The ring inside the point. */
|
|
218
|
+
readonly lower: number;
|
|
219
|
+
/** Share from `lower` to `upper` across the rings, 0..1. */
|
|
220
|
+
readonly ringShare: number;
|
|
221
|
+
/** Perimeter index after `from`. */
|
|
222
|
+
readonly to: number;
|
|
223
|
+
/** The ring outside the point. */
|
|
224
|
+
readonly upper: number;
|
|
225
|
+
}
|
|
226
|
+
interface IHeightfieldCollarOptions {
|
|
227
|
+
/** The height at one ring vertex. The game's look: surveyed relief, its smoothing and its seams. */
|
|
228
|
+
readonly height: (site: IHeightfieldCollarSite) => number;
|
|
229
|
+
/** Samples along one side of the square; a ring keeps one vertex per boundary sample. */
|
|
230
|
+
readonly resolution: number;
|
|
231
|
+
/** Metres past the square's edge of one ring. `ringDistance(0)` reads 0 and it never decreases. */
|
|
232
|
+
readonly ringDistance: (ring: number) => number;
|
|
233
|
+
/** Rings past the edge, outermost included. */
|
|
234
|
+
readonly rings: number;
|
|
235
|
+
/** The square's side in metres: the heightfield's own width. */
|
|
236
|
+
readonly size: number;
|
|
237
|
+
/** Metres past the edge that stay walkable: `walk` ends at the outermost ring inside it. */
|
|
238
|
+
readonly walkBand: number;
|
|
239
|
+
}
|
|
240
|
+
/** The walkable band of the collar, as the drawn triangles themselves. */
|
|
241
|
+
interface IHeightfieldCollarWalk {
|
|
242
|
+
/** Metres past the edge where the band ends. */
|
|
243
|
+
readonly extent: number;
|
|
244
|
+
/** A view of the collar's own position buffer and index slice, not a resample. */
|
|
245
|
+
readonly geometry: BufferGeometry;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* A heightfield's far ring: `rings` square rings past its playable square, one vertex per boundary
|
|
249
|
+
* sample, and the index grid that draws them.
|
|
250
|
+
* @situation draw the terrain past the playable square without hand-building a ring grid
|
|
251
|
+
* @situation ground a character past the square, out to the walk band, on drawn triangles
|
|
252
|
+
* @constraint every ring vertex asks the game's `height` callback; core owns no terrain look
|
|
253
|
+
* @constraint the collar is a ring of triangles, not a field: `heightAt` answers on it and null off it
|
|
254
|
+
* @example const collar = new HeightfieldCollar({ resolution: 129, size: 512, rings: 384, ringDistance: (ring) => (ring / 384) ** 1.65 * 2100, walkBand: 200, height: ({ x, z }) => surveyed.heightAt(x, z) });
|
|
255
|
+
*/
|
|
256
|
+
declare class HeightfieldCollar {
|
|
257
|
+
#private;
|
|
258
|
+
/** The drawn ring grid: positions, then the index triangles between the rings. */
|
|
259
|
+
readonly geometry: BufferGeometry;
|
|
260
|
+
/** Vertices around one ring. */
|
|
261
|
+
readonly perimeter: number;
|
|
262
|
+
/** Ring count, outermost included. */
|
|
263
|
+
readonly rings: number;
|
|
264
|
+
/** The band a collider follows, and the outermost ring it reaches. */
|
|
265
|
+
readonly walk: IHeightfieldCollarWalk;
|
|
266
|
+
/** Metres past the edge that stay walkable. */
|
|
267
|
+
readonly walkBand: number;
|
|
268
|
+
constructor(options: IHeightfieldCollarOptions);
|
|
269
|
+
/**
|
|
270
|
+
* The boundary sample one perimeter vertex stands over: a column and row of the heightfield's own
|
|
271
|
+
* grid, in the walk's order, so the square's edge heights, seams and colours are a lookup.
|
|
272
|
+
*/
|
|
273
|
+
boundary(vertex: number): {
|
|
274
|
+
readonly column: number;
|
|
275
|
+
readonly row: number;
|
|
276
|
+
};
|
|
277
|
+
/** Metres past the square's edge of one ring. */
|
|
278
|
+
distance(ring: number): number;
|
|
279
|
+
/**
|
|
280
|
+
* The drawn collar's height under a world point: bilinear across the quad a scatter placement
|
|
281
|
+
* stands on, so a tree follows the ring grid it is planted on. Null where there is no collar.
|
|
282
|
+
*/
|
|
283
|
+
heightAt(x: number, z: number): number | null;
|
|
284
|
+
/** Vertex index of one ring site, for writing an attribute over the drawn ring grid. */
|
|
285
|
+
index(ring: number, vertex: number): number;
|
|
286
|
+
/**
|
|
287
|
+
* The quad a world point falls in, or undefined inside the square and past the outermost ring.
|
|
288
|
+
* Its four corners are `index(lower|upper, from|to)`.
|
|
289
|
+
*/
|
|
290
|
+
locate(x: number, z: number): IHeightfieldCollarQuad | undefined;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Metres a river's water reaches sideways per metre of its channel width.
|
|
295
|
+
*
|
|
296
|
+
* The water stands on its bed, not on the spline: the bake measures a channel's wet reach at 2.5
|
|
297
|
+
* widths either side of its centreline. The drawn ribbon and the query below read this one number,
|
|
298
|
+
* so a swimmer cannot leave the surface they see.
|
|
299
|
+
*/
|
|
300
|
+
declare const WATER_RIBBON_REACH = 2.5;
|
|
301
|
+
/** One river as the bake records it: stations along its centreline, its width and its flow. */
|
|
302
|
+
interface IWaterRibbon {
|
|
303
|
+
/** Stations `[x, y, z]` in world metres; `y` is the surface height at the station. */
|
|
304
|
+
readonly points: readonly (readonly number[])[];
|
|
305
|
+
/** Metres of water across the channel. The surface reaches `2.5 * width` m either side. */
|
|
306
|
+
readonly width: number;
|
|
307
|
+
/** Downstream speed in m/s, the flow that carries a swimmer along the tangent. */
|
|
308
|
+
readonly flow: number;
|
|
309
|
+
}
|
|
310
|
+
/** One lake as the bake records it: where its flood fill was seeded, its level and its cap. */
|
|
311
|
+
interface IWaterLake {
|
|
312
|
+
/** Where the flood fill was seeded, `[x, z]` in world metres. */
|
|
313
|
+
readonly at: readonly number[];
|
|
314
|
+
/** The surface's height, in metres. */
|
|
315
|
+
readonly level: number;
|
|
316
|
+
/** The furthest the game lets this water reach, in metres, whatever its basin measures. */
|
|
317
|
+
readonly radius: number;
|
|
318
|
+
/** How far past the measured waterline the water reaches, so the shore stands inside it. */
|
|
319
|
+
readonly margin: number;
|
|
320
|
+
}
|
|
321
|
+
/** A sea: one level and the square of ground it floods. */
|
|
322
|
+
interface IWaterOcean {
|
|
323
|
+
/** The surface's height, in metres. */
|
|
324
|
+
readonly level: number;
|
|
325
|
+
/** Metres from the origin the surface covers, either side of it. */
|
|
326
|
+
readonly extent: number;
|
|
327
|
+
}
|
|
328
|
+
/** Which water stands at a point. */
|
|
329
|
+
type WaterBodyKind = "river" | "lake" | "ocean";
|
|
330
|
+
/** The water standing at one (x, z): which body it is and how high its surface is. */
|
|
331
|
+
interface IWaterFootprint {
|
|
332
|
+
readonly kind: WaterBodyKind;
|
|
333
|
+
/** Surface height there, in metres. */
|
|
334
|
+
readonly level: number;
|
|
335
|
+
}
|
|
336
|
+
/** A flow in m/s along x and z; the caller may pass one to reuse instead of allocating. */
|
|
337
|
+
interface IWaterCurrent {
|
|
338
|
+
x: number;
|
|
339
|
+
z: number;
|
|
340
|
+
}
|
|
341
|
+
/** The baked water of one world: the arrays a game's biome file names, and the ground they flood. */
|
|
342
|
+
interface IWaterBodiesOptions {
|
|
343
|
+
readonly ribbons?: readonly IWaterRibbon[];
|
|
344
|
+
readonly lakes?: readonly IWaterLake[];
|
|
345
|
+
readonly ocean?: IWaterOcean;
|
|
346
|
+
/** The canonical terrain. A lake's footprint is measured on it, so any lake needs it. */
|
|
347
|
+
readonly field?: Heightfield;
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* The furthest a lake's basin reaches on a bearing: where the drawn ground crosses its level.
|
|
351
|
+
*
|
|
352
|
+
* Twenty-four bearings step outwards and stop at the first bank, because binary-searching the whole
|
|
353
|
+
* ray can jump a dry ridge into another pond. Eighteen halvings land inside two centimetres at this
|
|
354
|
+
* scale, well under the ground's own sample spacing.
|
|
355
|
+
*
|
|
356
|
+
* @situation measure where a lake's water meets the ground it floods
|
|
357
|
+
* @situation size a lake's drawn surface or the footprint a swimmer may enter
|
|
358
|
+
* @constraint returns metres on the furthest bearing; the caller applies its own cap
|
|
359
|
+
* @example const reach = waterlineRadius(field, lake.at, lake.level) * 1.12;
|
|
360
|
+
*/
|
|
361
|
+
declare function waterlineRadius(field: Heightfield, centre: readonly number[], level: number): number;
|
|
362
|
+
/**
|
|
363
|
+
* How far a lake's water reaches: the waterline its basin measures, `margin` times out, capped.
|
|
364
|
+
*
|
|
365
|
+
* The drawn surface and the swim footprint both size themselves here, so the shore a player sees is
|
|
366
|
+
* the shore they stop at.
|
|
367
|
+
*
|
|
368
|
+
* @situation size a lake's footprint from its basin and the cap its biome row names
|
|
369
|
+
* @constraint reads the heightfield at every bearing, once per lake, never per frame
|
|
370
|
+
* @example const reach = lakeReach(field, { ...lake, margin: 1.12 });
|
|
371
|
+
*/
|
|
372
|
+
declare function lakeReach(field: Heightfield, lake: IWaterLake): number;
|
|
373
|
+
/**
|
|
374
|
+
* One world's water, queried: surface height, current and footprint from the baked arrays.
|
|
375
|
+
*
|
|
376
|
+
* Rendering and physics read the same store, as they do for `Heightfield`, so the surface a player
|
|
377
|
+
* sees and the surface a swimmer rests on cannot disagree. Every station, level, extent and speed
|
|
378
|
+
* comes from the game, and the shading stays in the game's own `src/render/`.
|
|
379
|
+
*
|
|
380
|
+
* A river's segments sit in a uniform grid, so a query tests the few that can reach its cell
|
|
381
|
+
* instead of every station of every river.
|
|
382
|
+
*
|
|
383
|
+
* @situation ask how high the water is where a player swims
|
|
384
|
+
* @situation ask which way a current carries a body
|
|
385
|
+
* @situation ask which water body covers a point, and how high its surface is
|
|
386
|
+
* @situation share one water store between rendering and physics
|
|
387
|
+
* @constraint every station, level, extent and speed comes from the game's own bake; a lake is measured on the field passed in
|
|
388
|
+
* @example const water = new WaterBodies({ ribbons, lakes, field }); const height = water.surfaceAt(x, z);
|
|
389
|
+
*/
|
|
390
|
+
declare class WaterBodies {
|
|
391
|
+
#private;
|
|
392
|
+
constructor(options: IWaterBodiesOptions);
|
|
393
|
+
/** The height of the water at (x, z), or `undefined` where none is drawn. */
|
|
394
|
+
surfaceAt(x: number, z: number): number | undefined;
|
|
395
|
+
/**
|
|
396
|
+
* The flow that carries a body at (x, z), in m/s, or `undefined` where there is no water.
|
|
397
|
+
*
|
|
398
|
+
* A river carries a swimmer along its tangent at the ribbon's flow; a lake and the sea stand still
|
|
399
|
+
* and report a zero vector. The result is written into `out` when one is passed, so a caller in a
|
|
400
|
+
* hot loop owns no allocation.
|
|
401
|
+
*/
|
|
402
|
+
currentAt(x: number, z: number, out?: IWaterCurrent): IWaterCurrent | undefined;
|
|
403
|
+
/** Which water body covers (x, z) and how high its surface is, or `undefined` where none is. */
|
|
404
|
+
footprintAt(x: number, z: number): IWaterFootprint | undefined;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/** How a ribbon is cut; every value has the default `WaterBodies` and the Strata preview use. */
|
|
408
|
+
interface IRiverRibbonOptions {
|
|
409
|
+
/** Vertices across each station. Default 25. */
|
|
410
|
+
readonly columns?: number;
|
|
411
|
+
/** Reach either side of the centreline, per metre of channel width. Default `WATER_RIBBON_REACH`. */
|
|
412
|
+
readonly reach?: number;
|
|
413
|
+
/** Deepest water the `metres` attribute records. Default unbounded. */
|
|
414
|
+
readonly maxDepth?: number;
|
|
415
|
+
/** Metres of depth lost per metre toward the ribbon's edge, so the edges read shallow. Default 0.2. */
|
|
416
|
+
readonly edgeSlope?: number;
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* The water surface of every river, as one geometry with one group per river.
|
|
420
|
+
*
|
|
421
|
+
* Each station is a row across the river at its own surface height, out to `reach` widths either side
|
|
422
|
+
* of the centreline, the reach `WaterBodies` floods; one more row a reach past each end stands where
|
|
423
|
+
* `WaterBodies` clamps a segment, so the water a swimmer finds past a river's end is drawn there too
|
|
424
|
+
* (cut at the end station, the surface stopped in a straight edge with its carved bed dry beyond).
|
|
425
|
+
* Quads dry on both rows against `field` are dropped, so the surface ends at the shore.
|
|
426
|
+
* Past an end where the ground falls below the end's bed, the water would run off: that cap is not
|
|
427
|
+
* drawn, and the end stays cut at its last station.
|
|
428
|
+
*
|
|
429
|
+
* Attributes for the game's water material: `flow` (the unit downstream heading), `flowUv` (metres
|
|
430
|
+
* down the centreline, metres across it) and `metres` (water depth over the ground). It decides no
|
|
431
|
+
* colour, ripple or opacity: the game shades it.
|
|
432
|
+
*
|
|
433
|
+
* @situation draw a river's water surface from the baked stations
|
|
434
|
+
* @situation a river's water stops in a straight edge, or a swimmer floats where no water is drawn
|
|
435
|
+
* @situation share one river shape between the drawn water and the swimmer
|
|
436
|
+
* @situation river water hangs over dry ground past the river's head or tail
|
|
437
|
+
* @constraint stations, width and reach come from the game's bake; the game's material shades the geometry
|
|
438
|
+
* @example const geometry = riverRibbonGeometry(rivers, field, { maxDepth: 1.6 });
|
|
439
|
+
*/
|
|
440
|
+
declare function riverRibbonGeometry(rivers: readonly {
|
|
441
|
+
readonly points: readonly (readonly number[])[];
|
|
442
|
+
readonly width: number;
|
|
443
|
+
}[], field: Heightfield, options?: IRiverRibbonOptions): BufferGeometry;
|
|
444
|
+
/** How a lake's disc is meshed; every default is the Strata preview's. */
|
|
445
|
+
interface ILakeSurfaceOptions {
|
|
446
|
+
/** Rings from the centre to the reach. Default 44. */
|
|
447
|
+
readonly rings?: number;
|
|
448
|
+
/** Vertices around each ring. Default 88. */
|
|
449
|
+
readonly spokes?: number;
|
|
450
|
+
/** How the ring spacing grows outwards; above 1 packs vertices into the near water. Default 1.7. */
|
|
451
|
+
readonly packing?: number;
|
|
452
|
+
/** Deepest water the `metres` attribute records. Default unbounded. */
|
|
453
|
+
readonly maxDepth?: number;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* A lake's water surface: a level disc out to `lakeReach`, the footprint `WaterBodies` floods, with a
|
|
457
|
+
* `metres` attribute (water depth over the ground). Only cells with water at a corner get triangles,
|
|
458
|
+
* so the surface does not hover over dry hillside and the shore follows the ground's contour. The
|
|
459
|
+
* rings pack towards the middle, so an irregular basin costs vertices where the camera sees them.
|
|
460
|
+
* Returns `undefined` when the basin holds no water at its level.
|
|
461
|
+
*
|
|
462
|
+
* @situation draw a lake's water surface from the baked level and seed
|
|
463
|
+
* @situation a lake's drawn water and the swimmer's water disagree
|
|
464
|
+
* @constraint the lake row and field come from the game's bake; the game's material shades the geometry
|
|
465
|
+
* @example const geometry = lakeSurfaceGeometry({ ...lake, margin: 1.12 }, field, { maxDepth: 1.6 });
|
|
466
|
+
*/
|
|
467
|
+
declare function lakeSurfaceGeometry(lake: IWaterLake, field: Heightfield, options?: ILakeSurfaceOptions): BufferGeometry | undefined;
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* The terrain geometry `TerrainTiles` builds and keeps: level meshes, skirts, edges, stitch strips and
|
|
471
|
+
merged blocks. Split out of `world-tiles.ts` verbatim (PRD-797).
|
|
472
|
+
*/
|
|
473
|
+
|
|
17
474
|
type MeshSurface = NonNullable<ConstructorParameters<typeof Mesh>[1]>;
|
|
475
|
+
|
|
18
476
|
interface IWorldTileCollider {
|
|
19
477
|
dispose(): void;
|
|
20
478
|
}
|
|
@@ -91,6 +549,24 @@ interface IWorldTilesOptions {
|
|
|
91
549
|
readonly residentByteBudget: number;
|
|
92
550
|
readonly residentTileBudget: number;
|
|
93
551
|
readonly sampleHeight: IHeightfieldSamplerOptions["sampleHeight"];
|
|
552
|
+
/** The ground's footprint in tile-local metres: a tile wholly outside it is never meshed (it only repeats the edge sample). */
|
|
553
|
+
readonly extent?: {
|
|
554
|
+
readonly maxX: number;
|
|
555
|
+
readonly maxZ: number;
|
|
556
|
+
readonly minX: number;
|
|
557
|
+
readonly minZ: number;
|
|
558
|
+
};
|
|
559
|
+
/**
|
|
560
|
+
* A region another surface already draws and collides, in tile-local metres: a tile wholly inside
|
|
561
|
+
* it is never meshed and gets no collider. A tile that only overlaps it is meshed whole; the game
|
|
562
|
+
* hides the overlap in its own surface.
|
|
563
|
+
*/
|
|
564
|
+
readonly hole?: {
|
|
565
|
+
readonly maxX: number;
|
|
566
|
+
readonly maxZ: number;
|
|
567
|
+
readonly minX: number;
|
|
568
|
+
readonly minZ: number;
|
|
569
|
+
};
|
|
94
570
|
/** How deep each edge skirt extends below its surface. Defaults to one tile width. */
|
|
95
571
|
readonly skirtDepth?: number;
|
|
96
572
|
/** Square tile neighborhood to consider around the followed point. Defaults to 1. */
|
|
@@ -130,6 +606,8 @@ interface IWorldTilesOptions {
|
|
|
130
606
|
* @situation stream terrain without cracks
|
|
131
607
|
* @situation keep generated terrain resident around a moving player
|
|
132
608
|
* @situation put a generated terrain tile into a game-owned physics world
|
|
609
|
+
* @situation a hole or a flicker where streamed terrain tiles are still building (`settledHalf`)
|
|
610
|
+
* @situation split the ground between streamed tiles and a far mesh around the player (`settledHalf`)
|
|
133
611
|
* @alias stream terrain across chunks
|
|
134
612
|
* @constraint sampleHeight and surface are required game choices; no landform or surface preset is installed
|
|
135
613
|
* @constraint residentTileBudget and residentByteBudget are hard caps; a tile that cannot fit throws
|
|
@@ -224,6 +702,19 @@ declare class TerrainTiles extends Object3D implements IComputeDriven {
|
|
|
224
702
|
get deferredAdmissions(): number;
|
|
225
703
|
get warmupNodes(): readonly unknown[];
|
|
226
704
|
getTile(key: string): IWorldTile | undefined;
|
|
705
|
+
/**
|
|
706
|
+
* Half-width, in metres, of the largest square of tiles around `position`'s tile that is fully
|
|
707
|
+
* settled: each tile in it is resident, or is one the stream never draws (wholly inside `hole` or
|
|
708
|
+
* past `extent`). Zero while the tile under `position` is still building. A game that draws other
|
|
709
|
+
* ground where the tiles have not arrived (a collar, a far mesh) clips it to this square, so a tile
|
|
710
|
+
* still building shows that ground, never a hole.
|
|
711
|
+
*
|
|
712
|
+
* @situation a hole or a flicker where streamed terrain tiles are still building
|
|
713
|
+
* @situation split the ground between streamed tiles and a far mesh around the player
|
|
714
|
+
* @constraint reads residency only; call it after `follow` in the same frame
|
|
715
|
+
* @example split.half.value = tiles.settledHalf(player.position);
|
|
716
|
+
*/
|
|
717
|
+
settledHalf(position: Pick<Vector3, "x" | "z">): number;
|
|
227
718
|
/**
|
|
228
719
|
* Move residency to the followed point: admit, evict and re-level every tile.
|
|
229
720
|
*
|
|
@@ -243,25 +734,194 @@ declare class TerrainTiles extends Object3D implements IComputeDriven {
|
|
|
243
734
|
required: number;
|
|
244
735
|
loaded: number;
|
|
245
736
|
};
|
|
737
|
+
/** Loaded selected tiles intersecting the camera; bounds include terrain heights before admission. */
|
|
738
|
+
readinessInView(camera: Camera, heightBounds: readonly [number, number]): {
|
|
739
|
+
required: number;
|
|
740
|
+
loaded: number;
|
|
741
|
+
};
|
|
246
742
|
debug(): Record<string, unknown>;
|
|
247
743
|
detach(): void;
|
|
248
744
|
dispose(): void;
|
|
249
745
|
}
|
|
250
746
|
|
|
251
747
|
/**
|
|
252
|
-
*
|
|
748
|
+
* One frame's admission allowance, shared by every path that puts streamed content on screen.
|
|
749
|
+
*
|
|
750
|
+
* A streaming world has no frame-time ceiling anywhere else: a cell row arriving builds a batch per
|
|
751
|
+
* asset run over every placement in it, a terrain tile builds every LOD level, and the game's
|
|
752
|
+
* `createCollider` runs for every resident tile — all in the one frame that discovers them. That is
|
|
753
|
+
* the 100-330 ms hitch a 60 m/s camera feels every time the ring moves, and it is admission cost,
|
|
754
|
+
* not streaming: the loads never fail.
|
|
755
|
+
*
|
|
756
|
+
* The budget is opened once per `update` and drawn down by the units it admits. A unit always
|
|
757
|
+
* finishes, so a frame spends at most the limit plus the unit that crossed it, and the rest of the
|
|
758
|
+
* backlog waits for the next frame rather than being dropped.
|
|
759
|
+
*
|
|
760
|
+
* @situation streamed terrain tiles or cells hitch the frame that admits them
|
|
761
|
+
* @situation cap how many milliseconds a frame spends building streamed content
|
|
762
|
+
* @constraint open a new budget each frame; a unit always finishes, so one unit can cross the limit
|
|
763
|
+
* @example tiles.follow(player.position, new AdmissionBudget(2, () => performance.now()));
|
|
764
|
+
*/
|
|
765
|
+
declare class AdmissionBudget implements IAdmissionBudget {
|
|
766
|
+
#private;
|
|
767
|
+
constructor(limitMs: number, now: () => number);
|
|
768
|
+
get spentMs(): number;
|
|
769
|
+
admit(work: () => void): boolean;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
/** How the shore field reads open water; every default is the Strata coastal world's. */
|
|
773
|
+
interface IShoreFieldOptions {
|
|
774
|
+
/** Water must be this many metres deep for open-sea exposure to flood through it. Default 2. */
|
|
775
|
+
readonly openDepth?: number;
|
|
776
|
+
/** Metres of shallow water that exposure still carries into, never across dry ground. Default 18. */
|
|
777
|
+
readonly carry?: number;
|
|
778
|
+
}
|
|
779
|
+
/** Per grid node: metres to the nearest dry node, and 1 where the open sea reaches. */
|
|
780
|
+
interface IShoreField {
|
|
781
|
+
readonly distance: Float32Array;
|
|
782
|
+
readonly exposed: Uint8Array;
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* Distance to the shore and open-sea exposure for every node of a square height grid, measured once
|
|
786
|
+
* from the bake. `distance` is a two-pass chamfer distance to the nearest node at or above `level`
|
|
787
|
+
* (0 on dry ground). `exposed` floods from the grid's edge through water deeper than `openDepth`,
|
|
788
|
+
* then `carry` metres further into shallow water, so a sheltered lagoon behind a sand bar stays out
|
|
789
|
+
* of it. Both feed the game's surf and shore masks; neither decides a colour.
|
|
790
|
+
*
|
|
791
|
+
* @situation surf breaks only on water open to the sea, not in a sheltered lagoon
|
|
792
|
+
* @situation distance from each water cell to the shore, for a foam or depth mask
|
|
793
|
+
* @constraint heights are row-major, `resolution` by `resolution`, across `size` metres; measured once, never per frame
|
|
794
|
+
* @example const { distance, exposed } = shoreField(world.heights, world.resolution, world.size, world.waterLevel);
|
|
795
|
+
*/
|
|
796
|
+
declare function shoreField(heights: ArrayLike<number>, resolution: number, size: number, level: number, options?: IShoreFieldOptions): IShoreField;
|
|
797
|
+
|
|
798
|
+
/** The drawn surface's height under a world point, or `null` where the sampler cannot answer. */
|
|
799
|
+
type SurfaceSampler = (x: number, z: number) => number | null;
|
|
800
|
+
/**
|
|
801
|
+
* `Heightfield.surfaceAt` under the transform the game draws the field's mesh with, so a prop or a
|
|
802
|
+
* player stands on the triangles the eye sees rather than on the bilinear field between them.
|
|
803
|
+
* Answers `null` outside the field and for a transform it does not model (any rotation, or an
|
|
804
|
+
* unequal scale), so the caller keeps its own fallback there.
|
|
805
|
+
*
|
|
806
|
+
* @situation stand props or a player on the drawn terrain triangles under a moved or scaled mesh
|
|
807
|
+
* @situation props float or sink where the terrain mesh is drawn under a transform
|
|
808
|
+
* @constraint the mesh is `field.toGeometry()` drawn upright under a uniform scale; read `matrixWorld` after it settles
|
|
809
|
+
* @example const ground = surfaceSampler(field, mesh.matrixWorld); const y = ground(x, z) ?? fallback;
|
|
810
|
+
*/
|
|
811
|
+
declare function surfaceSampler(field: Heightfield, matrixWorld: Matrix4): SurfaceSampler;
|
|
812
|
+
|
|
813
|
+
/** Ground height under a world point, or `null` where no ground answers. */
|
|
814
|
+
type StaticGroundQuery = (x: number, z: number) => number | null;
|
|
815
|
+
/**
|
|
816
|
+
* Exact lowest world Y of a static geometry under `matrix`, the precise measurement `GroundSnap`
|
|
817
|
+
* audits against, cheap enough for a load that poses hundreds of thousands of props. An upright
|
|
818
|
+
* pose reads the bounding box. A tilted pose scans the vertices bottom first (sorted once per
|
|
819
|
+
* geometry) and stops once no later vertex can be lower: `|x e1 + z e9| <= reach * hypot(e1, e9)`.
|
|
820
|
+
*
|
|
821
|
+
* @situation stand a scattered rock, tree or crate on the ground by its lowest point, not its origin
|
|
822
|
+
* @situation props hover or sink because their pivot is not at their base
|
|
823
|
+
* @constraint static geometry only; a skinned model uses `GroundSnap`; the sort is cached per geometry, so do not mutate its positions
|
|
824
|
+
* @example placed.position.y += ground - staticLowestY(geometry, matrix);
|
|
825
|
+
*/
|
|
826
|
+
declare function staticLowestY(geometry: BufferGeometry, matrix: Matrix4): number;
|
|
827
|
+
/**
|
|
828
|
+
* How far the flat underside of a static geometry rises above the ground at its highest point.
|
|
829
|
+
* Snapping the lowest point leaves the downhill side of a flat-bottomed rock hanging; sinking the
|
|
830
|
+
* pose by this much buries the whole footprint. Returns 0 when the footprint is already buried.
|
|
831
|
+
*
|
|
832
|
+
* @situation a rock snapped to a slope shows a lip or a gap under its downhill side
|
|
833
|
+
* @constraint the footprint is every vertex at the geometry's lowest local y; throws `TN_STATIC_POSE_GROUND` where the ground does not answer
|
|
834
|
+
* @example matrix.elements[13] -= footprintGap(geometry, matrix, ground, 0.08);
|
|
835
|
+
*/
|
|
836
|
+
declare function footprintGap(geometry: BufferGeometry, matrix: Matrix4, ground: StaticGroundQuery, margin?: number): number;
|
|
837
|
+
/** What `baseRingGap` measured around a wide static model. */
|
|
838
|
+
interface IBaseRing {
|
|
839
|
+
/** The largest height of a sector's lowest rim vertex above its ground, in metres. */
|
|
840
|
+
readonly gap: number;
|
|
841
|
+
/** Sectors that held a rim vertex. */
|
|
842
|
+
readonly samples: number;
|
|
843
|
+
}
|
|
844
|
+
/**
|
|
845
|
+
* The highest gap between a wide model's rim and the ground, one sample per angular sector: in
|
|
846
|
+
* each sector, the lowest vertex beyond `rim` of that sector's reach. A narrow buried stem then
|
|
847
|
+
* cannot hold a wide base up in the air on the downhill side. Sink the pose by `gap` (plus any
|
|
848
|
+
* burial the game wants) to close it.
|
|
849
|
+
*
|
|
850
|
+
* @situation a cliff or crag model rests on a buried stem while its wide base hangs over the downhill ground
|
|
851
|
+
* @constraint throws `TN_STATIC_POSE_GROUND` where the ground does not answer; check `samples` before trusting `gap`
|
|
852
|
+
* @example const ring = baseRingGap(geometry, matrix, ground); if (ring.samples >= 4) matrix.elements[13] -= ring.gap + 0.5;
|
|
853
|
+
*/
|
|
854
|
+
declare function baseRingGap(geometry: BufferGeometry, matrix: Matrix4, ground: StaticGroundQuery, options?: {
|
|
855
|
+
readonly sectors?: number;
|
|
856
|
+
readonly rim?: number;
|
|
857
|
+
}): IBaseRing;
|
|
858
|
+
|
|
859
|
+
/** One material section of a mesh: the whole mesh, or one group of a multi-material mesh. */
|
|
860
|
+
interface IMeshSection {
|
|
861
|
+
readonly material: Material;
|
|
862
|
+
readonly group?: {
|
|
863
|
+
readonly start: number;
|
|
864
|
+
readonly count: number;
|
|
865
|
+
};
|
|
866
|
+
}
|
|
867
|
+
/**
|
|
868
|
+
* A mesh's material sections: one per geometry group for a material array, else the whole mesh.
|
|
869
|
+
* Instanced props draw one batch per material, so an imported model splits here first.
|
|
870
|
+
*
|
|
871
|
+
* @situation scatter or instance an imported glTF model that has several materials
|
|
872
|
+
* @constraint a section's `material` can be `undefined` for a group naming a missing material slot; skip it
|
|
873
|
+
* @example for (const section of meshSections(mesh)) parts.push(sectionGeometry(mesh, box, section));
|
|
874
|
+
*/
|
|
875
|
+
declare function meshSections(mesh: Mesh): IMeshSection[];
|
|
876
|
+
/**
|
|
877
|
+
* One section's geometry in model space, standing on y = 0. Every section of a model takes the same
|
|
878
|
+
* base from the whole model's `box`, so a crown keeps its place on its trunk: basing each section on
|
|
879
|
+
* its own bounds detaches them. The mesh's LOD0 geometry is cloned under its world matrix, and a
|
|
880
|
+
* group becomes the clone's draw range.
|
|
881
|
+
*
|
|
882
|
+
* @situation the crown of an instanced tree floats off its trunk, or the parts of a model separate
|
|
883
|
+
* @situation turn each part of an imported model into a geometry for an instanced prop batch
|
|
884
|
+
* @constraint `box` is the whole model's world bounds after any unit normalisation; call `mesh.updateWorldMatrix` first
|
|
885
|
+
* @example const box = new Box3().setFromObject(root); const geometry = sectionGeometry(mesh, box, section);
|
|
886
|
+
*/
|
|
887
|
+
declare function sectionGeometry(mesh: Mesh, box: Box3, section: IMeshSection, options?: {
|
|
888
|
+
readonly centreXZ?: boolean;
|
|
889
|
+
}): BufferGeometry;
|
|
890
|
+
/**
|
|
891
|
+
* Recompute the normals of a geometry whose normals are missing, zero or not finite, and leave
|
|
892
|
+
* authored normals alone. Some exported art ships zero normals and draws black under any light.
|
|
893
|
+
* Run it after any reshape, so the recomputed normals fit the final shape.
|
|
253
894
|
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
895
|
+
* @situation an imported model draws black or unlit because it ships zero normals
|
|
896
|
+
* @constraint one bad normal recomputes them all; an intentionally hard-edged model loses its authored split normals only if one is bad
|
|
897
|
+
* @example geometry.scale(1.1, 1, 1.1); repairZeroNormals(geometry);
|
|
898
|
+
*/
|
|
899
|
+
declare function repairZeroNormals(geometry: BufferGeometry): boolean;
|
|
900
|
+
|
|
901
|
+
/** How long `warmUnculled` keeps a subtree drawing whole. */
|
|
902
|
+
interface IWarmUnculledOptions {
|
|
903
|
+
/** World draws to spend once `when` holds before the subtree is culled again. Default 2. */
|
|
904
|
+
readonly draws?: number;
|
|
905
|
+
/** Counts a draw only while this holds, such as "every tile around the spawn is resident". */
|
|
906
|
+
readonly when?: () => boolean;
|
|
907
|
+
}
|
|
908
|
+
/**
|
|
909
|
+
* Draw `root` with frustum culling off until it has drawn `draws` times, then cull it again and
|
|
910
|
+
* resolve. A pipeline is built by its first real draw (a startup warm-up compiles a different pass),
|
|
911
|
+
* so content the spawn view does not see — streamed tiles behind the player, a mirror that draws only
|
|
912
|
+
* when its water does — builds its pipelines after the reveal and hitches the first frames that see
|
|
913
|
+
* it. Join the promise to the loading curtain to build them behind it. Objects that join `root`
|
|
914
|
+
* while it warms draw unculled too.
|
|
260
915
|
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
*
|
|
916
|
+
* @situation the first frames after the loading curtain hitch on pipeline builds for content behind the camera
|
|
917
|
+
* @situation streamed terrain or a lake compiles its pipelines after the reveal
|
|
918
|
+
* @constraint `ctx.beforeRender` runs on every world draw, also behind the curtain; join the promise to the curtain's hold
|
|
919
|
+
* @example const warm = warmUnculled(ctx, lake.mesh); ctx.startup.hold("lake", () => warm);
|
|
264
920
|
*/
|
|
921
|
+
declare function warmUnculled(ctx: {
|
|
922
|
+
beforeRender(callback: () => void): void;
|
|
923
|
+
}, root: Object3D, options?: IWarmUnculledOptions): Promise<void>;
|
|
924
|
+
|
|
265
925
|
/** Marker printed when terrain validation is on, so a log says which mode produced it. */
|
|
266
926
|
declare const TERRAIN_VALIDATE_MARKER = "TN_TERRAIN_VALIDATE";
|
|
267
927
|
/** The launch flag. */
|
|
@@ -357,12 +1017,19 @@ interface IWorldTerrain {
|
|
|
357
1017
|
interface IWorldAssetLod {
|
|
358
1018
|
readonly glb: string;
|
|
359
1019
|
readonly distance: number;
|
|
1020
|
+
/**
|
|
1021
|
+
* Scene to draw from `glb`. A cooked species stores every level of one model in one file with
|
|
1022
|
+
* its textures, so its levels name the same `glb` and select a scene instead of a file.
|
|
1023
|
+
*/
|
|
1024
|
+
readonly scene?: string;
|
|
360
1025
|
}
|
|
361
1026
|
interface IWorldAssetBounds {
|
|
362
1027
|
readonly min: readonly [number, number, number];
|
|
363
1028
|
readonly max: readonly [number, number, number];
|
|
364
1029
|
}
|
|
365
1030
|
interface IWorldAsset {
|
|
1031
|
+
/** Caller-owned terminal impostor distance in world metres; requires WorldCells impostors opt-in. */
|
|
1032
|
+
readonly impostorDistance?: number;
|
|
366
1033
|
readonly glb: string;
|
|
367
1034
|
readonly lods?: readonly IWorldAssetLod[];
|
|
368
1035
|
readonly bounds: IWorldAssetBounds;
|
|
@@ -401,6 +1068,8 @@ interface IWorldPackage {
|
|
|
401
1068
|
readonly terrain: IWorldTerrain;
|
|
402
1069
|
readonly assets: Readonly<Record<string, IWorldAsset>>;
|
|
403
1070
|
readonly placements: string;
|
|
1071
|
+
/** Optional package-relative JSON array of placement IDs in binary record order. */
|
|
1072
|
+
readonly placementIds?: string;
|
|
404
1073
|
readonly cells: readonly IWorldCell[];
|
|
405
1074
|
}
|
|
406
1075
|
interface IWorldPackageValidationOptions {
|
|
@@ -527,6 +1196,7 @@ declare function snowDiscFootprint(radius: number, options?: ISnowDiscFootprintO
|
|
|
527
1196
|
* recovery. It is a heightfield approximation — not granular snow, displaced-volume
|
|
528
1197
|
* conservation, avalanches, melting or a calibrated material law.
|
|
529
1198
|
* @situation leave footprints, tracks and tyre ruts in snow that persist and fill in over time
|
|
1199
|
+
* @situation let a fresh snowfall slowly fill older tracks back in as the field recovers
|
|
530
1200
|
* @situation let a pushed sphere carve a connected track and a dropped one settle into a crater
|
|
531
1201
|
* @situation store snow deformation that rendered geometry and collision both read
|
|
532
1202
|
* @situation reset a snowfield between rounds or change its depth at runtime
|
|
@@ -666,6 +1336,14 @@ interface ITerrainSplatLayer {
|
|
|
666
1336
|
readonly id: string;
|
|
667
1337
|
readonly tile: number;
|
|
668
1338
|
readonly tint: readonly [number, number, number];
|
|
1339
|
+
/** Package-relative image paths; omitted entries retain `<textures>/<id>_<kind>.jpg`.
|
|
1340
|
+
* Normal, ORM and height maps are still loaded only when their flags request them. */
|
|
1341
|
+
readonly maps?: {
|
|
1342
|
+
readonly diffuse?: string;
|
|
1343
|
+
readonly normal?: string;
|
|
1344
|
+
readonly orm?: string;
|
|
1345
|
+
readonly height?: string;
|
|
1346
|
+
};
|
|
669
1347
|
readonly normal?: boolean;
|
|
670
1348
|
/** `<id>_orm.jpg`: occlusion in r, roughness in g, metalness in b, read as linear data. */
|
|
671
1349
|
readonly orm?: boolean;
|
|
@@ -739,13 +1417,45 @@ interface ITerrainSplatWeightContext {
|
|
|
739
1417
|
/** The layer's index in `table.layers`. */
|
|
740
1418
|
readonly index: number;
|
|
741
1419
|
}
|
|
1420
|
+
/** Loaded images for one game-authored sample; index 0 is the base, then table.layers in order.
|
|
1421
|
+
* The loader owns these images until the returned material is disposed; do not dispose them. */
|
|
1422
|
+
interface ITerrainSplatSampleContext {
|
|
1423
|
+
readonly layer: ITerrainSplatLayer;
|
|
1424
|
+
readonly index: number;
|
|
1425
|
+
readonly diffuse: Texture;
|
|
1426
|
+
readonly normal: Texture | undefined;
|
|
1427
|
+
readonly orm: Texture | undefined;
|
|
1428
|
+
readonly height: Texture | undefined;
|
|
1429
|
+
}
|
|
1430
|
+
/** A game's projected layer. An absent normal leaves the accumulated normal unchanged.
|
|
1431
|
+
* Normals are encoded OpenGL for the default factory; a custom factory owns their encoding.
|
|
1432
|
+
* An absent ORM uses the layer's existing map or scalar response. */
|
|
1433
|
+
interface ITerrainSplatSample {
|
|
1434
|
+
readonly color: Node<"vec3">;
|
|
1435
|
+
readonly normal?: Node<"vec3">;
|
|
1436
|
+
readonly orm?: Node<"vec3">;
|
|
1437
|
+
}
|
|
1438
|
+
/** Engine-blended channels; color includes the table's macro variation. */
|
|
1439
|
+
interface ITerrainSplatMaterialContext {
|
|
1440
|
+
readonly color: Node<"vec3">;
|
|
1441
|
+
readonly normal: Node<"vec3">;
|
|
1442
|
+
readonly orm: Node<"vec3">;
|
|
1443
|
+
}
|
|
742
1444
|
interface ILoadTerrainSplatOptions {
|
|
743
1445
|
readonly assets: IAssetLoader;
|
|
1446
|
+
/** Game-authored appearance. The baked splat mask descriptor and texture folder remain in the package. */
|
|
1447
|
+
readonly table?: Pick<ITerrainSplatTable, "base" | "breakup" | "macro" | "layers">;
|
|
744
1448
|
/**
|
|
745
1449
|
* The live renderer. Uncompressed layers stack into one array texture per set through GPU copies,
|
|
746
1450
|
* which need one; without it every layer keeps its own sampler and the marker says so.
|
|
747
1451
|
*/
|
|
748
1452
|
readonly renderer?: IRendererLike;
|
|
1453
|
+
/** Precomputed for every layer before layerWeight runs; replaces the package's projection.
|
|
1454
|
+
* Custom sampling retains the loaded images and skips texture-array stacking. */
|
|
1455
|
+
readonly layerSample?: (context: ITerrainSplatSampleContext) => ITerrainSplatSample;
|
|
1456
|
+
/** Replaces final material assembly, retaining the engine's ordered channel blend.
|
|
1457
|
+
* Loader-owned textures are released with the returned material, including composition errors. */
|
|
1458
|
+
readonly materialFactory?: (context: ITerrainSplatMaterialContext) => Material;
|
|
749
1459
|
/**
|
|
750
1460
|
* Replaces each layer's blend weight, given the mask's own (remapped, 0..1) and the layer's
|
|
751
1461
|
* height sample. The game owns the curve, for example a height blend; the package mixes colour,
|
|
@@ -772,43 +1482,74 @@ interface ILoadTerrainSplatOptions {
|
|
|
772
1482
|
* @situation the game's terrain should match the DCC's terrain material without a second copy
|
|
773
1483
|
* @constraint the package's world.json must carry `terrain.layers.table` and `terrain.layers.splat`, written by `export_terrain_layers` in the `export_world.py` recipe
|
|
774
1484
|
* @constraint WebGPU allows 16 sampled textures per stage: same-size layers stack into one array texture per set, and `TN_TERRAIN_SPLAT samplers=<n>` reports what is left
|
|
775
|
-
* @override
|
|
1485
|
+
* @override `table` may replace `base`, `breakup`, `macro` and `layers` from game source; baked `splat` and `textures` stay package-owned
|
|
776
1486
|
* @example
|
|
777
1487
|
* const surface = await loadTerrainSplat({ assets: ctx.assets, renderer: ctx.renderer, url: "world/world.json" });
|
|
778
1488
|
* const world = await WorldCells.load({ assets: ctx.assets, url: "world/world.json", surface, follow, ring: 2 });
|
|
779
1489
|
*/
|
|
780
1490
|
declare function loadTerrainSplat(options: ILoadTerrainSplatOptions): Promise<Material>;
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
1491
|
+
/**
|
|
1492
|
+
* Apply a cooked GLB's package-authored layered surface to its marked terrain meshes.
|
|
1493
|
+
* `url` is the loaded GLB URL; extras pointers are relative to it. Uses the same asset/fetch
|
|
1494
|
+
* path as loadTerrainSplat on web and native. The caller owns the assigned materials' lifetime.
|
|
1495
|
+
* @situation apply the authored layered terrain surface after loading a cooked world GLB
|
|
1496
|
+
* @constraint url names the loaded GLB; tnTerrainSurface extras name a relative world package JSON
|
|
1497
|
+
* @override `table` may replace `base`, `breakup`, `macro` and `layers`; baked `splat` and `textures` stay package-owned
|
|
1498
|
+
* @example
|
|
1499
|
+
* await applyTerrainSurface(world.scene, { assets: ctx.assets, renderer: ctx.renderer, url: "world/world.glb" });
|
|
1500
|
+
*/
|
|
1501
|
+
declare function applyTerrainSurface(root: Object3D, options: ILoadTerrainSplatOptions): Promise<void>;
|
|
784
1502
|
|
|
785
1503
|
/**
|
|
786
|
-
*
|
|
787
|
-
*
|
|
1504
|
+
* three's MaterialX Perlin (`mx_noise_float` on a vec3) evaluated per pixel costs about 400 ALU
|
|
1505
|
+
* operations a call. The Strata forest's ground made 44 calls a pixel: 10 ms of a 27 ms frame on an
|
|
1506
|
+
* RTX 2080, the foliage 4 ms more. Unreal's advice for its own Noise expression is the same as this
|
|
1507
|
+
* file: bake it into a texture and read that (UE 5.8.3: Engine/Source/Runtime/Engine/Classes/
|
|
1508
|
+
* Materials/MaterialExpressionNoise.h:58, "can be expensive to compute").
|
|
788
1509
|
*
|
|
789
|
-
*
|
|
790
|
-
*
|
|
791
|
-
*
|
|
792
|
-
*
|
|
793
|
-
*
|
|
1510
|
+
* The volume holds that exact noise: the same Bob Jenkins hash, the same twelve gradients, the same
|
|
1511
|
+
* quintic fade and 0.982 scale, with the integer lattice wrapped every {@link NOISE_PERIOD} cells so
|
|
1512
|
+
* the volume tiles. Inside the first period the baked value at a texel centre is three's value; the
|
|
1513
|
+
* texture filter interpolates between centres {@link NOISE_TEXELS} to a lattice cell apart. Each
|
|
1514
|
+
* channel is an independent field (the lattice is hashed at a different z offset).
|
|
794
1515
|
*/
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
1516
|
+
declare const NOISE_PERIOD = 8;
|
|
1517
|
+
/** Texels per lattice cell: a cell holds the fade's S-curve in eight linear steps. */
|
|
1518
|
+
declare const NOISE_TEXELS = 8;
|
|
1519
|
+
/**
|
|
1520
|
+
* The one volume every material shares: baked on first use, 1 MiB of RGBA8 (it stays in L2).
|
|
1521
|
+
*
|
|
1522
|
+
* @situation a material needs the raw baked noise texture to sample in its own TSL
|
|
1523
|
+
* @constraint baked once per page on the main thread (about 0.15 s); every channel is an independent field
|
|
1524
|
+
* @example const volume = noiseVolume();
|
|
1525
|
+
*/
|
|
1526
|
+
declare function noiseVolume(): Data3DTexture;
|
|
1527
|
+
type Scalar = Node<"float"> | number;
|
|
1528
|
+
/**
|
|
1529
|
+
* Drop-in for `mx_noise_float(p, amplitude, pivot)` on a vec3 `p`: one filtered read of the baked
|
|
1530
|
+
* volume instead of the per-pixel Perlin. Only the 3D form: three's 2D Perlin is another function
|
|
1531
|
+
* (0.66 scale), so a vec2 caller keeps `mx_noise_float`. `channel` 1 to 3 are independent fields.
|
|
1532
|
+
*
|
|
1533
|
+
* @situation a terrain, foliage or water shader calls mx_noise_float per pixel and the frame is GPU bound
|
|
1534
|
+
* @situation open world ground material with procedural variation that must hold 60 FPS
|
|
1535
|
+
* @constraint the field tiles every NOISE_PERIOD units of p; at p = world metres x 2.6 that is a 3 m repeat
|
|
1536
|
+
* @constraint vec3 input only: three's 2D Perlin is another function
|
|
1537
|
+
* @override keep mx_noise_float where exact analytic noise matters more than the frame
|
|
1538
|
+
* @example const patch = smoothstep(-0.35, 0.35, bakedNoise(positionWorld.mul(0.025)));
|
|
1539
|
+
*/
|
|
1540
|
+
declare function bakedNoise(p: Node<"vec3">, amplitude?: Scalar, pivot?: Scalar, channel?: 0 | 1 | 2 | 3): Node<"float">;
|
|
1541
|
+
/**
|
|
1542
|
+
* Drop-in for `mx_fractal_noise_float(p, octaves, lacunarity, diminish, amplitude)`: one read an octave.
|
|
1543
|
+
*
|
|
1544
|
+
* @situation fractal or fbm noise in a material costs too much GPU time per pixel
|
|
1545
|
+
* @constraint octaves is a build-time number; each octave is one filtered volume read
|
|
1546
|
+
* @example const macro = bakedFractalNoise(vec3(positionWorld.x, 0, positionWorld.z).mul(0.014), 3);
|
|
1547
|
+
*/
|
|
1548
|
+
declare function bakedFractalNoise(p: Node<"vec3">, octaves?: number, lacunarity?: number, diminish?: number, amplitude?: Scalar): Node<"float">;
|
|
1549
|
+
|
|
1550
|
+
/** What a launch asked the GPU-scene occlusion cull to do. `measure` counts; `off` runs no test. */
|
|
1551
|
+
type OcclusionMode = "off" | "measure";
|
|
1552
|
+
|
|
812
1553
|
/** What one landed readback concluded, in the three words a log line can carry. */
|
|
813
1554
|
type GpuSceneVerdict = "ok" | "mismatch" | "error";
|
|
814
1555
|
/**
|
|
@@ -892,14 +1633,83 @@ interface IGpuSceneComparison {
|
|
|
892
1633
|
/** What stopped the check — a rejected readback, say. Non-empty is an `error` on its own. */
|
|
893
1634
|
readonly cause?: string;
|
|
894
1635
|
/**
|
|
895
|
-
* What the device and this scene held when the check reported. Absent when neither offered a
|
|
896
|
-
* finite number, and a field is omitted rather than printed as zero when its backend has none.
|
|
1636
|
+
* What the device and this scene held when the check reported. Absent when neither offered a
|
|
1637
|
+
* finite number, and a field is omitted rather than printed as zero when its backend has none.
|
|
1638
|
+
*/
|
|
1639
|
+
readonly memory?: GpuSceneMemory;
|
|
1640
|
+
/** The snapshot's own camera and nearest live placement, when both instance totals landed zero. */
|
|
1641
|
+
readonly probe?: IValidationProbe;
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
/**
|
|
1645
|
+
* One shadow map's own three numbers, which is the whole of what a level render knows that the main
|
|
1646
|
+
* camera does not.
|
|
1647
|
+
*
|
|
1648
|
+
* They are the level's, never the camera's: a map's frustum is the light's window, its gate is the
|
|
1649
|
+
* texel size it can resolve, and its base is the chain level the cluster path hands it — `#probe`
|
|
1650
|
+
* swaps a coarse level's geometry for the coarsest shape, so a coarse map draws that shape whatever a
|
|
1651
|
+
* placement's own distance would have selected. The distance itself is the main pass's, from the
|
|
1652
|
+
* eye: a placement's shape and its cast come from the key the main pass draws it in.
|
|
1653
|
+
*/
|
|
1654
|
+
interface IShadowLevel {
|
|
1655
|
+
/** The six frustum planes of this map's own shadow camera. */
|
|
1656
|
+
readonly planes: Float32Array;
|
|
1657
|
+
/** This map's texel gate in world metres: a placement narrower than it casts nothing here. */
|
|
1658
|
+
readonly gate: number;
|
|
1659
|
+
/**
|
|
1660
|
+
* The chain level this map draws at, floored over the placement's own. 0 is the placement's own
|
|
1661
|
+
* LOD by distance — what the finest map draws — and the coarsest index is what every level past
|
|
1662
|
+
* the first draws. A base whose keys are not minted draws nothing, which is why a caller settling
|
|
1663
|
+
* the prewarm first is the contract rather than a fallback.
|
|
1664
|
+
*
|
|
1665
|
+
* {@link COARSEST_SHADOW_LEVEL} is past every chain, and means the coarsest shape an asset has: a
|
|
1666
|
+
* map that coarsens its casters does not know how long each asset's chain is, and the floor is
|
|
1667
|
+
* clamped per asset, so one number asks every chain for its own coarsest level.
|
|
897
1668
|
*/
|
|
898
|
-
readonly
|
|
899
|
-
|
|
900
|
-
|
|
1669
|
+
readonly base: number;
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
/**
|
|
1673
|
+
* What the measured occlusion pass found, when a launch asked it to measure.
|
|
1674
|
+
*
|
|
1675
|
+
* `reason` names why it measured nothing (`no scene depth`), and the counts and `gpuTriangles` come
|
|
1676
|
+
* from one landed dispatch, even if a later tally was skipped for occlusion.
|
|
1677
|
+
*/
|
|
1678
|
+
interface IOcclusionReport {
|
|
1679
|
+
readonly mode: OcclusionMode;
|
|
1680
|
+
readonly reason: string;
|
|
1681
|
+
/** Pyramid levels and the dispatches that rebuild them each frame. */
|
|
1682
|
+
readonly levels: number;
|
|
1683
|
+
readonly buildDispatches: number;
|
|
1684
|
+
/** The last landed sample, and the mean over every sample that landed. */
|
|
1685
|
+
readonly instances: number;
|
|
1686
|
+
readonly triangles: number;
|
|
1687
|
+
readonly meanInstances: number;
|
|
1688
|
+
readonly meanTriangles: number;
|
|
1689
|
+
readonly samples: number;
|
|
1690
|
+
/** `triangles / gpuTriangles` of the same sample, which is what the go/no-go multiplies. */
|
|
1691
|
+
readonly share: number;
|
|
1692
|
+
readonly gpuTriangles: number;
|
|
1693
|
+
readonly ageFrames: number;
|
|
901
1694
|
}
|
|
902
|
-
|
|
1695
|
+
|
|
1696
|
+
/**
|
|
1697
|
+
* The GPU-driven main pass of a streamed world: one compute dispatch culls and LOD-selects every
|
|
1698
|
+
* resident placement, appends the survivors into a shared compacted matrix buffer, and each main
|
|
1699
|
+
* batch draws its own region of that buffer with the instance count living in a GPU-side
|
|
1700
|
+
* `DrawIndexedIndirect` record. The CPU keeps only the coarse per-key visibility.
|
|
1701
|
+
*
|
|
1702
|
+
* Everything the kernel needs is GPU data. The CPU writes the placement buffer when residency
|
|
1703
|
+
* changes and the indirect records when a key is minted, retired or regrown — a structural event —
|
|
1704
|
+
* and nothing at all per instance per frame.
|
|
1705
|
+
*
|
|
1706
|
+
* The per-instance logic exists twice on purpose: {@link cullAndSelect} is the reference, in plain
|
|
1707
|
+
* TypeScript, in `world-gpu-reference.ts`, and the TSL kernel below mirrors it line for line. The
|
|
1708
|
+
* tests run in node with no GPU, so the reference is what is proved against the CPU path; the
|
|
1709
|
+
* kernel is compiled in the browser. The types, layout constants and launch flags it shares with the
|
|
1710
|
+
* validation module live in `world-gpu-types.ts` and `world-gpu-flags.ts`, which is what keeps this
|
|
1711
|
+
* file and `world-gpu-validation.ts` from importing each other.
|
|
1712
|
+
*/
|
|
903
1713
|
interface IWorldGpuFrameValidation extends IGpuSceneComparison {
|
|
904
1714
|
/** The caller's rendered-frame identity, never inferred from readback timing. */
|
|
905
1715
|
readonly frame: number;
|
|
@@ -935,23 +1745,7 @@ interface IWorldGpuSceneReport {
|
|
|
935
1745
|
* counts and `occlusion.gpuTriangles` come from one landed dispatch, even if a later tally
|
|
936
1746
|
* was skipped for occlusion.
|
|
937
1747
|
*/
|
|
938
|
-
readonly occlusion?:
|
|
939
|
-
readonly mode: OcclusionMode;
|
|
940
|
-
readonly reason: string;
|
|
941
|
-
/** Pyramid levels and the dispatches that rebuild them each frame. */
|
|
942
|
-
readonly levels: number;
|
|
943
|
-
readonly buildDispatches: number;
|
|
944
|
-
/** The last landed sample, and the mean over every sample that landed. */
|
|
945
|
-
readonly instances: number;
|
|
946
|
-
readonly triangles: number;
|
|
947
|
-
readonly meanInstances: number;
|
|
948
|
-
readonly meanTriangles: number;
|
|
949
|
-
readonly samples: number;
|
|
950
|
-
/** `triangles / gpuTriangles` of the same sample, which is what the go/no-go multiplies. */
|
|
951
|
-
readonly share: number;
|
|
952
|
-
readonly gpuTriangles: number;
|
|
953
|
-
readonly ageFrames: number;
|
|
954
|
-
};
|
|
1748
|
+
readonly occlusion?: IOcclusionReport;
|
|
955
1749
|
}
|
|
956
1750
|
|
|
957
1751
|
/** The point a streamed world follows; an `Object3D` satisfies this shape. */
|
|
@@ -1016,6 +1810,8 @@ interface IWorldCellsLoadOptions {
|
|
|
1016
1810
|
readonly createCollider?: IWorldTilesOptions["createCollider"];
|
|
1017
1811
|
/** Read once per update; an `Object3D` works. */
|
|
1018
1812
|
readonly follow: IWorldCellsFollow;
|
|
1813
|
+
/** Called when a nonempty cell batch becomes visible to the renderer. */
|
|
1814
|
+
readonly onPublication?: (bounds: Box3) => void;
|
|
1019
1815
|
/** Chebyshev radius in cells to keep resident; a cell leaves only beyond `ring + 1`. */
|
|
1020
1816
|
readonly ring: number;
|
|
1021
1817
|
readonly budgets: IWorldCellsBudget;
|
|
@@ -1025,15 +1821,42 @@ interface IWorldCellsLoadOptions {
|
|
|
1025
1821
|
* cells only, with strict measured triangle/draw savings and projected-error hysteresis.
|
|
1026
1822
|
* Source collision and shadow representations stay resident; unsupported sources retain detail. */
|
|
1027
1823
|
readonly hlod?: boolean;
|
|
1824
|
+
/**
|
|
1825
|
+
* Whether an asset whose authored `maxDistance` ends inside the near ring keeps a whole-map far
|
|
1826
|
+
* aggregate. `"ring"` (the default) skips it: the ring always draws those cells itself, and a
|
|
1827
|
+
* far record it does not own is further away than the asset's own cull, so the aggregate could
|
|
1828
|
+
* never draw a pixel while still costing an instance buffer, an atlas and a draw. `"always"` is
|
|
1829
|
+
* the named override, reported once per kept asset as `TN_WORLD_IMPOSTOR_FAR ...
|
|
1830
|
+
* override=impostorFar`.
|
|
1831
|
+
*/
|
|
1832
|
+
readonly impostorFar?: "ring" | "always";
|
|
1028
1833
|
/** Optional immutable per-record 3D draw reach in metres, indexed like placements.
|
|
1029
1834
|
* Nonnegative finite values or Infinity (no extra limit); combined with asset maxDistance.
|
|
1030
1835
|
* Filtered by the existing admission/refilter budget, never by a separate culler.
|
|
1031
1836
|
*/
|
|
1032
1837
|
readonly placementReach?: Float32Array;
|
|
1033
|
-
/** Inward return margin for authored CPU LODs, in [0, 1). Requires gpuScene:false
|
|
1838
|
+
/** Inward return margin for authored CPU LODs, in [0, 1). Requires gpuScene:false; when
|
|
1839
|
+
* combined with automatic impostors, also requires preserveAuthoredParts and authored distances.
|
|
1034
1840
|
* Omitted, selection uses the existing direct gates. State survives cell eviction/revisit. */
|
|
1035
1841
|
readonly lodHysteresis?: number;
|
|
1036
|
-
/**
|
|
1842
|
+
/** How a `lodHysteresis` level change reaches the screen. `"band"` (default) cross-fades over a
|
|
1843
|
+
* distance band `lodHysteresis` wide with a per-pixel dither; a placement standing in the band
|
|
1844
|
+
* stays dithered, which crawls without temporal AA. `"temporal"` is UE 5.8.3's instanced foliage
|
|
1845
|
+
* (`foliage.DitheredLOD` 1, `lod.TemporalLag` 0.5 s): the gate is hard in space and the change
|
|
1846
|
+
* fades over half a second, so no placement stays mid-fade while the viewer stands still.
|
|
1847
|
+
* `"none"` pops whole at the gate. */
|
|
1848
|
+
readonly lodTransition?: "band" | "none" | "temporal";
|
|
1849
|
+
/** Where the CPU path measures a placement's level and `maxDistance` cull from. `"camera"` (the
|
|
1850
|
+
* default) is the render camera's world position, the eye the GPU dispatch already uses: UE 5.8.3
|
|
1851
|
+
* picks instance LODs per view from the view origin
|
|
1852
|
+
* (`Engine/Source/Runtime/Engine/Private/HierarchicalInstancedStaticMesh.cpp:1652`) and streams
|
|
1853
|
+
* around the view target (`Engine/Source/Runtime/Engine/Private/PlayerController.cpp:3705`), so a
|
|
1854
|
+
* camera far from the player no longer draws the player's full-detail trees. Residency and
|
|
1855
|
+
* `placementReach` stay on `follow`. Until a camera reaches `update`, the eye is `follow`.
|
|
1856
|
+
* `"follow"` is the named override, as are `TN_LOD_FROM_CAMERA=0` and `?tnLodFromCamera=0`;
|
|
1857
|
+
* `stats().lodFrom` and `TN_WORLD_MAIN_CULL lodFrom=` report which one ran. */
|
|
1858
|
+
readonly lodFrom?: "camera" | "follow";
|
|
1859
|
+
/** Preserve supplied part/material identity and exact authored LOD membership, including shadow batches. Automatic impostors require each asset to author `impostorDistance`.
|
|
1037
1860
|
* Default content sharing and missing-alpha-part coverage remain enabled when omitted. */
|
|
1038
1861
|
readonly preserveAuthoredParts?: boolean;
|
|
1039
1862
|
/** Already decoded immutable world-v1 data; URL still supplies the base for model paths. */
|
|
@@ -1062,6 +1885,15 @@ interface IWorldCellsLoadOptions {
|
|
|
1062
1885
|
readonly shadows?: {
|
|
1063
1886
|
readonly cast?: boolean;
|
|
1064
1887
|
readonly castLevels?: number;
|
|
1888
|
+
/**
|
|
1889
|
+
* The finest level a shadow draws, default 0. A placement drawn at a finer level casts in this
|
|
1890
|
+
* level's shape when every finer level has as many parts at the same local transforms, so the
|
|
1891
|
+
* shadow keeps one shape while the view swaps levels: a cached shadow page redraws at most once a
|
|
1892
|
+
* second and showed every swap since in one batch. UE 5.8.3 draws shadows a level coarser by
|
|
1893
|
+
* default (`r.Shadow.NaniteLODBias` 1, Renderer/Private/Shadows/ShadowSceneRenderer.cpp:48-52).
|
|
1894
|
+
* It applies to the caster clusters; a world whose shadow levels draw its GPU keys casts as before.
|
|
1895
|
+
*/
|
|
1896
|
+
readonly minLevel?: number;
|
|
1065
1897
|
readonly receive?: boolean;
|
|
1066
1898
|
/**
|
|
1067
1899
|
* @deprecated Accepted and ignored. Clusters replace it: what a shadow level submits is bounded
|
|
@@ -1306,12 +2138,12 @@ interface IWorldCellsLoadOptions {
|
|
|
1306
2138
|
* Bake a whole-asset octahedral impostor for every alpha-cutout foliage asset and append it as the
|
|
1307
2139
|
* asset's terminal, two-triangle LOD. Default false: omission keeps the authored/generated source
|
|
1308
2140
|
* levels, and `?tnImpostors=1` or `TN_IMPOSTORS=1` opts a launch in. It is opt-in until the judged
|
|
1309
|
-
* Machinefall capture passes (PRD-473 AC-3)
|
|
1310
|
-
*
|
|
2141
|
+
* Machinefall capture passes (PRD-473 AC-3). With `preserveAuthoredParts`, an asset must author
|
|
2142
|
+
* `impostorDistance` to receive a terminal impostor.
|
|
1311
2143
|
*
|
|
1312
2144
|
* Set true to bake them, or leave it off to keep the source levels for a visual comparison.
|
|
1313
2145
|
*
|
|
1314
|
-
* The bake runs inside the render cadence — one
|
|
2146
|
+
* The bake runs inside the render cadence — one atlas view per `process` — so it costs a
|
|
1315
2147
|
* slice of a frame rather than a hitch, and it starts only after the asset's own model has been
|
|
1316
2148
|
* adopted. A seamless switch needs the impostor's atlas to cover the same cutout the source draws,
|
|
1317
2149
|
* so an asset whose levels carry no alpha-cutout part is never baked. `false` drops only the atlas
|
|
@@ -1333,8 +2165,43 @@ interface IWorldCellsGpuTally {
|
|
|
1333
2165
|
readonly triangles: number;
|
|
1334
2166
|
readonly ageFrames: number;
|
|
1335
2167
|
}
|
|
2168
|
+
/** Local render coverage, independent of shader prewarm and distant admission. */
|
|
2169
|
+
interface IWorldRegionReadiness {
|
|
2170
|
+
readonly requiredCells: number;
|
|
2171
|
+
readonly loadedCells: number;
|
|
2172
|
+
readonly requiredTerrainTiles: number;
|
|
2173
|
+
readonly loadedTerrainTiles: number;
|
|
2174
|
+
readonly failures: number;
|
|
2175
|
+
readonly cancelled: boolean;
|
|
2176
|
+
readonly ready: boolean;
|
|
2177
|
+
}
|
|
2178
|
+
/**
|
|
2179
|
+
* A plain `{ min, max }` region, the shape a shadow level's invalidation reads and the shape a game
|
|
2180
|
+
* can be handed without importing three. Plain numbers, so the object a caller records its bounds
|
|
2181
|
+
* in is the object that crosses the boundary.
|
|
2182
|
+
*/
|
|
2183
|
+
interface IShadowRegion {
|
|
2184
|
+
/** Only added casters; their redraw can retain the existing depth. */
|
|
2185
|
+
admission?: boolean;
|
|
2186
|
+
min: {
|
|
2187
|
+
x: number;
|
|
2188
|
+
y: number;
|
|
2189
|
+
z: number;
|
|
2190
|
+
};
|
|
2191
|
+
max: {
|
|
2192
|
+
x: number;
|
|
2193
|
+
y: number;
|
|
2194
|
+
z: number;
|
|
2195
|
+
};
|
|
2196
|
+
}
|
|
1336
2197
|
interface IWorldCellsStats {
|
|
1337
2198
|
readonly residentCells: number;
|
|
2199
|
+
/**
|
|
2200
|
+
* Placement bytes the resident cells hold. Admission adds them. Eviction removes them.
|
|
2201
|
+
* Far-impostor and HLOD bytes sit outside this figure, in `impostor.far.bytes` and `hlod.bytes`.
|
|
2202
|
+
* `budgets.bytes` caps the sum of all three.
|
|
2203
|
+
*/
|
|
2204
|
+
readonly residentBytes: number;
|
|
1338
2205
|
/** Resident cells whose initial placement runs and chunks have completed admission. */
|
|
1339
2206
|
readonly loadedCells: number;
|
|
1340
2207
|
readonly residentKeys: readonly string[];
|
|
@@ -1347,6 +2214,10 @@ interface IWorldCellsStats {
|
|
|
1347
2214
|
readonly loadsInFlight: number;
|
|
1348
2215
|
/** Model loads waiting for a free lane; served nearest-cell first, in admission order. */
|
|
1349
2216
|
readonly loadsQueued: number;
|
|
2217
|
+
/** Remaining placement slices and batch publications waiting for admission. */
|
|
2218
|
+
readonly admissionBacklog: number;
|
|
2219
|
+
/** Cumulative placement slices, mesh builds, and final run swaps completed by admission. */
|
|
2220
|
+
readonly admissionCompletedUnits: number;
|
|
1350
2221
|
/**
|
|
1351
2222
|
* Shared batches still to be minted, plus the ones minted and not yet drawn; `0` once
|
|
1352
2223
|
* `prewarmed` has resolved.
|
|
@@ -1364,13 +2235,9 @@ interface IWorldCellsStats {
|
|
|
1364
2235
|
* was worth anything. See `LEVEL_REFILTER_STEP_METRES`.
|
|
1365
2236
|
*/
|
|
1366
2237
|
readonly refilters: number;
|
|
1367
|
-
/**
|
|
1368
|
-
* Cumulative replacement builds that entered CPU placement-level selection. Initial admission is
|
|
1369
|
-
* excluded; GPU `maxDistance`/LOD movement is not a replacement because its complete resident
|
|
1370
|
-
* source set stays available to dispatch selection. Explicit `placementReach` replacements are
|
|
1371
|
-
* included because reach remains a CPU admission boundary.
|
|
1372
|
-
*/
|
|
1373
2238
|
readonly levelRefilters: number;
|
|
2239
|
+
/** Where the CPU path's levels were measured from; see `IWorldCellsLoadOptions.lodFrom`. */
|
|
2240
|
+
readonly lodFrom: "camera" | "follow";
|
|
1374
2241
|
/**
|
|
1375
2242
|
* Cumulative stale cell-assets the refilter passes found, across every update. The pass walks every
|
|
1376
2243
|
* resident cell and gates it as a whole before it looks at one batch, so a follow point that has
|
|
@@ -1403,13 +2270,10 @@ interface IWorldCellsStats {
|
|
|
1403
2270
|
/**
|
|
1404
2271
|
* What the GPU-driven main pass is doing, and why it is not: `on` is the answer, `reason` is the
|
|
1405
2272
|
* one line `TN_WORLD_GPU_SCENE` printed, and `dispatches` is what the walk actually paid for its
|
|
1406
|
-
* per-instance work. `mainCull.repacks`
|
|
1407
|
-
*
|
|
1408
|
-
*
|
|
1409
|
-
*
|
|
1410
|
-
* `placementReach` replacements remain visible. `dressed` over `meshes` is the marker line's own
|
|
1411
|
-
* pair, and it is the one that says the scene has meshes to draw with: an `on` with `0` dressed is
|
|
1412
|
-
* a ring the CPU path is still drawing.
|
|
2273
|
+
* per-instance work. `mainCull.repacks` and `refilters` stay at `0` while it is on — that is the
|
|
2274
|
+
* CPU work it replaced, counted by the same counters that report it when it is off. `dressed` over
|
|
2275
|
+
* `meshes` is the marker line's own pair, and it is the one that says the scene has meshes to draw
|
|
2276
|
+
* with: an `on` with `0` dressed is a ring the CPU path is still drawing.
|
|
1413
2277
|
*/
|
|
1414
2278
|
readonly gpuScene: {
|
|
1415
2279
|
readonly on: boolean;
|
|
@@ -1443,9 +2307,11 @@ interface IWorldCellsStats {
|
|
|
1443
2307
|
* invalidations since load: membership, material or geometry changes and CPU window repacks
|
|
1444
2308
|
* invalidate; GPU indirect count updates do not.
|
|
1445
2309
|
*
|
|
1446
|
-
* `eligibility` counts CPU material checks, snapshot validations, fresh structural walks
|
|
1447
|
-
* oversized or unsupported child output. Snapshots check own links and
|
|
1448
|
-
*
|
|
2310
|
+
* `eligibility` counts CPU material checks, snapshot validations, fresh structural walks,
|
|
2311
|
+
* oversized or unsupported child output, and `deferred` deep proofs. Snapshots check own links and
|
|
2312
|
+
* Three's child readers, detecting deep edits without requiring `needsUpdate`, once per
|
|
2313
|
+
* `staleFrames` period: 1 for a small world, the tested rows over a per-frame budget for a forest.
|
|
2314
|
+
* Child discovery still allocates.
|
|
1449
2315
|
*
|
|
1450
2316
|
* `reason` is who asked: `default` is a run that set nothing, `option` is a load that named
|
|
1451
2317
|
* `bundles`, and `launch` is `?tnBundles` / `TN_BUNDLES` / `__tnBundles`. It is on the marker line
|
|
@@ -1462,6 +2328,8 @@ interface IWorldCellsStats {
|
|
|
1462
2328
|
readonly refreshes: number;
|
|
1463
2329
|
readonly validations: number;
|
|
1464
2330
|
readonly uncached: number;
|
|
2331
|
+
readonly deferred: number;
|
|
2332
|
+
readonly staleFrames: number;
|
|
1465
2333
|
};
|
|
1466
2334
|
readonly reason: string;
|
|
1467
2335
|
readonly records: number;
|
|
@@ -1476,6 +2344,7 @@ interface IWorldCellsStats {
|
|
|
1476
2344
|
readonly impostor: {
|
|
1477
2345
|
readonly assets: number;
|
|
1478
2346
|
readonly pending: number;
|
|
2347
|
+
readonly drawn: number;
|
|
1479
2348
|
readonly atlasBytes: number;
|
|
1480
2349
|
readonly budgetBytes: number;
|
|
1481
2350
|
readonly terminalTriangles: number;
|
|
@@ -1507,7 +2376,6 @@ interface IWorldCellsStats {
|
|
|
1507
2376
|
readonly pending: number;
|
|
1508
2377
|
readonly bytes: number;
|
|
1509
2378
|
readonly refused: number;
|
|
1510
|
-
/** Why the latest proxy was refused, or empty when none was; a count alone names no cause. */
|
|
1511
2379
|
readonly reason: string;
|
|
1512
2380
|
readonly failures: number;
|
|
1513
2381
|
};
|
|
@@ -1531,35 +2399,20 @@ interface IWorldCellsStats {
|
|
|
1531
2399
|
readonly backlog: number;
|
|
1532
2400
|
};
|
|
1533
2401
|
}
|
|
1534
|
-
|
|
1535
|
-
interface IWorldRegionReadiness {
|
|
1536
|
-
readonly requiredCells: number;
|
|
1537
|
-
readonly loadedCells: number;
|
|
1538
|
-
readonly requiredTerrainTiles: number;
|
|
1539
|
-
readonly loadedTerrainTiles: number;
|
|
1540
|
-
readonly failures: number;
|
|
1541
|
-
readonly cancelled: boolean;
|
|
1542
|
-
readonly ready: boolean;
|
|
1543
|
-
}
|
|
2402
|
+
|
|
1544
2403
|
/**
|
|
1545
|
-
* A
|
|
1546
|
-
*
|
|
1547
|
-
*
|
|
2404
|
+
* A random in [0, 1) that stays with its instance, as UE 5.8.3's PerInstanceRandom: hashed from the
|
|
2405
|
+
* instance's world origin, never from its draw slot. WorldCells repacks instances on every refilter,
|
|
2406
|
+
* main-pass cull and LOD switch, so `instanceIndex` names another tree from one frame to the next; a
|
|
2407
|
+
* wind phase hashed from it re-rolled each crown about every 0.7 s of a walk and snapped its top by a
|
|
2408
|
+
* median 0.37 m. Parts of one placement share its translation, so its bark and needles read one value.
|
|
2409
|
+
*
|
|
2410
|
+
* @situation a per-instance random number that stays with each streamed placement as WorldCells repacks
|
|
2411
|
+
* @situation replace instanceIndex in a WorldCells part material, which WorldCells refuses
|
|
2412
|
+
* @example const phase = instanceRandom().mul(6.2831);
|
|
1548
2413
|
*/
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
admission?: boolean;
|
|
1552
|
-
min: {
|
|
1553
|
-
x: number;
|
|
1554
|
-
y: number;
|
|
1555
|
-
z: number;
|
|
1556
|
-
};
|
|
1557
|
-
max: {
|
|
1558
|
-
x: number;
|
|
1559
|
-
y: number;
|
|
1560
|
-
z: number;
|
|
1561
|
-
};
|
|
1562
|
-
}
|
|
2414
|
+
declare function instanceRandom(): Node<"float">;
|
|
2415
|
+
|
|
1563
2416
|
/**
|
|
1564
2417
|
* Stream a Blender-authored world package by cell and keep it resident around a followed point.
|
|
1565
2418
|
*
|
|
@@ -1583,13 +2436,15 @@ interface IShadowRegion {
|
|
|
1583
2436
|
* @constraint surface is the game's; this class creates no material, colour or geometry
|
|
1584
2437
|
* @constraint a cell's model loads at `soon` priority, so a file the running scene awaits through `ctx.assets` starts first
|
|
1585
2438
|
* @constraint budgets are hard caps that report pressure instead of over-committing
|
|
2439
|
+
* @constraint `whenSpawnReady(position, radius, timeoutMs)` snapshots a fixed region and settles from existing updates or disposal; it does not drive streaming, and `prewarmed` remains the separate draw gate
|
|
1586
2440
|
* @constraint model loads are bounded by `concurrency` (default 12) across every resident cell, not per cell
|
|
1587
2441
|
* @constraint refilters are bounded by `rebuildsPerUpdate` (default 16) per update, nearest cell first
|
|
2442
|
+
* @constraint residency and `placementReach` follow `follow`; levels and `maxDistance` are graded from the render camera, as UE picks instance LODs per view; `lodFrom: "follow"`, `?tnLodFromCamera=0` or `TN_LOD_FROM_CAMERA=0` grade from `follow`, reported as `TN_WORLD_MAIN_CULL lodFrom=`
|
|
1588
2443
|
* @constraint admission is bounded by `admissionBudgetMs` (default 2) per update across every path, plus at most one unit each for terrain and props; while props are queued terrain takes at most half, so neither starves the other, and a deferred cell keeps drawing what it has
|
|
1589
2444
|
* @constraint SkinnedMesh parts are skipped; an instanced copy would draw one rest pose
|
|
1590
2445
|
* @constraint a baked chain's switch distances are measured against `autoLod` (default 4 px of error over 60° and 1080 raster rows), because an instanced draw cannot select a level per instance; an asset with nonempty authored `lods` never consults it; explicit empty lists enroll only unchanged static geometry/material parts
|
|
1591
2446
|
* @constraint eligible static sources can use cooked HLOD (chunk-only alongside GPU scatter, whole-cell on CPU) after compilation and an observed main-context backend submission; projected-error hysteresis requires actual source triangle reduction and no extra material draws, unsupported or shared source stays resident, and collision/shadow paths retain source representations; stats().hlod counts lifecycle and charged resources, not GPU timing or physical allocation
|
|
1592
|
-
* @override `hlod: false` keeps source rendering; ring, budgets, terrain tile size/resolution, terrain stream and collider radius, `transparentScatter`, `clusterSize` and `shadows.invalidate`, load `concurrency`, `rebuildsPerUpdate`, `admissionBudgetMs` and the package's per-asset maxDistance
|
|
2447
|
+
* @override `hlod: false` keeps source rendering; ring, budgets, terrain tile size/resolution, terrain stream and collider radius, `transparentScatter`, `clusterSize` and `shadows.invalidate`, load `concurrency`, `rebuildsPerUpdate`, `admissionBudgetMs` and the package's per-asset maxDistance; `impostorFar: "always"` keeps the far aggregate the near ring's guaranteed radius made unnecessary
|
|
1593
2448
|
* @constraint `prewarmed` resolves once every prewarmed shared batch has been drawn; a game with a loading screen waits on it, and `stats().pendingPrewarm` is the same gate as a number
|
|
1594
2449
|
* @constraint every `asset:level:part` is one InstancedMesh for the main pass, plus one caster InstancedMesh per world-grid square of `clusterSize` on the shadow caster layer, so the main pass draws one mesh per key and a shadow level submits only the squares it covers
|
|
1595
2450
|
* @constraint two definitions the asset loader resolves to one model — the same cooked `glb`, the same `lods` at the same distances, the same `maxDistance` and bounds — are one asset under the lexicographically smallest id: one model load, one set of `asset:level:part` keys, one prewarm and one refcount, released when the last cell holding any member of the group leaves the ring; `TN_WORLD_ASSET_ALIAS` reports how many of the package's assets are really distinct
|
|
@@ -1629,8 +2484,10 @@ declare class WorldCells extends Group implements IComputeDriven {
|
|
|
1629
2484
|
* The loading gate a game with a loading screen waits on, so the shader builds the prewarm exists
|
|
1630
2485
|
* to move happen behind it instead of in the first seconds of play. It counts updates the world
|
|
1631
2486
|
* was in a scene for, because a batch added while the world is not in a scene is projected by
|
|
1632
|
-
* nothing and builds nothing.
|
|
1633
|
-
*
|
|
2487
|
+
* nothing and builds nothing. A world with nothing to prewarm — no resident cell and no model
|
|
2488
|
+
* load, so no update of its own can queue one — settles on those updates like a drained world,
|
|
2489
|
+
* which is what lets a game await it for every world it streams. `dispose` settles it too: a
|
|
2490
|
+
* world torn down mid-load must not leave a game awaiting it forever.
|
|
1634
2491
|
*/
|
|
1635
2492
|
get prewarmed(): Promise<void>;
|
|
1636
2493
|
/**
|
|
@@ -1682,160 +2539,23 @@ declare class WorldCells extends Group implements IComputeDriven {
|
|
|
1682
2539
|
stats(): IWorldCellsStats;
|
|
1683
2540
|
detach(): void;
|
|
1684
2541
|
/** Completed content intersecting a square around a fixed spawn, in world metres. */
|
|
1685
|
-
readinessAt(position: {
|
|
2542
|
+
readinessAt(position: Camera | {
|
|
1686
2543
|
readonly x: number;
|
|
1687
2544
|
readonly z: number;
|
|
1688
2545
|
}, radius?: number): IWorldRegionReadiness;
|
|
2546
|
+
/** Terrain data needed by the current camera, including visible tiles not yet admitted. */
|
|
2547
|
+
terrainReadinessInView(camera: Camera): {
|
|
2548
|
+
required: number;
|
|
2549
|
+
loaded: number;
|
|
2550
|
+
};
|
|
2551
|
+
/** Visible CPU scatter batches still awaiting a nonempty main-camera backend submission. */
|
|
2552
|
+
pendingCpuDrawsInView(camera: Camera): number;
|
|
2553
|
+
/** Resolves when the content a fixed spawn needs has finished loading; see `CellReadiness`. */
|
|
2554
|
+
whenSpawnReady(position: {
|
|
2555
|
+
readonly x: number;
|
|
2556
|
+
readonly z: number;
|
|
2557
|
+
}, radius?: number, timeoutMs?: number): Promise<IWorldRegionReadiness>;
|
|
1689
2558
|
dispose(): void;
|
|
1690
2559
|
}
|
|
1691
2560
|
|
|
1692
|
-
|
|
1693
|
-
readonly x: number;
|
|
1694
|
-
readonly z: number;
|
|
1695
|
-
}
|
|
1696
|
-
interface IHeightfieldOptions {
|
|
1697
|
-
readonly columns: number;
|
|
1698
|
-
readonly depth: number;
|
|
1699
|
-
readonly heights: Float32Array;
|
|
1700
|
-
readonly origin: IHeightfieldOrigin;
|
|
1701
|
-
readonly rows: number;
|
|
1702
|
-
readonly width: number;
|
|
1703
|
-
readonly worldPasses?: IHeightfieldWorldPassOptions;
|
|
1704
|
-
}
|
|
1705
|
-
/** A rectangular window of a heightfield's canonical samples, in grid indices. */
|
|
1706
|
-
/** Hands out the union of every window `updateHeights` wrote since the last `take`. */
|
|
1707
|
-
interface IHeightfieldChangeTracker {
|
|
1708
|
-
/** The changed window since the previous take, or undefined when nothing changed. */
|
|
1709
|
-
take(): IHeightfieldRegionBounds | undefined;
|
|
1710
|
-
/** Stop tracking. Idempotent. */
|
|
1711
|
-
dispose(): void;
|
|
1712
|
-
}
|
|
1713
|
-
interface IHeightfieldRegionBounds {
|
|
1714
|
-
/** First column (x index), inclusive. */
|
|
1715
|
-
readonly column: number;
|
|
1716
|
-
/** Number of columns covered. */
|
|
1717
|
-
readonly columns: number;
|
|
1718
|
-
/** First row (z index), inclusive. */
|
|
1719
|
-
readonly row: number;
|
|
1720
|
-
/** Number of rows covered. */
|
|
1721
|
-
readonly rows: number;
|
|
1722
|
-
}
|
|
1723
|
-
/** A rectangular window plus the replacement samples written over it. */
|
|
1724
|
-
interface IHeightfieldRegion extends IHeightfieldRegionBounds {
|
|
1725
|
-
/** Row-major samples, `columns * rows` long and read with the region's own stride. */
|
|
1726
|
-
readonly heights: Float32Array;
|
|
1727
|
-
}
|
|
1728
|
-
interface IHeightfieldWorldPassOptions {
|
|
1729
|
-
/** Maximum TSL compute dispatches submitted by one rendered frame. */
|
|
1730
|
-
readonly dispatchBudget: number;
|
|
1731
|
-
/** Reserved GPU path; true is rejected until GPU readback owns the canonical field. */
|
|
1732
|
-
readonly gpu?: boolean;
|
|
1733
|
-
/** Every physical coefficient is game supplied; core owns no terrain preset. */
|
|
1734
|
-
readonly erosion: IWorldErosionOptions;
|
|
1735
|
-
}
|
|
1736
|
-
interface IHeightfieldSamplerOptions extends Omit<IHeightfieldOptions, "heights"> {
|
|
1737
|
-
/** Game-owned terrain function. It is evaluated once and never retained. */
|
|
1738
|
-
readonly sampleHeight: (x: number, z: number) => number;
|
|
1739
|
-
}
|
|
1740
|
-
interface IStoredHeightfieldChannels {
|
|
1741
|
-
readonly flow?: Float32Array;
|
|
1742
|
-
readonly moisture?: Float32Array;
|
|
1743
|
-
}
|
|
1744
|
-
/**
|
|
1745
|
-
* One height buffer shared by world queries, rendered geometry, and a physics heightfield.
|
|
1746
|
-
*
|
|
1747
|
-
* The game supplies every value, so changing the terrain's shape never requires a package edit.
|
|
1748
|
-
* `fromSampler` evaluates that game function exactly once at each vertex and retains only the
|
|
1749
|
-
* resulting numbers. Queries interpolate those same numbers instead of evaluating the function
|
|
1750
|
-
* again.
|
|
1751
|
-
*
|
|
1752
|
-
* @situation build terrain geometry and collision from one game-authored height function
|
|
1753
|
-
* @situation generate a terrain a player can walk across
|
|
1754
|
-
* @situation query the same ground height or normal that a player sees and collides with
|
|
1755
|
-
* @situation ask how high the ground is here
|
|
1756
|
-
* @situation build islands and coastlines from terrain
|
|
1757
|
-
* @situation keep a collider or other copy of a deforming terrain in step without rescanning the whole field (`trackChanges`)
|
|
1758
|
-
* @constraint sampleHeight owns the terrain shape and stays in game source; the framework stores and interpolates its output
|
|
1759
|
-
* @constraint rows and columns are vertex counts; geometry is row-major z-then-x and collider export transposes once into Rapier's column-major matrix order
|
|
1760
|
-
* @override rows, columns, width, depth, origin, and sampleHeight are explicit on every field
|
|
1761
|
-
* @example const field = Heightfield.fromSampler({ rows: 65, columns: 65, width: 64, depth: 64, origin: { x: 0, z: 0 }, sampleHeight: terrainHeight });
|
|
1762
|
-
*/
|
|
1763
|
-
declare class Heightfield extends Group implements IComputeDriven {
|
|
1764
|
-
#private;
|
|
1765
|
-
readonly columns: number;
|
|
1766
|
-
readonly depth: number;
|
|
1767
|
-
readonly origin: IHeightfieldOrigin;
|
|
1768
|
-
readonly rows: number;
|
|
1769
|
-
readonly width: number;
|
|
1770
|
-
readonly processCadence: "render";
|
|
1771
|
-
readonly warmupNodes: readonly unknown[];
|
|
1772
|
-
constructor(options: IHeightfieldOptions & IStoredHeightfieldChannels);
|
|
1773
|
-
static fromSampler(options: IHeightfieldSamplerOptions): Heightfield;
|
|
1774
|
-
sample(channel: string, x: number, z: number): number;
|
|
1775
|
-
get released(): boolean;
|
|
1776
|
-
get generationComplete(): boolean;
|
|
1777
|
-
get gpuHeightSample(): IGPUReadbackSample | undefined;
|
|
1778
|
-
attachRenderer(renderer: IRendererLike): void;
|
|
1779
|
-
process(renderer?: IRendererLike | undefined): void;
|
|
1780
|
-
debug(): Record<string, unknown>;
|
|
1781
|
-
detach(): void;
|
|
1782
|
-
/** A copy of the canonical row-major samples, safe for game-side analysis. */
|
|
1783
|
-
get heights(): Float32Array;
|
|
1784
|
-
/** A copy of the normalized routed-flow channel, when world passes were requested. */
|
|
1785
|
-
get flow(): Float32Array | undefined;
|
|
1786
|
-
/** Bytes retained by this field's CPU channels and its conservative GPU allowance. */
|
|
1787
|
-
get memoryBytes(): number;
|
|
1788
|
-
heightAt(x: number, z: number): number;
|
|
1789
|
-
normalAt(x: number, z: number, target?: Vector3): Vector3;
|
|
1790
|
-
/**
|
|
1791
|
-
* Monotonic sample version, incremented by every `updateHeights` call.
|
|
1792
|
-
*
|
|
1793
|
-
* A renderer or collider that caches derived data compares this against its own last-seen value
|
|
1794
|
-
* instead of diffing the whole grid each frame.
|
|
1795
|
-
*/
|
|
1796
|
-
get version(): number;
|
|
1797
|
-
/**
|
|
1798
|
-
* Overwrite one rectangular window of the canonical samples.
|
|
1799
|
-
*
|
|
1800
|
-
* Height is the one buffer queries, rendered geometry and collider export share, so a second
|
|
1801
|
-
* terrain representation is never needed: a simulation writes its surface here and every
|
|
1802
|
-
* consumer already reads it. The whole window is validated before any sample changes, so a
|
|
1803
|
-
* malformed call leaves the field untouched rather than half-written.
|
|
1804
|
-
* @situation deform terrain, snow or water in place and have queries and collision follow
|
|
1805
|
-
* @constraint the region must lie inside the field; an out-of-bounds window throws and writes nothing
|
|
1806
|
-
* @constraint heights is `columns * rows` long, row-major, and every sample must be finite
|
|
1807
|
-
*/
|
|
1808
|
-
updateHeights(region: IHeightfieldRegion): void;
|
|
1809
|
-
/**
|
|
1810
|
-
* Follow which samples change, independently of every other follower.
|
|
1811
|
-
*
|
|
1812
|
-
* A consumer that mirrors the surface — a collider, a GPU copy, a cache — needs the window that
|
|
1813
|
-
* changed since *it* last looked; comparing the whole field instead costs every sample on every
|
|
1814
|
-
* change. Each tracker keeps its own union of the windows `updateHeights` wrote, so two
|
|
1815
|
-
* consumers never take each other's changes.
|
|
1816
|
-
*
|
|
1817
|
-
* ```ts
|
|
1818
|
-
* const changes = field.trackChanges();
|
|
1819
|
-
* const changed = changes.take(); // undefined when nothing was written
|
|
1820
|
-
* ```
|
|
1821
|
-
*/
|
|
1822
|
-
trackChanges(): IHeightfieldChangeTracker;
|
|
1823
|
-
/** The collider sample at `row`, `column`: what `toColliderHeights()` holds there, without a copy. */
|
|
1824
|
-
colliderHeight(row: number, column: number): number;
|
|
1825
|
-
/**
|
|
1826
|
-
* Rewrite an existing `toGeometry()` result from the current canonical samples.
|
|
1827
|
-
*
|
|
1828
|
-
* Positions carry over unchanged because only the surface moves; y and normals are refreshed
|
|
1829
|
-
* from the same sampler queries use, which is what keeps a rendered vertex and a height query
|
|
1830
|
-
* from disagreeing. Pass a region to touch only the window a simulation just changed.
|
|
1831
|
-
* @situation redraw a terrain, snow or water mesh after its samples changed
|
|
1832
|
-
* @constraint geometry must come from `toGeometry()` with the same rows and columns
|
|
1833
|
-
*/
|
|
1834
|
-
refreshGeometry(geometry: BufferGeometry, bounds?: IHeightfieldRegionBounds): void;
|
|
1835
|
-
/** The same values transposed once into Rapier's column-major height-matrix order. */
|
|
1836
|
-
toColliderHeights(): Float32Array;
|
|
1837
|
-
/** Builds an ordinary Three.js geometry without choosing its surface. */
|
|
1838
|
-
toGeometry(): BufferGeometry;
|
|
1839
|
-
}
|
|
1840
|
-
|
|
1841
|
-
export { Heightfield, type IAdmissionBudget, type IHeightfieldChangeTracker, type IHeightfieldOptions, type IHeightfieldOrigin, type IHeightfieldRegion, type IHeightfieldRegionBounds, type IHeightfieldSamplerOptions, type IHeightfieldWorldPassOptions, type ILoadTerrainSplatOptions, type IShadowRegion, type ISnowContact, type ISnowFieldOptions, type ISnowFieldSample, type ISnowFootprint, type ISnowFootprintSample, type ITerrainSplatLayer, type ITerrainSplatMaskedLayer, type ITerrainSplatTable, type ITerrainSplatWeightContext, type IWorldAsset, type IWorldAssetBounds, type IWorldAssetLod, type IWorldCapabilities, type IWorldCell, type IWorldCellProxy, type IWorldCellsBudget, type IWorldCellsFollow, type IWorldCellsLoadOptions, type IWorldCellsStats, type IWorldCellsTerrainOptions, type IWorldExtent, type IWorldGpuFrameValidation, type IWorldPackage, type IWorldPackageError, type IWorldPackageValidationOptions, type IWorldRegionReadiness, type IWorldRun, type IWorldTerrain, type IWorldTileColliderInput, type IWorldTilesTopologyObservation, SnowField, TERRAIN_VALIDATE_FLAG, TERRAIN_VALIDATE_MARKER, TerrainTiles, WorldCells, type WorldPackageErrorCode, cellPlacements, getWorldCapabilities, heightSamplerFromHeightmap, loadTerrainSplat, loadWorldHeightmap, snowDiscFootprint, terrainValidationRequested, validateWorldPackage };
|
|
2561
|
+
export { AdmissionBudget, Heightfield, HeightfieldCollar, type IAdmissionBudget, type IBaseRing, type IHeightfieldChangeTracker, type IHeightfieldCollarOptions, type IHeightfieldCollarQuad, type IHeightfieldCollarSite, type IHeightfieldCollarWalk, type IHeightfieldOptions, type IHeightfieldOrigin, type IHeightfieldRegion, type IHeightfieldRegionBounds, type IHeightfieldSamplerOptions, type IHeightfieldWorldPassOptions, type ILakeSurfaceOptions, type ILoadTerrainSplatOptions, type IMeshSection, type IRiverRibbonOptions, type IShadowRegion, type IShoreField, type IShoreFieldOptions, type ISnowContact, type ISnowFieldOptions, type ISnowFieldSample, type ISnowFootprint, type ISnowFootprintSample, type ITerrainSplatLayer, type ITerrainSplatMaskedLayer, type ITerrainSplatMaterialContext, type ITerrainSplatSample, type ITerrainSplatSampleContext, type ITerrainSplatTable, type ITerrainSplatWeightContext, type IWarmUnculledOptions, type IWaterBodiesOptions, type IWaterCurrent, type IWaterFootprint, type IWaterLake, type IWaterOcean, type IWaterRibbon, type IWorldAsset, type IWorldAssetBounds, type IWorldAssetLod, type IWorldCapabilities, type IWorldCell, type IWorldCellProxy, type IWorldCellsBudget, type IWorldCellsFollow, type IWorldCellsLoadOptions, type IWorldCellsStats, type IWorldCellsTerrainOptions, type IWorldExtent, type IWorldGpuFrameValidation, type IWorldPackage, type IWorldPackageError, type IWorldPackageValidationOptions, type IWorldRegionReadiness, type IWorldRun, type IWorldTerrain, type IWorldTileColliderInput, type IWorldTilesTopologyObservation, NOISE_PERIOD, NOISE_TEXELS, SnowField, type StaticGroundQuery, type SurfaceSampler, TERRAIN_VALIDATE_FLAG, TERRAIN_VALIDATE_MARKER, TerrainTiles, WATER_RIBBON_REACH, WaterBodies, type WaterBodyKind, WorldCells, type WorldPackageErrorCode, applyTerrainSurface, bakedFractalNoise, bakedNoise, baseRingGap, cellPlacements, footprintGap, getWorldCapabilities, heightSamplerFromHeightmap, instanceRandom, lakeReach, lakeSurfaceGeometry, loadTerrainSplat, loadWorldHeightmap, meshSections, noiseVolume, repairZeroNormals, riverRibbonGeometry, sectionGeometry, shoreField, snowDiscFootprint, staticLowestY, surfaceSampler, terrainValidationRequested, validateWorldPackage, warmUnculled, waterlineRadius };
|