@threenative/core 0.3.4 → 0.3.5
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/capabilities.json +1505 -79
- package/dist/{audio-7i3Xl0l3.d.ts → audio-DIJE5HTr.d.ts} +43 -3
- package/dist/{canvas-layer-DDmC_VVF.d.ts → canvas-layer-C1-5CviZ.d.ts} +5 -1
- package/dist/{game-CljaDv4D.d.ts → game-Bj8G1wmD.d.ts} +102 -11
- package/dist/hot.d.ts +4 -4
- package/dist/index.d.ts +712 -118
- package/dist/index.js +12423 -4955
- package/dist/{gpu-readback-CqJEfWNQ.d.ts → model-lod-BDAUYgsS.d.ts} +80 -5
- package/dist/playtest.d.ts +6 -10
- package/dist/playtest.js +47 -24
- package/dist/react-css.d.ts +62 -0
- package/dist/react-css.js +591 -0
- package/dist/react.d.ts +2 -2
- package/dist/{renderer-CfsS2hxi.d.ts → renderer-9yEo9hPa.d.ts} +489 -22
- package/dist/terrain-jobs-worker.d.ts +2 -0
- package/dist/terrain-jobs-worker.js +130 -0
- package/dist/ui-layer.js +59 -8
- package/dist/world.d.ts +766 -73
- package/dist/world.js +9307 -3543
- package/gpl/recipes/export_world.py +18 -1
- package/mcp/blender-server.mjs +7 -4
- package/mcp/blender.mjs +3 -4
- package/mcp/engine-server.mjs +2 -2
- package/mcp/servers.mjs +4 -4
- package/package.json +15 -9
- package/patches/three@0.185.1-prd269-upgrade.patch +22418 -0
- package/patches/three@0.185.1.patch +6594 -700
- package/scripts/apply-three-patch.mjs +62 -4
- package/src/animation-blend.ts +264 -0
- package/src/animation-composition.ts +362 -0
- package/src/animation-layers.ts +260 -0
- package/src/animation-root-motion.ts +283 -0
- package/src/animation.ts +896 -0
- package/src/assets.ts +1303 -0
- package/src/atmosphere/index.ts +335 -0
- package/src/atmosphere/luts.ts +298 -0
- package/src/atmosphere/params.ts +323 -0
- package/src/audio.ts +912 -0
- package/src/billboard.ts +124 -0
- package/src/bone-lengths.ts +157 -0
- package/src/camera-shake.ts +116 -0
- package/src/canvas-layer.ts +47 -0
- package/src/clip-audit.ts +401 -0
- package/src/clustered-batch.ts +492 -0
- package/src/clustered-mesh.ts +638 -0
- package/src/compute-driven.ts +176 -0
- package/src/compute-timing.ts +318 -0
- package/src/config.ts +593 -0
- package/src/debug.ts +82 -0
- package/src/engine-render-hook.ts +25 -0
- package/src/entities.ts +79 -0
- package/src/entity-snapshot.ts +53 -0
- package/src/flight.ts +683 -0
- package/src/fluid-field.ts +748 -0
- package/src/fluid-particles.ts +1253 -0
- package/src/frame-budget.ts +1368 -0
- package/src/game.ts +2390 -0
- package/src/geometry-capture.ts +1098 -0
- package/src/gpu-class.ts +160 -0
- package/src/gpu-frame-observation.ts +424 -0
- package/src/gpu-readback.ts +143 -0
- package/src/gpu-scene-bvh.ts +464 -0
- package/src/grounding.ts +100 -0
- package/src/hot.ts +161 -0
- package/src/import-meta.d.ts +13 -0
- package/src/index.ts +1536 -0
- package/src/input.ts +690 -0
- package/src/instanced-batch-lod.ts +283 -0
- package/src/instanced-batch.ts +274 -0
- package/src/interpolation.ts +129 -0
- package/src/launch-diagnostics.ts +161 -0
- package/src/loop.ts +564 -0
- package/src/matrix-world.ts +245 -0
- package/src/merge-parts.ts +812 -0
- package/src/model-lod.ts +1315 -0
- package/src/net-protocol.ts +333 -0
- package/src/net-session.ts +477 -0
- package/src/net.ts +80 -0
- package/src/ocean/fft.ts +72 -0
- package/src/ocean/spectral.ts +728 -0
- package/src/particle-significance.ts +102 -0
- package/src/particles.ts +648 -0
- package/src/path-follow.ts +175 -0
- package/src/picking.ts +250 -0
- package/src/pipeline-census.ts +1566 -0
- package/src/platform.ts +210 -0
- package/src/playtest.ts +839 -0
- package/src/pointer-events.ts +411 -0
- package/src/pose-measure.ts +435 -0
- package/src/profiling/FrameCounters.ts +231 -0
- package/src/profiling/Spans.ts +548 -0
- package/src/profiling/opacity-convention.ts +21 -0
- package/src/profiling/render-list-validate.ts +175 -0
- package/src/profiling/render-trap-audit.ts +84 -0
- package/src/profiling/scene-warning.ts +190 -0
- package/src/profiling/span-probes.ts +191 -0
- package/src/profiling/unlit-foliage-warning.ts +149 -0
- package/src/projection-apply.ts +1529 -0
- package/src/projection-marker.ts +142 -0
- package/src/projection-plan.ts +1258 -0
- package/src/projection-skinned.ts +419 -0
- package/src/projection-stability.ts +409 -0
- package/src/projection-uniform.ts +328 -0
- package/src/random.ts +41 -0
- package/src/react-css.ts +604 -0
- package/src/react-glyphs.ts +114 -0
- package/src/react-host.ts +576 -0
- package/src/react-layout.ts +265 -0
- package/src/react.ts +60 -0
- package/src/render/alpha-antialiasing.ts +159 -0
- package/src/render/batched-velocity.ts +126 -0
- package/src/render/chain.ts +1021 -0
- package/src/render/daylight.ts +189 -0
- package/src/render/depth-pyramid.ts +596 -0
- package/src/render/foliage-alpha.ts +166 -0
- package/src/render/material-key.ts +60 -0
- package/src/render/mesh-pool.ts +144 -0
- package/src/render/probe-volume.ts +1668 -0
- package/src/render/resolution-subrect.ts +253 -0
- package/src/render/velocity.ts +442 -0
- package/src/render/virtual-shadow-pages.ts +827 -0
- package/src/render/virtual-shadow-partial.ts +174 -0
- package/src/render/virtual-shadow.ts +3330 -0
- package/src/render/world-impostor-surface.ts +722 -0
- package/src/render/world-impostor.ts +558 -0
- package/src/render-camera-cull.ts +441 -0
- package/src/render-pass-budget.ts +501 -0
- package/src/renderProjection.ts +758 -0
- package/src/renderer-config.ts +127 -0
- package/src/renderer.ts +1847 -0
- package/src/replay-protocol.ts +85 -0
- package/src/replay.ts +205 -0
- package/src/resolution-scaler.ts +819 -0
- package/src/rig-preparation.ts +271 -0
- package/src/ripple-field.ts +432 -0
- package/src/scale.ts +109 -0
- package/src/scene.ts +239 -0
- package/src/schedule.ts +155 -0
- package/src/skeletal-mesh.ts +61 -0
- package/src/skeleton.ts +100 -0
- package/src/snow-field.ts +744 -0
- package/src/softbody-topology.ts +269 -0
- package/src/softbody.ts +516 -0
- package/src/sprite-animator.ts +222 -0
- package/src/startup-readiness.ts +386 -0
- package/src/state.ts +66 -0
- package/src/static-transform.ts +274 -0
- package/src/storage-buffer.ts +253 -0
- package/src/streaming.ts +308 -0
- package/src/target-fps.ts +92 -0
- package/src/terrain-jobs-worker.ts +17 -0
- package/src/terrain-jobs.ts +353 -0
- package/src/textures.ts +39 -0
- package/src/tracers.ts +237 -0
- package/src/ui-bridge.ts +368 -0
- package/src/ui-hit-regions.ts +380 -0
- package/src/ui-layer.ts +83 -0
- package/src/ui-state.ts +220 -0
- package/src/version.ts +2 -0
- package/src/viewport.ts +253 -0
- package/src/warmup.ts +1357 -0
- package/src/water-surface.ts +384 -0
- package/src/wave-field.ts +524 -0
- package/src/world-capabilities.ts +131 -0
- package/src/world-cell-proxy.ts +392 -0
- package/src/world-cells.ts +10564 -0
- package/src/world-gpu-scene.ts +3354 -0
- package/src/world-heightmap.ts +82 -0
- package/src/world-package.ts +469 -0
- package/src/world-passes.ts +582 -0
- package/src/world-region.ts +17 -0
- package/src/world-terrain-splat.ts +564 -0
- package/src/world-tiles.ts +3826 -0
- package/src/world-topology.ts +370 -0
- package/src/world-validate.ts +48 -0
- package/src/world.ts +805 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as three from 'three';
|
|
2
|
-
import { Object3D, AnimationClip, AnimationMixer,
|
|
2
|
+
import { Object3D, AnimationClip, AnimationMixer, Vector3, Camera, Group, Matrix4, Mesh, BufferGeometry, InstancedMesh, Material, ColorRepresentation, Box3, Scene, DirectionalLight, HemisphereLight, Color, ToneMapping, FogExp2, Sprite, DataTexture, CatmullRomCurve3, Texture } from 'three';
|
|
3
3
|
export { I as IAssetLoader, a as IAssetLoaderOptions, b as ITextureOptions, c as createAssetLoader, r as reconcileMirroredClips } from './assets-CqvE429w.js';
|
|
4
|
-
export { A as AudioBus, I as IAudioBusOptions, b as IAudioPlayOptions, r as resetAudioCueLedger } from './audio-
|
|
5
|
-
export { C as CanvasLayer } from './canvas-layer-
|
|
6
|
-
import {
|
|
7
|
-
export { A as AfterPhysicsCallback, C as ContextMenuPolicy, G as GEOMETRY_ASSET_KEY, c as GEOMETRY_CAPTURE_DEFAULT_LIMIT, d as GEOMETRY_CAPTURE_MAX_LIMIT, e as GEOMETRY_CAPTURE_SORTS, f as GEOMETRY_CAPTURE_TIMEOUT_MS, g as GEOMETRY_CAPTURE_WALK_CAP, h as GeometryCaptureSort, i as ICtx, I as IGame, j as IGameObservationContribution, k as IGameObservationSampleRequest, l as IGamePlatformSource, m as IGeometryCaptureAsset, n as IGeometryCaptureMesh, o as IGeometryCapturePass, p as IGeometryCaptureReport, q as IGeometryCaptureRequest, r as IGeometryCaptureRow, s as IInputAction, t as IInputGamepad, u as IPointerDragHandle, v as IPointerEvent3D, w as IPointerEvents3D, x as IPointerEvents3DOptions, y as IPointerEvents3DPicker, z as IPointerState, B as IRandom, D as IRawInputPointer, E as IRawInputPointerEdge, F as IRawInputState, H as IRaycastOptions, J as IScenePickerOptions, K as IThreeNativeAudioConfig, L as IThreeNativeAudioLoop, M as IThreeNativeAudioOverride, N as IThreeNativeAudioSpectrum, O as IThreeNativeBootSplash, P as IThreeNativeConfig, Q as IThreeNativeIconVariants, R as IThreeNativeLodConfig, S as IThreeNativeLodGenerationConfig, T as IThreeNativeLodOverride, U as IThreeNativeLodRuntimeConfig, V as IThreeNativeTexturesConfig, W as ITweenOptions, X as IWarmUpCacheOptions, Y as IWarmUpObservation, Z as IWarmUpOptions, _ as IWarmUpProgress, $ as IWarmUpRenderer, a0 as IWarmUpReport, a1 as InputBindings, a2 as InputMap, a3 as InputPlatformSource, a4 as PointerEvent3DListener, a5 as PointerEvent3DType, a6 as PointerEvents3D, a7 as Scene, a8 as SceneFrame, a9 as ScenePicker, aa as ScheduleHandle, ab as Scheduler, ac as ThreeNativeBackgroundMode, ad as ThreeNativeLodMinTrianglesScope, ae as ThreeNativeLodPreset, af as ThreeNativeOrientation, ag as ThreeNativeUiRenderer, ah as WarmUpCacheStatus, ai as WarmUpObservationStatus, aj as afterPhysics, ak as captureMouse, al as createRandom, am as defineGame, an as warmUpScene } from './game-
|
|
4
|
+
export { A as AudioBus, I as IAudioBusOptions, b as IAudioCompressorOptions, c as IAudioPlayOptions, r as resetAudioCueLedger } from './audio-DIJE5HTr.js';
|
|
5
|
+
export { C as CanvasLayer } from './canvas-layer-C1-5CviZ.js';
|
|
6
|
+
import { b as IGamePluginRuntime, a as IGamePluginHooks } from './game-Bj8G1wmD.js';
|
|
7
|
+
export { A as AfterPhysicsCallback, C as ContextMenuPolicy, G as GEOMETRY_ASSET_KEY, c as GEOMETRY_CAPTURE_DEFAULT_LIMIT, d as GEOMETRY_CAPTURE_MAX_LIMIT, e as GEOMETRY_CAPTURE_SORTS, f as GEOMETRY_CAPTURE_TIMEOUT_MS, g as GEOMETRY_CAPTURE_WALK_CAP, h as GeometryCaptureSort, i as ICtx, I as IGame, j as IGameObservationContribution, k as IGameObservationSampleRequest, l as IGamePlatformSource, m as IGeometryCaptureAsset, n as IGeometryCaptureMesh, o as IGeometryCapturePass, p as IGeometryCaptureReport, q as IGeometryCaptureRequest, r as IGeometryCaptureRow, s as IInputAction, t as IInputGamepad, u as IPointerDragHandle, v as IPointerEvent3D, w as IPointerEvents3D, x as IPointerEvents3DOptions, y as IPointerEvents3DPicker, z as IPointerState, B as IRandom, D as IRawInputPointer, E as IRawInputPointerEdge, F as IRawInputState, H as IRaycastOptions, J as IScenePickerOptions, K as IThreeNativeAudioConfig, L as IThreeNativeAudioLoop, M as IThreeNativeAudioOverride, N as IThreeNativeAudioSpectrum, O as IThreeNativeBootSplash, P as IThreeNativeConfig, Q as IThreeNativeIconVariants, R as IThreeNativeLodConfig, S as IThreeNativeLodGenerationConfig, T as IThreeNativeLodOverride, U as IThreeNativeLodRuntimeConfig, V as IThreeNativeTexturesConfig, W as ITweenOptions, X as IWarmUpCacheOptions, Y as IWarmUpObservation, Z as IWarmUpOptions, _ as IWarmUpProgress, $ as IWarmUpRenderer, a0 as IWarmUpReport, a1 as InputBindings, a2 as InputMap, a3 as InputPlatformSource, a4 as PointerEvent3DListener, a5 as PointerEvent3DType, a6 as PointerEvents3D, a7 as Scene, a8 as SceneFrame, a9 as ScenePicker, aa as ScheduleHandle, ab as Scheduler, ac as ThreeNativeBackgroundMode, ad as ThreeNativeLodMinTrianglesScope, ae as ThreeNativeLodPreset, af as ThreeNativeOrientation, ag as ThreeNativeUiRenderer, ah as WarmUpCacheStatus, ai as WarmUpObservationStatus, aj as afterPhysics, ak as captureMouse, al as createRandom, am as defineGame, an as warmUpScene } from './game-Bj8G1wmD.js';
|
|
8
8
|
import * as three_webgpu from 'three/webgpu';
|
|
9
|
-
import { StorageTexture, ComputeNode, UniformNode, Node, TextureNode, NodeMaterial, StorageBufferNode, StructTypeNode, Data3DTexture, ShadowBaseNode, NodeBuilder, NodeFrame, SpriteNodeMaterial, StorageTextureNode } from 'three/webgpu';
|
|
10
|
-
import { I as IRendererLike, F as FramePassKind, a as IFrameBudgetWindow } from './renderer-
|
|
11
|
-
export { D as DEFAULT_PIPELINE_CENSUS_LIMIT,
|
|
12
|
-
import { I as IComputeDriven$1,
|
|
13
|
-
export { C as ComputeDrivenRegistry, G as GPUReadback,
|
|
9
|
+
import { StorageTexture, ComputeNode, UniformNode, Node, TextureNode, NodeMaterial, StorageBufferNode, StructTypeNode, Data3DTexture, ShadowBaseNode, NodeBuilder, NodeFrame, SpriteNodeMaterial, StorageTextureNode, Storage3DTexture } from 'three/webgpu';
|
|
10
|
+
import { I as IRendererLike, F as FramePassKind, a as IFrameBudgetWindow } from './renderer-9yEo9hPa.js';
|
|
11
|
+
export { D as DEFAULT_PIPELINE_CENSUS_LIMIT, h as DEFAULT_TARGET_FPS, i as FRAME_BUDGET_MARKER, j as FRAME_BUDGET_PHASES, k as FRAME_HITCH_MARKER, l as FrameBudget, m as FrameBudgetPhase, n as FrameCounters, o as ICounterDevice, g as IFrameBudgetOptions, p as IFrameBudgetPassSummary, b as IFrameBudgetSimulation, q as IFrameBudgetSummary, r as IFrameCounters, d as IFramePhaseSample, e as IPipelineCensus, s as IPipelineCensusCounts, t as IPipelineCensusEvent, u as IPipelineCensusOptions, v as IPipelineProvenance, w as IPipelineShaderObservation, x as IPlatformInfo, y as IRenderChainApplied, z as IRenderChainBudgetWindow, A as IRenderChainDroppedStage, B as IRenderChainOptions, C as IRenderChainRenderer, E as IRenderChainRequest, G as IRenderChainStage, H as IRenderChainStageContext, J as IRenderChainVelocityMeasurement, K as IRenderChainVelocityReport, L as IRenderChainVelocityRequest, M as IRenderChainVelocityResult, c as IRenderPassSample, N as ITargetFps, O as IVelocityRenderPass, P as MAX_TARGET_FPS, Q as MainDrawSource, R as PIPELINE_CENSUS_CAPABILITY, S as PIPELINE_CENSUS_VERSION, T as PipelineCensus, U as PipelineCensusMode, V as PipelineCensusStatus, W as PlatformFormFactor, X as PlatformOS, Y as PlatformRuntime, Z as RENDER_CHAIN_MARKER, _ as RENDER_CHAIN_STAGE_ORDER, $ as RENDER_CHAIN_TIERS, a0 as RenderChain, a1 as RenderChainSource, a2 as RenderChainStageId, a3 as RenderChainStageName, a4 as RenderChainTier, a5 as RenderChainTierRequest, a6 as RenderChainVelocitySource, a7 as TargetFpsSource, a8 as VELOCITY_OUTPUT_NAME, a9 as VELOCITY_PREVIOUS_BONE_MATRICES, aa as VELOCITY_PREVIOUS_INSTANCE_MATRICES, ab as VELOCITY_PREVIOUS_WORLD_MATRIX, ac as VelocityTracker, ad as counterDeviceOf, ae as createPipelineCensus, af as ensureVelocityOutput, ag as getPlatform, ah as isMobile, ai as isNative, aj as isTouchscreenAvailable, ak as isWeb, al as prewarm, am as readRenderChainObservation, an as readRenderChainReport, ao as readVelocityPreviousBoneMatrices, ap as readVelocityPreviousMatrices, aq as readVelocityPreviousWorldMatrix, ar as resolveTargetFps, as as snapRefreshRate, at as velocityTexture, au as withVelocityContext } from './renderer-9yEo9hPa.js';
|
|
12
|
+
import { I as IComputeDriven$1, c as IGPUReadbackSample, d as IBudgetCandidate } from './model-lod-BDAUYgsS.js';
|
|
13
|
+
export { C as ComputeDrivenRegistry, D as DISCRETE_LOD_DEFAULT_ERROR_PIXELS, e as DISCRETE_LOD_DEFAULT_HYSTERESIS, G as GPUReadback, f as IGPUReadbackOptions, g as baseGeometryOf, l as lodPixelScale, u as updateModelLods } from './model-lod-BDAUYgsS.js';
|
|
14
14
|
import { SkyMesh } from 'three/addons/objects/SkyMesh.js';
|
|
15
|
-
import { Node as Node$1 } from 'three/src/nodes/Nodes.js';
|
|
15
|
+
import { Node as Node$1, UniformNode as UniformNode$1 } from 'three/src/nodes/Nodes.js';
|
|
16
16
|
import 'zustand/vanilla';
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -84,6 +84,10 @@ declare const SPANS: {
|
|
|
84
84
|
readonly sort: 12;
|
|
85
85
|
/** Per-draw submission inside a render call, accumulated across the draws of one pass. */
|
|
86
86
|
readonly draw: 13;
|
|
87
|
+
/** Terrain block rebuild and merged-attribute swap on the calling thread. */
|
|
88
|
+
readonly terrainBlock: 14;
|
|
89
|
+
/** Terrain seam reconciliation and bridge-attribute swap on the calling thread. */
|
|
90
|
+
readonly terrainSeam: 15;
|
|
87
91
|
};
|
|
88
92
|
type SpanId = (typeof SPANS)[keyof typeof SPANS];
|
|
89
93
|
/** Names, indexed by id. The only place a span name is a string. */
|
|
@@ -166,14 +170,14 @@ declare class SpanRecorder {
|
|
|
166
170
|
/** The window just closed, or `undefined` when no frame was recorded in it. */
|
|
167
171
|
window(): ISpanWindow | undefined;
|
|
168
172
|
}
|
|
169
|
-
/** Installs or removes the recorder every `beginSpan`/`endSpan` routes to. */
|
|
173
|
+
/** Installs or removes the recorder every `beginSpan`/`endSpan` routes to, in every entry copy. */
|
|
170
174
|
declare function setSpanRecorder(next: SpanRecorder | undefined): void;
|
|
171
175
|
declare function spanRecorder(): SpanRecorder | undefined;
|
|
172
176
|
/** The one clock the spans and the frame budget share, so their numbers are comparable. */
|
|
173
177
|
declare function spanNow(): number;
|
|
174
178
|
/**
|
|
175
179
|
* Opens a span. One guarded return when spans are off — no clock read, no allocation, no branch on
|
|
176
|
-
* anything but the recorder's own presence.
|
|
180
|
+
* anything but the recorder's own presence. The opt-in native wall-time sink sees it first.
|
|
177
181
|
*/
|
|
178
182
|
declare function beginSpan(id: SpanId): void;
|
|
179
183
|
declare function endSpan(id: SpanId): void;
|
|
@@ -291,11 +295,197 @@ declare class AnimationPlayer {
|
|
|
291
295
|
/** The clip behind a name, for a game that wants the action or the raw `AnimationClip`. */
|
|
292
296
|
clip(name: string): AnimationClip;
|
|
293
297
|
play(name: string, options?: IAnimationPlayOptions): void;
|
|
298
|
+
/**
|
|
299
|
+
* Whether a clip has posed the skeleton. False until the first `play` or `playWeighted`, so a
|
|
300
|
+
* rig that never plays a clip stays observably in its bind pose.
|
|
301
|
+
*/
|
|
302
|
+
get posed(): boolean;
|
|
303
|
+
/**
|
|
304
|
+
* Play several clips at once, at weights the game computed — the plumbing half of a locomotion
|
|
305
|
+
* blend space. The samples, the thresholds and the interpolation domain stay the game's: this
|
|
306
|
+
* takes the answer (`{ clip, weight }[]`) and owns what happens to the actions.
|
|
307
|
+
*
|
|
308
|
+
* What it guarantees, because every blend space needs the same four things:
|
|
309
|
+
*
|
|
310
|
+
* - **One mixer, one updater, one action per clip.** Nothing here creates an `AnimationMixer`.
|
|
311
|
+
* - **A still-contributing clip keeps its phase.** Returning to a walk mid-cycle does not
|
|
312
|
+
* restart it — the same convention `play` follows.
|
|
313
|
+
* - **An entering clip joins the gait.** Its normalized time is set to the dominant
|
|
314
|
+
* contributor's, so a walk→run change does not cross the feet mid-stride. Pass
|
|
315
|
+
* `phaseSync: false` for authored cycles that are deliberately out of phase with each other.
|
|
316
|
+
* - **Weights stay finite, non-negative and summing to 1.** Malformed input throws rather than
|
|
317
|
+
* producing a pose nobody can explain.
|
|
318
|
+
*
|
|
319
|
+
* `transition` is the bounded authored transition: weights move linearly towards the request
|
|
320
|
+
* over that many seconds, so a large instantaneous intent change cannot pop the pose, and `0`
|
|
321
|
+
* snaps them on the call. A clip that drops out of the request fades to zero and is then
|
|
322
|
+
* stopped, so repeated blends release their actions.
|
|
323
|
+
*
|
|
324
|
+
* Entries are played as loops. Events — a hit, a death, a reload — are `play`'s job.
|
|
325
|
+
*/
|
|
326
|
+
playWeighted(entries: readonly {
|
|
327
|
+
readonly clip: string;
|
|
328
|
+
readonly weight: number;
|
|
329
|
+
}[], options?: {
|
|
330
|
+
readonly transition?: number;
|
|
331
|
+
readonly phaseSync?: boolean;
|
|
332
|
+
}): void;
|
|
294
333
|
update(dt: number): void;
|
|
295
334
|
stop(): void;
|
|
296
335
|
dispose(): void;
|
|
297
336
|
}
|
|
298
337
|
|
|
338
|
+
interface IAnimationMask {
|
|
339
|
+
readonly bones: readonly string[];
|
|
340
|
+
readonly descendants?: boolean;
|
|
341
|
+
/** Explicit root ownership; refused when root motion owns that same track. */
|
|
342
|
+
readonly includeRoot?: boolean;
|
|
343
|
+
}
|
|
344
|
+
interface IAnimationLayer {
|
|
345
|
+
readonly name: string;
|
|
346
|
+
readonly clip: string;
|
|
347
|
+
readonly mask: IAnimationMask;
|
|
348
|
+
readonly mode: "override" | "additive";
|
|
349
|
+
readonly once?: boolean;
|
|
350
|
+
readonly reference?: {
|
|
351
|
+
readonly clip: AnimationClip;
|
|
352
|
+
readonly time: number;
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/*!
|
|
357
|
+
* Selectively adapted from GGEZ packages/anim-core/src/root-motion.ts
|
|
358
|
+
* (translation difference, quaternion yaw) at
|
|
359
|
+
* 45ed541cb163ef98694467758f60d5533373ac60. Adds explicit root binding,
|
|
360
|
+
* continuous loop intervals, yaw unwrapping and validated Three transforms.
|
|
361
|
+
* MIT License
|
|
362
|
+
* Copyright (c) 2026 @alightinastorm (x.com/alightinastorm)
|
|
363
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
364
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
365
|
+
* in the Software without restriction, including without limitation the rights
|
|
366
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
367
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
368
|
+
* furnished to do so, subject to the following conditions:
|
|
369
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
370
|
+
* copies or substantial portions of the Software.
|
|
371
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
372
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
373
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
374
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
375
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
376
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
377
|
+
* SOFTWARE.
|
|
378
|
+
*/
|
|
379
|
+
|
|
380
|
+
interface IAnimationRootMotionOptions {
|
|
381
|
+
readonly bone: string;
|
|
382
|
+
/** Existing character-body object. Its parent must be identity in this first slice. */
|
|
383
|
+
readonly body: Object3D;
|
|
384
|
+
}
|
|
385
|
+
interface IAnimationMotionDelta {
|
|
386
|
+
readonly translation: Pick<Vector3, "x" | "y" | "z">;
|
|
387
|
+
readonly yaw: number;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
interface IAnimationComposerOptions {
|
|
391
|
+
readonly root: Object3D;
|
|
392
|
+
/**
|
|
393
|
+
* Copied into owned pose snapshots at construction. Constant stock quaternion tracks use
|
|
394
|
+
* equivalent discrete sampling there; reauthor source keys before constructing a new composer.
|
|
395
|
+
*/
|
|
396
|
+
readonly clips: readonly AnimationClip[];
|
|
397
|
+
readonly samples: readonly string[];
|
|
398
|
+
readonly layers?: readonly IAnimationLayer[];
|
|
399
|
+
readonly rootMotion?: IAnimationRootMotionOptions;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* One bounded Three player/mixer. Game-owned intent supplies normalized sample weights;
|
|
403
|
+
* every base action samples one normalized phase, while layered events retain authored time.
|
|
404
|
+
*/
|
|
405
|
+
declare class AnimationComposer {
|
|
406
|
+
#private;
|
|
407
|
+
paused: boolean;
|
|
408
|
+
constructor(options: IAnimationComposerOptions);
|
|
409
|
+
get mixer(): three.AnimationMixer<three.AnimationMixerEventMap>;
|
|
410
|
+
get root(): Object3D<three.Object3DEventMap>;
|
|
411
|
+
get phase(): number;
|
|
412
|
+
get speed(): number;
|
|
413
|
+
set speed(value: number);
|
|
414
|
+
get weights(): readonly number[];
|
|
415
|
+
get sampleTimes(): readonly number[];
|
|
416
|
+
get resources(): {
|
|
417
|
+
actions: number;
|
|
418
|
+
bindings: number;
|
|
419
|
+
scratchBytes: number;
|
|
420
|
+
clipBuffers: number;
|
|
421
|
+
clipBufferBytes: number;
|
|
422
|
+
rootBuffers: number;
|
|
423
|
+
rootBufferBytes: number;
|
|
424
|
+
};
|
|
425
|
+
/** Snapshots remain honest while blocked: phase advances at authored speed, never re-timed by the wall. */
|
|
426
|
+
get motion(): {
|
|
427
|
+
readonly authority: "phase" | "rootMotion";
|
|
428
|
+
readonly requested: Vector3;
|
|
429
|
+
readonly requestedYaw: number;
|
|
430
|
+
readonly accepted: Vector3;
|
|
431
|
+
readonly acceptedYaw: number;
|
|
432
|
+
readonly blocked: boolean;
|
|
433
|
+
};
|
|
434
|
+
get blocked(): boolean;
|
|
435
|
+
setWeights(weights: ArrayLike<number>, transition?: number): void;
|
|
436
|
+
setLayerWeight(name: string, weight: number): void;
|
|
437
|
+
/** Explicit replay; repeated weight requests do not re-fire a completed one-shot. */
|
|
438
|
+
restartLayer(name: string): void;
|
|
439
|
+
update(dt: number): void;
|
|
440
|
+
/** Borrowed proposal: queue it once with CharacterBody3D.move, then finish after physics. */
|
|
441
|
+
advance(dt: number): {
|
|
442
|
+
readonly translation: Vector3;
|
|
443
|
+
readonly yaw: number;
|
|
444
|
+
};
|
|
445
|
+
/** Final authored pose precedes the game's existing IK. This method never writes the body. */
|
|
446
|
+
finish(accepted?: IAnimationMotionDelta): void;
|
|
447
|
+
dispose(): void;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/*!
|
|
451
|
+
* Selectively adapted from GGEZ packages/anim-runtime/src/runtime/helpers.ts
|
|
452
|
+
* (findBlend1DChildren, computeTriangleBarycentricWeights, findBlend2DEdgeWeights)
|
|
453
|
+
* at 45ed541cb163ef98694467758f60d5533373ac60. Replaced graph children with
|
|
454
|
+
* validated fixed sample indices, initialization-only sorting and reusable output.
|
|
455
|
+
* MIT License
|
|
456
|
+
* Copyright (c) 2026 @alightinastorm (x.com/alightinastorm)
|
|
457
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
458
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
459
|
+
* in the Software without restriction, including without limitation the rights
|
|
460
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
461
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
462
|
+
* furnished to do so, subject to the following conditions:
|
|
463
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
464
|
+
* copies or substantial portions of the Software.
|
|
465
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
466
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
467
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
468
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
469
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
470
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
471
|
+
* SOFTWARE.
|
|
472
|
+
*/
|
|
473
|
+
type Point = readonly [number, number];
|
|
474
|
+
type Triangle = readonly [number, number, number];
|
|
475
|
+
declare class BlendSpace1D {
|
|
476
|
+
#private;
|
|
477
|
+
readonly weights: Float64Array;
|
|
478
|
+
constructor(thresholds: readonly number[]);
|
|
479
|
+
sample(value: number): Float64Array;
|
|
480
|
+
}
|
|
481
|
+
/** Fixed complete convex-hull triangulation. Collinear triangles and overlapping tiles fail at load. */
|
|
482
|
+
declare class BlendSpace2D {
|
|
483
|
+
#private;
|
|
484
|
+
readonly weights: Float64Array;
|
|
485
|
+
constructor(points: readonly Point[], triangles: readonly Triangle[]);
|
|
486
|
+
sample(x: number, y: number): Float64Array;
|
|
487
|
+
}
|
|
488
|
+
|
|
299
489
|
type NormaliseAxis = "height" | "longest";
|
|
300
490
|
interface INormaliseToMetresOptions {
|
|
301
491
|
readonly metres: number;
|
|
@@ -406,8 +596,12 @@ declare class CameraShake {
|
|
|
406
596
|
* that needs it. The page owns the presentation (and the copy-to-clipboard button players are
|
|
407
597
|
* asked for when they report a launch that hung); this owns the noticing and the wording.
|
|
408
598
|
*/
|
|
409
|
-
/**
|
|
410
|
-
|
|
599
|
+
/**
|
|
600
|
+
* What failed. `stalled` is "no progress for a while"; `device-lost` is the GPU going away;
|
|
601
|
+
* `scene-load-failed` is a scene's `load()` rejecting and `start-failed` is `start()` rejecting,
|
|
602
|
+
* each of which otherwise reads as a stall.
|
|
603
|
+
*/
|
|
604
|
+
type LaunchFailureKind = "stalled" | "device-lost" | "scene-load-failed" | "start-failed";
|
|
411
605
|
interface ILaunchFailure {
|
|
412
606
|
readonly kind: LaunchFailureKind;
|
|
413
607
|
/** One human sentence, already naming the numbers — this is what the Copy button copies. */
|
|
@@ -572,7 +766,7 @@ type AtmosphereDirection = Vector3 | readonly [number, number, number] | Node<"v
|
|
|
572
766
|
* those, and the same object remains useful when a game supplies a completely different look.
|
|
573
767
|
* @situation render a sunrise that changes as time and place change
|
|
574
768
|
* @situation add distance haze from the depth of a scene pass
|
|
575
|
-
* @alias bright
|
|
769
|
+
* @alias green platforms bright saturated sky
|
|
576
770
|
* @constraint supply rayleigh, mie, ozone, planetRadius, and atmosphereRadius; there is no Earth fallback
|
|
577
771
|
* @constraint the game creates the sky object, surface, and sun from the returned nodes
|
|
578
772
|
* @example const atmosphere = new Atmosphere({ rayleigh, mie, ozone, planetRadius, atmosphereRadius });
|
|
@@ -722,7 +916,7 @@ declare class GPUSceneBVH extends Group implements IComputeDriven$1 {
|
|
|
722
916
|
get released(): boolean;
|
|
723
917
|
get triangleCount(): number;
|
|
724
918
|
get vertexCount(): number;
|
|
725
|
-
attachRenderer(
|
|
919
|
+
attachRenderer(_renderer: IRendererLike): void;
|
|
726
920
|
process(_renderer: IRendererLike): void;
|
|
727
921
|
/** Repack the selected scene objects and replace the GPU buffers behind the stable node handles. */
|
|
728
922
|
rebuild(): void;
|
|
@@ -730,6 +924,19 @@ declare class GPUSceneBVH extends Group implements IComputeDriven$1 {
|
|
|
730
924
|
detach(): void;
|
|
731
925
|
}
|
|
732
926
|
|
|
927
|
+
interface IInstancedLodOptions {
|
|
928
|
+
/** Baked-chain selection is automatic. `false` leaves detail to the caller. */
|
|
929
|
+
readonly autoLod?: false | {
|
|
930
|
+
readonly maxPixelError?: number;
|
|
931
|
+
readonly hysteresis?: number;
|
|
932
|
+
};
|
|
933
|
+
/** Authored distance levels win over the baked chain. Missing geometries report once at build. */
|
|
934
|
+
readonly lods?: readonly {
|
|
935
|
+
readonly distance: number;
|
|
936
|
+
readonly geometry: BufferGeometry | undefined;
|
|
937
|
+
}[];
|
|
938
|
+
}
|
|
939
|
+
|
|
733
940
|
/** One instance's transform, in the units the geometry was authored in. */
|
|
734
941
|
interface IInstancedPlacement {
|
|
735
942
|
/** World position of the instance's origin, as `[x, y, z]`. */
|
|
@@ -739,7 +946,7 @@ interface IInstancedPlacement {
|
|
|
739
946
|
/** Per-axis scale as `[x, y, z]`, or one number for all three. Default 1. */
|
|
740
947
|
readonly scale?: readonly [number, number, number] | number;
|
|
741
948
|
}
|
|
742
|
-
interface IInstancedBatchOptions {
|
|
949
|
+
interface IInstancedBatchOptions extends IInstancedLodOptions {
|
|
743
950
|
/** The shape every instance draws, supplied by the game. */
|
|
744
951
|
readonly geometry: BufferGeometry;
|
|
745
952
|
/**
|
|
@@ -1013,13 +1220,32 @@ interface IClusteredMeshOptions {
|
|
|
1013
1220
|
}
|
|
1014
1221
|
declare class ClusteredMesh extends Mesh {
|
|
1015
1222
|
#private;
|
|
1016
|
-
/** The baked payload.
|
|
1017
|
-
|
|
1223
|
+
/** The baked payload. The bake is the only thing that writes it; a copy takes the source's. */
|
|
1224
|
+
table: IClusterTable;
|
|
1018
1225
|
/** Screen-space error budget in pixels. Writable — it is the game's call. */
|
|
1019
1226
|
errorPixels: number;
|
|
1020
1227
|
/** Camera movement, in the mesh's own units, below which the previous cut is kept. */
|
|
1021
1228
|
recutDistance: number;
|
|
1022
1229
|
constructor(geometry: BufferGeometry, surface: Material | Material[], table: IClusterTable, options?: IClusteredMeshOptions);
|
|
1230
|
+
/**
|
|
1231
|
+
* A second mesh over the same body, cut for its own place in the scene.
|
|
1232
|
+
*
|
|
1233
|
+
* three's `Object3D.clone` builds through `new this.constructor()`, and this class's constructor
|
|
1234
|
+
* wants a table — so every game that stood a second copy of a cooked model where it wanted a
|
|
1235
|
+
* statue died in `assertTable` before drawing anything. The arguments are the source's own,
|
|
1236
|
+
* which is what a copy is.
|
|
1237
|
+
*/
|
|
1238
|
+
clone(recursive?: boolean): this;
|
|
1239
|
+
/**
|
|
1240
|
+
* Becomes a copy of `source`, sharing the bake and the vertices and keeping a cut of its own.
|
|
1241
|
+
*
|
|
1242
|
+
* `Mesh.copy` shares the geometry outright, which this class cannot let it do: the cut lives in
|
|
1243
|
+
* the geometry's index buffer, so two meshes on one geometry would overwrite each other's index
|
|
1244
|
+
* every frame and both would draw whichever spoke last. The copy takes the vertex attributes by
|
|
1245
|
+
* reference instead — one copy of them on the GPU, because three keys its attributes on the
|
|
1246
|
+
* attribute — and the shared table, which is frozen at bake time and cannot go stale.
|
|
1247
|
+
*/
|
|
1248
|
+
copy(source: this, recursive?: boolean): this;
|
|
1023
1249
|
/** Clusters in the current cut. */
|
|
1024
1250
|
get drawnClusters(): number;
|
|
1025
1251
|
/** Triangles the current cut submits. */
|
|
@@ -1127,30 +1353,6 @@ declare class ClusteredBatch {
|
|
|
1127
1353
|
update(camera: Camera, viewportHeight: number): number;
|
|
1128
1354
|
}
|
|
1129
1355
|
|
|
1130
|
-
/**
|
|
1131
|
-
* Pixels a one-world-unit error at `depth` covers, for this camera and viewport.
|
|
1132
|
-
*
|
|
1133
|
-
* Perspective divides the projected scale by the depth; orthographic has no depth term and uses the
|
|
1134
|
-
* frustum height instead. A non-positive depth or an unprojectable camera throws rather than
|
|
1135
|
-
* returning a plausible-looking wrong scale.
|
|
1136
|
-
*/
|
|
1137
|
-
declare function lodPixelScale(camera: Camera, viewportHeight: number, depth: number): number;
|
|
1138
|
-
/** The LOD0 geometry of a mesh under a discrete chain, or the mesh's own geometry otherwise. */
|
|
1139
|
-
declare function baseGeometryOf(mesh: Mesh): BufferGeometry;
|
|
1140
|
-
/**
|
|
1141
|
-
* Takes every discrete-LOD mesh under `root` through this frame's selection.
|
|
1142
|
-
*
|
|
1143
|
-
* The engine calls this itself, once a frame, after matrices are synced and before the render.
|
|
1144
|
-
* Multi-view callers that need the finest level across passes use {@link selectLodLevel} directly;
|
|
1145
|
-
* this entry point selects for the one camera it is handed — which is the main view, and is at
|
|
1146
|
-
* least as fine as a shadow pass of lower resolution needs.
|
|
1147
|
-
*
|
|
1148
|
-
* @returns triangles the managed meshes will submit this frame.
|
|
1149
|
-
*/
|
|
1150
|
-
declare function updateModelLods(root: {
|
|
1151
|
-
traverse(callback: (object: object) => void): void;
|
|
1152
|
-
}, camera: Camera, viewportHeight: number): number;
|
|
1153
|
-
|
|
1154
1356
|
/**
|
|
1155
1357
|
* What the gate did on the last frame, in the shape a frame-budget window reports.
|
|
1156
1358
|
*
|
|
@@ -1216,22 +1418,39 @@ declare function alwaysRender(object: Object3D, enabled?: boolean): void;
|
|
|
1216
1418
|
*
|
|
1217
1419
|
* The pass mirrors three exactly for a visible node: `matrixAutoUpdate` -> `updateMatrix()`, then
|
|
1218
1420
|
* the `matrixWorldNeedsUpdate || force` recompute honouring `matrixWorldAutoUpdate` and a null
|
|
1219
|
-
* parent, then force the children. A node with `visible === false`
|
|
1220
|
-
*
|
|
1221
|
-
*
|
|
1222
|
-
* subtree is recomputed with `force = true`.
|
|
1421
|
+
* parent, then force the children. A node with `visible === false` defers its own compose and its
|
|
1422
|
+
* subtree's walk. Every skipped root is remembered, so the first frame it is visible again both
|
|
1423
|
+
* its own world matrix and its descendants are recomputed with `force = true`.
|
|
1223
1424
|
*
|
|
1224
1425
|
* Two things are never dropped by the pruning, because both are read while nothing above them is
|
|
1225
1426
|
* visible:
|
|
1226
1427
|
*
|
|
1227
|
-
* - a class that overrides `updateMatrixWorld` runs its own
|
|
1228
|
-
*
|
|
1229
|
-
*
|
|
1428
|
+
* - a class that overrides `updateMatrixWorld` runs its own — never a `Scene`, which three does not
|
|
1429
|
+
* override and whose method only differs when something patched the prototype. `SkinnedMesh`
|
|
1430
|
+
* refreshes `bindMatrixInverse`, `Camera` its `matrixWorldInverse`; re-implementing only the base
|
|
1431
|
+
* walk left every deck-crew sailor that had moved since load drawing with a stale bind matrix and
|
|
1230
1432
|
* vanishing from the frame. Their subtrees are small, so walking them whole costs nothing;
|
|
1231
1433
|
* - a hidden node that holds a `Bone` is walked, because a visible `SkinnedMesh` draws with its
|
|
1232
1434
|
* skeleton's matrices wherever the armature happens to sit. Whether bones sit below a node is
|
|
1233
1435
|
* decided once and remembered — a rig is built whole and does not grow.
|
|
1234
1436
|
*
|
|
1437
|
+
* A third thing is dropped, and it is the walk's largest single share on a streamed world: a subtree
|
|
1438
|
+
* frozen with `markStatic`. `markStatic` composes the subtree once and turns off the two flags that
|
|
1439
|
+
* would recompose it, which until now still left three's unconditional recursion visiting every node
|
|
1440
|
+
* under it every frame. A frozen root that carries no dirty flag is a leaf here, and it is one
|
|
1441
|
+
* whether the walk was forced or not: `refreshStaticTransforms` re-arms a root whose own transform
|
|
1442
|
+
* moved, `invalidateStatic` re-arms one something wrote inside, and both compose the subtree once at
|
|
1443
|
+
* that moment. `isStatic` is what separates the engine's freeze from a game that turned the flags off
|
|
1444
|
+
* for its own reasons. See `static-transform.ts`.
|
|
1445
|
+
*
|
|
1446
|
+
* Where the root is a native-engine object it has its own walk, `__tnUpdateMatrixWorld(force, prune)`: this
|
|
1447
|
+
* pass run natively in one call, answering the nodes it visited. The pass calls that and nothing else, since the
|
|
1448
|
+
* walk above costs a bridge call per node read and written (about 16 to 25 thousand a frame at 4,096 cubes).
|
|
1449
|
+
* With `prune` (the `"visible"` mode) the native walk leaves a hidden subtree where it stands by the same rules,
|
|
1450
|
+
* bones included; `"all"` visits every node. A JS subclass of `Object3D` that overrides `updateMatrixWorld` is not
|
|
1451
|
+
* called from inside it; the engine's own `SkinnedMesh` and `Camera` keep their derived matrices. The web and the
|
|
1452
|
+
* legacy host have no such method and walk as above.
|
|
1453
|
+
*
|
|
1235
1454
|
* A game that reads a **hidden** object's `matrixWorld` directly must not rely on this pass
|
|
1236
1455
|
* having reached it: use `getWorldPosition`/`getWorldQuaternion`/`getWorldScale` (which update the
|
|
1237
1456
|
* chain they need) or call `object.updateWorldMatrix(true, false)` first. The convention's named
|
|
@@ -1406,6 +1625,58 @@ declare function describeSceneWarning(warning: ISceneWarning): string;
|
|
|
1406
1625
|
/** The marker line. */
|
|
1407
1626
|
declare function formatSceneWarning(warning: ISceneWarning): string;
|
|
1408
1627
|
|
|
1628
|
+
/**
|
|
1629
|
+
* The engine telling the agent that built the scene what a human finds by playing it once.
|
|
1630
|
+
*
|
|
1631
|
+
* Imported foliage drawn with no image-based light looks like cardboard, and nothing in the build
|
|
1632
|
+
* says so. A GLB's leaf card is `MeshStandardMaterial` (or its Node twin), `alphaTest` above zero,
|
|
1633
|
+
* `side: DoubleSide`; with `scene.environment === null` and no `envMap` on the material, `envMapIntensity`
|
|
1634
|
+
* has nothing to apply — three r185's WebGPU path only uses it when the material carries its own
|
|
1635
|
+
* `envMap`, and `scene.environmentIntensity` only reaches a scene that has an environment. What is
|
|
1636
|
+
* left is a hemisphere fill, so a shaded needle card and its back face land on one flat dark value
|
|
1637
|
+
* and the author compensates with a tint or a fake emissive, which is the paperboard.
|
|
1638
|
+
*
|
|
1639
|
+
* So the rule is derived from the scene graph, never from a constant: cutout PBR, counted by
|
|
1640
|
+
* material, with no environment anywhere in the scene. It fires once per scene entry, warns, and
|
|
1641
|
+
* changes nothing — the fix is the game's own `scene.environment`, which is appearance and therefore
|
|
1642
|
+
* the game's to set.
|
|
1643
|
+
*/
|
|
1644
|
+
|
|
1645
|
+
/** Marker printed once per scene entry, for a log reader and a harness to grep. */
|
|
1646
|
+
declare const UNLIT_FOLIAGE_MARKER = "TN_UNLIT_FOLIAGE";
|
|
1647
|
+
/** The one line that says what to change. Never a second sentence: the fix is one decision. */
|
|
1648
|
+
declare const UNLIT_FOLIAGE_FIX = "set scene.environment (an HDRI or a sky texture) or give these materials an envMap; do not tint or flatten their normals to compensate";
|
|
1649
|
+
/** The verdict: what is affected, and enough names to find it in the scene graph. */
|
|
1650
|
+
interface IUnlitFoliageWarning {
|
|
1651
|
+
/** Distinct materials with no image-based light, the number an author can act on. */
|
|
1652
|
+
readonly materials: number;
|
|
1653
|
+
/** Meshes drawn with them, so one shared material is not mistaken for a scene-wide one. */
|
|
1654
|
+
readonly meshes: number;
|
|
1655
|
+
readonly examples: readonly string[];
|
|
1656
|
+
}
|
|
1657
|
+
/**
|
|
1658
|
+
* The warning for one scene entry, or `undefined` when nothing in it is unlit.
|
|
1659
|
+
*
|
|
1660
|
+
* Fails closed on the reading it needs: a scene with an environment, or a material carrying its own
|
|
1661
|
+
* `envMap`, gets no warning, because the absence of an image-based light is the whole claim and
|
|
1662
|
+
* anything else is speculation. Materials are counted once however many meshes share them, because
|
|
1663
|
+
* a hundred instances of one imported atlas are one decision, not a hundred.
|
|
1664
|
+
*/
|
|
1665
|
+
declare function unlitFoliageWarning(scene: Object3D & {
|
|
1666
|
+
environment?: unknown;
|
|
1667
|
+
}): IUnlitFoliageWarning | undefined;
|
|
1668
|
+
/** The marker line. */
|
|
1669
|
+
declare function formatUnlitFoliageWarning(warning: IUnlitFoliageWarning): string;
|
|
1670
|
+
|
|
1671
|
+
/** Marker for an equirectangular environment below three's minimum PMREM cube size. */
|
|
1672
|
+
declare const ENVIRONMENT_TOO_SMALL_MARKER = "TN_ENVIRONMENT_TOO_SMALL";
|
|
1673
|
+
/** Marker for a drawn material whose opacity three ignores. */
|
|
1674
|
+
declare const OPACITY_IGNORED_MARKER = "TN_OPACITY_IGNORED";
|
|
1675
|
+
/** Structural reads only: Node materials, native adapters and test stubs share this audit. */
|
|
1676
|
+
declare function renderTrapAudit(scene: Object3D & {
|
|
1677
|
+
environment?: unknown;
|
|
1678
|
+
}): string[];
|
|
1679
|
+
|
|
1409
1680
|
/**
|
|
1410
1681
|
* Authored static subtrees: stop recomposing transforms that nobody moves.
|
|
1411
1682
|
*
|
|
@@ -1749,8 +2020,8 @@ interface IDirectionalClipmapOptions {
|
|
|
1749
2020
|
readonly selectionGuard?: number | readonly number[];
|
|
1750
2021
|
/**
|
|
1751
2022
|
* Fraction of an extent a level's window may trail its followed centre by before it re-renders,
|
|
1752
|
-
* `[0, 1)`, default 0.125. Rounded to
|
|
1753
|
-
* old one-texel step. Larger steps re-render a level less often as the camera walks. One value
|
|
2023
|
+
* `[0, 1)`, default 0.125. Rounded to whole texels with one texel reserved for a deferred render;
|
|
2024
|
+
* `0` keeps the old one-texel step. Larger steps re-render a level less often as the camera walks. One value
|
|
1754
2025
|
* for every level, or one per level finest first, the last entry standing in for the rest.
|
|
1755
2026
|
*/
|
|
1756
2027
|
readonly refreshStep?: number | readonly number[];
|
|
@@ -1856,8 +2127,9 @@ interface IVirtualShadowOptions {
|
|
|
1856
2127
|
readonly mapSize?: number;
|
|
1857
2128
|
/**
|
|
1858
2129
|
* Texels per edge of each level's mover map — the map tracked casters draw into every frame.
|
|
1859
|
-
* Default:
|
|
1860
|
-
*
|
|
2130
|
+
* Default: `mapSize`, the cached levels' own density, so a caster keeps the edge it had at rest
|
|
2131
|
+
* while it moves and does not pop to a crisper one when it settles. Lower it to buy back fill
|
|
2132
|
+
* on a weak GPU; the soft edge it costs is on the mover only.
|
|
1861
2133
|
*/
|
|
1862
2134
|
readonly moverMapSize?: number;
|
|
1863
2135
|
/**
|
|
@@ -1891,6 +2163,7 @@ interface IVirtualShadowOptions {
|
|
|
1891
2163
|
*
|
|
1892
2164
|
* `false` puts every level back on the `refreshStep` it was given, which is also what a harness
|
|
1893
2165
|
* that wants to count today's renders uses.
|
|
2166
|
+
* `?tnAdaptiveRefresh=0` in the page URL makes the default `false` from the node's first setup.
|
|
1894
2167
|
*/
|
|
1895
2168
|
readonly adaptiveRefresh?: boolean;
|
|
1896
2169
|
/**
|
|
@@ -1910,7 +2183,7 @@ interface IVirtualShadowOptions {
|
|
|
1910
2183
|
*/
|
|
1911
2184
|
readonly expensiveRefreshShare?: number;
|
|
1912
2185
|
/**
|
|
1913
|
-
* Raise
|
|
2186
|
+
* Raise the finest level's texel size gate while its own render is too expensive for the frame, default
|
|
1914
2187
|
* true.
|
|
1915
2188
|
*
|
|
1916
2189
|
* The same measurement adaptive refresh reads — the smoothed cost of the level's own last render,
|
|
@@ -1921,6 +2194,7 @@ interface IVirtualShadowOptions {
|
|
|
1921
2194
|
* drops the tiniest props first and never a building, and a level that is cheap is never touched:
|
|
1922
2195
|
* it stays at scale 1 and submits exactly what it did before.
|
|
1923
2196
|
*
|
|
2197
|
+
* Coarse levels always stay at scale 1 so resolved casters survive the handover.
|
|
1924
2198
|
* `false` pins every level at scale 1, which is also what a harness that wants today's draw
|
|
1925
2199
|
* counts uses.
|
|
1926
2200
|
*/
|
|
@@ -1960,33 +2234,36 @@ interface IVirtualShadowOptions {
|
|
|
1960
2234
|
* cover's own, not its silhouette's. Set 0 to draw every caster into every level.
|
|
1961
2235
|
*/
|
|
1962
2236
|
readonly minCasterTexels?: number;
|
|
2237
|
+
/** Follow the framed receiving surface when the eye is more than one fine extent above it.
|
|
2238
|
+
* Default true; false keeps eye follow for every camera. Walking cameras keep eye follow.
|
|
2239
|
+
*/
|
|
2240
|
+
readonly followViewFocus?: boolean;
|
|
2241
|
+
/** Measure receiver-plane slope across each level's texel footprint to prevent coarse acne.
|
|
2242
|
+
* Default true; false preserves only the authored bias. Custom filterNode owns its footprint.
|
|
2243
|
+
*/
|
|
2244
|
+
readonly receiverPlaneBias?: boolean;
|
|
1963
2245
|
/**
|
|
1964
|
-
* Draw
|
|
1965
|
-
*
|
|
1966
|
-
*
|
|
1967
|
-
*
|
|
1968
|
-
* draws from and is put back the moment that render is over:
|
|
1969
|
-
*
|
|
1970
|
-
* 1. **Shadow LOD bias.** A mesh whose geometry carries a registered AutoLOD chain
|
|
1971
|
-
* (`lodChainOf`) is submitted with the chain's *coarsest* geometry. A level 2 window cannot
|
|
1972
|
-
* resolve a tree's needles, so drawing LOD0 there is a texel of needles per texel of shadow;
|
|
1973
|
-
* the coarse level's own texel is metres wide. Level 0 draws what the main pass draws.
|
|
1974
|
-
* 2. **Alpha-caster range.** An alpha-tested (`alphaTest > 0`) or transparent mesh casts into the
|
|
1975
|
-
* finest level only. Its cutout is its own texture: a coarse level either drops it — the
|
|
1976
|
-
* level's texel is wider than the card, so the fence is sub-texel — or keeps resolving a
|
|
1977
|
-
* texture it cannot afford. This is a per-primitive shadow cull distance, and the trade is
|
|
1978
|
-
* honest and one-sided: a fence's or a foliage card's shadow ends where the finest level's
|
|
1979
|
-
* window ends, and a wide level shows bare ground where it stood. Opaque casters — a merged
|
|
1980
|
-
* chunk's position-only proxy, a tree's silhouette — are drawn on every level as before.
|
|
1981
|
-
*
|
|
1982
|
-
* Neither is left changed: a hidden caster's `castShadow` and a coarse mesh's `geometry` are put
|
|
1983
|
-
* back before the next level, before the mover maps and before the main pass, which see the world
|
|
1984
|
-
* exactly as the game authored it. Mover maps keep full detail — a 256² map over the level's own
|
|
1985
|
-
* window, drawing only the tracked casters.
|
|
1986
|
-
* `false` puts every level back on stock full-detail draws, which is what the node did before
|
|
1987
|
-
* either default existed.
|
|
2246
|
+
* Draw registered AutoLOD chains with their coarsest geometry past the finest level, default true.
|
|
2247
|
+
* Alpha-tested and transparent casters keep casting on every level that resolves their bounds;
|
|
2248
|
+
* dropping their whole shadow at the fine window edge loses canopy and fences.
|
|
2249
|
+
* Geometry swaps are restored before the next level, mover map and main pass.
|
|
1988
2250
|
*/
|
|
1989
2251
|
readonly shadowLodBias?: boolean;
|
|
2252
|
+
/**
|
|
2253
|
+
* Redraw only the pages an invalidation dirtied, default true. A level whose window did not move
|
|
2254
|
+
* and whose asks named under half its pages renders those rectangles alone: pages casters were
|
|
2255
|
+
* removed from are put back to the far plane first, pages casters streamed into are just drawn.
|
|
2256
|
+
* `false` renders the whole level for every invalidation, as before. A VSM shadow map always
|
|
2257
|
+
* renders whole, because its blur pass reads the entire map.
|
|
2258
|
+
*/
|
|
2259
|
+
readonly partialRedraw?: boolean;
|
|
2260
|
+
/**
|
|
2261
|
+
* Quiet frames before an automatically detected mover goes back into the cached levels, default
|
|
2262
|
+
* 100 (Unreal's `FramesStaticThreshold`). A caster whose world matrix, instance matrix or
|
|
2263
|
+
* deformation changed is drawn through the mover maps without a `trackCaster` call; this is how
|
|
2264
|
+
* long it must hold still before its shadow is baked into the cache again. Positive integer.
|
|
2265
|
+
*/
|
|
2266
|
+
readonly staticAfterFrames?: number;
|
|
1990
2267
|
/** Print the `TN_VIRTUAL_SHADOW` line every `markerEvery` frames; `false` silences it. Default 300. */
|
|
1991
2268
|
readonly marker?: boolean | number;
|
|
1992
2269
|
}
|
|
@@ -2000,6 +2277,21 @@ interface IVirtualShadowStats {
|
|
|
2000
2277
|
readonly invalidated: number;
|
|
2001
2278
|
/** Tracked casters, as of this frame. */
|
|
2002
2279
|
readonly movers: number;
|
|
2280
|
+
/**
|
|
2281
|
+
* Casters the node classified as movers by measuring them, as of this frame: a world or instance
|
|
2282
|
+
* matrix that changed, or a deforming mesh. Counted apart from {@link movers}, which is `trackCaster`.
|
|
2283
|
+
*/
|
|
2284
|
+
readonly autoMovers: number;
|
|
2285
|
+
/**
|
|
2286
|
+
* Static-to-mover and mover-to-static changes of those casters over the node's lifetime. Each one
|
|
2287
|
+
* asks the levels for one region redraw, never a full one.
|
|
2288
|
+
*/
|
|
2289
|
+
readonly autoTransitions: number;
|
|
2290
|
+
/**
|
|
2291
|
+
* Mean JS time of the classification scan per frame, in milliseconds, over the node's lifetime.
|
|
2292
|
+
* It is the number the scan's 0.05 ms budget is judged against.
|
|
2293
|
+
*/
|
|
2294
|
+
readonly autoScanMs: number;
|
|
2003
2295
|
/** Mover maps rendered this frame: one per level when at least one caster is tracked. */
|
|
2004
2296
|
readonly moverRenders: number;
|
|
2005
2297
|
/** Levels served from their cached map this frame. */
|
|
@@ -2029,8 +2321,22 @@ interface IVirtualShadowStats {
|
|
|
2029
2321
|
readonly rendersTotal: number;
|
|
2030
2322
|
/** Of those, the renders taken because a level's window moved. */
|
|
2031
2323
|
readonly byMove: number;
|
|
2324
|
+
/**
|
|
2325
|
+
* Pages every level's window travelled between its renders, over the node's lifetime: the sum of
|
|
2326
|
+
* `|ΔminX| + |ΔminY|` at each render. Unlike `byMove` it does not depend on how many frames sampled
|
|
2327
|
+
* the path, so two runs of one route at different frame rates report the same number.
|
|
2328
|
+
*/
|
|
2329
|
+
readonly windowSteps: number;
|
|
2032
2330
|
/** Of those, the renders taken because an invalidation asked and its level's delay had passed. */
|
|
2033
2331
|
readonly byInvalidation: number;
|
|
2332
|
+
/** Of the renders taken for an invalidation (`byInvalidation`), those whose dirty set held only streamed-in casters. */
|
|
2333
|
+
readonly byAdmission: number;
|
|
2334
|
+
/** Of the renders taken for an invalidation, those whose dirty set held anything else: a removed caster, a region-less ask, a caster flag change. */
|
|
2335
|
+
readonly byEviction: number;
|
|
2336
|
+
/** Pages the dirty set held at each render, summed over the node's lifetime. A window move counts the whole level. */
|
|
2337
|
+
readonly pagesDirty: number;
|
|
2338
|
+
/** Pages each render actually drew, summed over the node's lifetime. Equals pagesDirty once a partial redraw exists. */
|
|
2339
|
+
readonly pagesRedrawn: number;
|
|
2034
2340
|
/**
|
|
2035
2341
|
* Invalidation asks that cost no render of their own, over the node's lifetime: absorbed by a
|
|
2036
2342
|
* render the level was taking anyway for its window, or merged into an ask already waiting out
|
|
@@ -2072,10 +2378,17 @@ interface IVirtualShadowDraws {
|
|
|
2072
2378
|
readonly wide: number;
|
|
2073
2379
|
/** Small casters, submitted by the finest level and by any level rendering a prewarm. */
|
|
2074
2380
|
readonly small: number;
|
|
2075
|
-
/** Merged per-chunk shadow proxies (`<name>-shadow`), drawn with
|
|
2381
|
+
/** Merged per-chunk shadow proxies (`<name>-shadow`), drawn with either caster half. */
|
|
2076
2382
|
readonly chunkProxy: number;
|
|
2077
2383
|
/** Everything else casting from layer 0 — terrain, props — which every level draws. */
|
|
2078
2384
|
readonly layer0: number;
|
|
2385
|
+
/**
|
|
2386
|
+
* GPU-scene keys: one mesh per `asset:level:part` drawn from the level's own twin of the dispatch's
|
|
2387
|
+
* output, which is the whole of what a keyed map submits of the world. Zero unless a provider
|
|
2388
|
+
* registered and `?tnShadowGpuKeys=1` asked, and then it replaces {@link cluster} and {@link wide}
|
|
2389
|
+
* rather than adding to them: the keys draw the placements those two would have.
|
|
2390
|
+
*/
|
|
2391
|
+
readonly keys: number;
|
|
2079
2392
|
}
|
|
2080
2393
|
declare const VIRTUAL_SHADOW_MARKER = "TN_VIRTUAL_SHADOW";
|
|
2081
2394
|
/**
|
|
@@ -2127,8 +2440,10 @@ declare const VIRTUAL_SHADOW_WIDE_CASTER_LAYER = 27;
|
|
|
2127
2440
|
* @situation shadows shimmer when the camera moves
|
|
2128
2441
|
* @constraint the light must be a DirectionalLight with `castShadow` and a target in the scene
|
|
2129
2442
|
* @constraint clipExtents are half-widths in world units, finest first, strictly increasing
|
|
2130
|
-
* @constraint
|
|
2443
|
+
* @constraint movers sort themselves: a layer-0 caster whose world matrix, instance matrix or deformation changed draws through the mover maps and leaves the cached levels, and returns to them after `staticAfterFrames` quiet frames; the cache redraws only the region it left
|
|
2444
|
+
* @constraint `trackCaster(object)` is the override that pins an object as a mover for good (it enables layer `VIRTUAL_SHADOW_MOVER_LAYER` on the object and its descendants), and `pinStatic(object)` opts an object out of detection; tracking or untracking refreshes only that object's region
|
|
2131
2445
|
* @override bias, biasNode, normalBias, intensity, radius, blurSamples, mapType and filterNode stay on `light.shadow`; mapSize and the other options here have defaults
|
|
2446
|
+
* @override followViewFocus: false keeps eye follow; receiverPlaneBias: false uses only authored bias
|
|
2132
2447
|
* @example
|
|
2133
2448
|
* const sun = new DirectionalLight(0xffffff, 3);
|
|
2134
2449
|
* sun.castShadow = true;
|
|
@@ -2172,6 +2487,12 @@ declare class VirtualShadowNode extends ShadowBaseNode {
|
|
|
2172
2487
|
*/
|
|
2173
2488
|
trackCaster(object: Object3D): string;
|
|
2174
2489
|
untrackCaster(objectOrId: Object3D | string): boolean;
|
|
2490
|
+
/**
|
|
2491
|
+
* Keep an object and its descendants out of automatic mover detection: they are static casters
|
|
2492
|
+
* whatever their transforms do, so a game that moves one takes on the stale shadow itself, or
|
|
2493
|
+
* calls `invalidateRegion`. Takes effect from the next frame.
|
|
2494
|
+
*/
|
|
2495
|
+
pinStatic(object: Object3D): void;
|
|
2175
2496
|
/** Force every level to re-render on the next frame — a tree fell, a door opened. */
|
|
2176
2497
|
invalidateAll(): void;
|
|
2177
2498
|
/**
|
|
@@ -2184,8 +2505,14 @@ declare class VirtualShadowNode extends ShadowBaseNode {
|
|
|
2184
2505
|
* `bounds` is `{ min: {x,y,z}, max: {x,y,z} }`, a plain object so a game can hand one over without
|
|
2185
2506
|
* importing three. Regions are consumed by the next `updateBefore`; one that arrives before the
|
|
2186
2507
|
* levels exist is dropped, because their first frame renders all of them anyway.
|
|
2508
|
+
*
|
|
2509
|
+
* `admission` says the region only gained casters. An added caster can only bring a texel's depth
|
|
2510
|
+
* closer, so a redraw for admissions alone never has to clear what the map already holds. The
|
|
2511
|
+
* default reads `bounds.admission === true`; an explicit second argument overrides it.
|
|
2187
2512
|
*/
|
|
2188
|
-
invalidateRegion(bounds: IBoundsLike
|
|
2513
|
+
invalidateRegion(bounds: IBoundsLike & {
|
|
2514
|
+
admission?: boolean;
|
|
2515
|
+
}, admission?: boolean): void;
|
|
2189
2516
|
setup(builder: NodeBuilder): Node | null | undefined;
|
|
2190
2517
|
updateBefore(frame: NodeFrame): undefined;
|
|
2191
2518
|
dispose(): void;
|
|
@@ -2212,6 +2539,8 @@ interface IDaylightOptions {
|
|
|
2212
2539
|
readonly sunIntensity: number;
|
|
2213
2540
|
/** Half-widths of the shadow windows in world units, finest first, strictly increasing. */
|
|
2214
2541
|
readonly shadowExtents: readonly number[];
|
|
2542
|
+
/** Texels per shadow level edge; a level's texel is `2 * extent / shadowMapSize`. Default: the sun's `shadow.mapSize.width` (512). */
|
|
2543
|
+
readonly shadowMapSize?: number;
|
|
2215
2544
|
/**
|
|
2216
2545
|
* How far a window may trail the camera before it re-renders, as a fraction of its own extent:
|
|
2217
2546
|
* one value for every level, or one per level finest first, the last entry standing in for the
|
|
@@ -2237,8 +2566,10 @@ interface IDaylightOptions {
|
|
|
2237
2566
|
readonly color: Color;
|
|
2238
2567
|
readonly density: number;
|
|
2239
2568
|
};
|
|
2240
|
-
/** Linear exposure multiplier for the
|
|
2569
|
+
/** Linear exposure multiplier for the tone curve (2^EV). */
|
|
2241
2570
|
readonly exposure: number;
|
|
2571
|
+
/** The tone curve, a look the game picks; AgX when it names none. */
|
|
2572
|
+
readonly toneMapping?: ToneMapping;
|
|
2242
2573
|
/**
|
|
2243
2574
|
* Edge of the sky box in world units. It must sit inside the camera's far plane with its corners
|
|
2244
2575
|
* included (a box, so half-diagonal ≈ 0.87 × this).
|
|
@@ -2326,18 +2657,13 @@ interface IAddInSlicesProgress {
|
|
|
2326
2657
|
}
|
|
2327
2658
|
interface IAddInSlicesOptions {
|
|
2328
2659
|
/**
|
|
2329
|
-
* Objects attached between presented frames
|
|
2330
|
-
*
|
|
2331
|
-
* The default is large because the reason it used to be small has been taken over by something
|
|
2332
|
-
* better. One per frame was right when nothing else compiled the world: the renderer built a few
|
|
2333
|
-
* newly visible pipelines per presented frame instead of all of them inside one multi-second
|
|
2334
|
-
* frame. It is not right once the framework warms the held scene (`warmUpScene`) — the compile is
|
|
2335
|
-
* then paid either way and the slice only chooses where, so a small slice buys nothing and costs
|
|
2336
|
-
* one present per object.
|
|
2660
|
+
* Objects attached between presented frames, when the game wants that count.
|
|
2337
2661
|
*
|
|
2338
|
-
*
|
|
2339
|
-
*
|
|
2340
|
-
*
|
|
2662
|
+
* Omitted, a slice ends on elapsed time instead: the loop measures what the game's own `add`
|
|
2663
|
+
* costs, in the place where the cost is paid, and presents a frame once the slice has run for its
|
|
2664
|
+
* budget. Objects that cost nothing stop paying a frame each, and objects that cost more than any
|
|
2665
|
+
* fixed count allows get cut sooner than that count would. Given, the count decides and the budget
|
|
2666
|
+
* is not used at all.
|
|
2341
2667
|
*/
|
|
2342
2668
|
readonly sliceSize?: number;
|
|
2343
2669
|
/** Called once per slice, and once more for a partial final slice. */
|
|
@@ -2366,14 +2692,19 @@ interface IAddInSlicesReport {
|
|
|
2366
2692
|
readonly added: number;
|
|
2367
2693
|
/** Objects the run was given. */
|
|
2368
2694
|
readonly total: number;
|
|
2369
|
-
/** Slices the work was cut into
|
|
2695
|
+
/** Slices the work was cut into: one host turn between each, several of which can share a frame. */
|
|
2370
2696
|
readonly slices: number;
|
|
2371
2697
|
/** Wall-clock milliseconds the run took, attaching and yielding together. */
|
|
2372
2698
|
readonly elapsedMs: number;
|
|
2373
|
-
/**
|
|
2699
|
+
/**
|
|
2700
|
+
* Objects per slice this run actually landed on: the count the game chose, or — when
|
|
2701
|
+
* the budget chose — the measured average, which is the number a caller copies into `sliceSize`.
|
|
2702
|
+
*/
|
|
2374
2703
|
readonly sliceSize: number;
|
|
2375
|
-
/** Whether that
|
|
2704
|
+
/** Whether that count came from the game rather than from the engine. */
|
|
2376
2705
|
readonly sliceSizeOverridden: boolean;
|
|
2706
|
+
/** Milliseconds of attaching one slice may spend before it presents. Absent when the game gave a count. */
|
|
2707
|
+
readonly sliceBudgetMs?: number;
|
|
2377
2708
|
/** True when `while` ended the run early. `added` is then less than `total`. */
|
|
2378
2709
|
readonly stopped: boolean;
|
|
2379
2710
|
}
|
|
@@ -2489,7 +2820,7 @@ interface ISpectralOceanOptions {
|
|
|
2489
2820
|
*
|
|
2490
2821
|
* This is not the simulation resolution. It is the size of the only thing copied back off the
|
|
2491
2822
|
* GPU, so it is the whole cost of being able to float something: `readbackResolution` squared
|
|
2492
|
-
* floats, every `readbackEveryFrames` frames.
|
|
2823
|
+
* pairs of height and vertical-velocity floats, every `readbackEveryFrames` frames.
|
|
2493
2824
|
*/
|
|
2494
2825
|
readonly readbackResolution: number;
|
|
2495
2826
|
/** Frames between height copies. Ignored when `readbackResolution` is zero. */
|
|
@@ -2498,6 +2829,8 @@ interface ISpectralOceanOptions {
|
|
|
2498
2829
|
/** A height read from the CPU copy, with the age of the frame that produced it. */
|
|
2499
2830
|
interface ISpectralOceanHeight {
|
|
2500
2831
|
readonly height: number;
|
|
2832
|
+
/** Metres per second at this same point and sample time, for temporal age correction. */
|
|
2833
|
+
readonly verticalVelocity: number;
|
|
2501
2834
|
/**
|
|
2502
2835
|
* Frames between the GPU state this height came from and now.
|
|
2503
2836
|
*
|
|
@@ -2556,12 +2889,109 @@ declare class SpectralOcean extends Object3D implements IComputeDriven$1 {
|
|
|
2556
2889
|
interface IGPUParticles3DBuffers {
|
|
2557
2890
|
readonly positions: StorageBufferNode<"vec3">;
|
|
2558
2891
|
readonly velocities: StorageBufferNode<"vec3">;
|
|
2559
|
-
|
|
2560
|
-
|
|
2892
|
+
/** Emitter-clock second of each slot's last spawn. Present only when `spawn` is given. */
|
|
2893
|
+
readonly births?: StorageBufferNode<"float">;
|
|
2894
|
+
}
|
|
2895
|
+
/** The engine clock, as TSL nodes, handed to `process` as its second argument. */
|
|
2896
|
+
interface IGPUParticles3DRuntime {
|
|
2897
|
+
readonly time: Node$1<"float">;
|
|
2898
|
+
readonly delta: Node$1<"float">;
|
|
2899
|
+
}
|
|
2900
|
+
/** Engine-owned uniforms for one `emitParticle` call. The slot is `(first + instanceIndex) % amount`. */
|
|
2901
|
+
interface IGPUParticles3DSpawnRequest {
|
|
2902
|
+
readonly first: UniformNode$1<"uint", number>;
|
|
2903
|
+
readonly count: UniformNode$1<"uint", number>;
|
|
2904
|
+
readonly origin: UniformNode$1<"vec3", Vector3>;
|
|
2905
|
+
readonly direction: UniformNode$1<"vec3", Vector3>;
|
|
2906
|
+
readonly seed: UniformNode$1<"float", number>;
|
|
2907
|
+
readonly time: Node$1<"float">;
|
|
2908
|
+
}
|
|
2909
|
+
/** Buffers a spawn-driven emitter's kernels receive: `births` always exists. */
|
|
2910
|
+
interface IGPUParticles3DSpawnBuffers extends IGPUParticles3DBuffers {
|
|
2911
|
+
readonly births: StorageBufferNode<"float">;
|
|
2912
|
+
}
|
|
2913
|
+
interface IGPUParticles3DBaseOptions {
|
|
2561
2914
|
readonly amount: number;
|
|
2562
2915
|
readonly material: SpriteNodeMaterial;
|
|
2916
|
+
/** World space when `spawn` is given, emitter space otherwise. */
|
|
2917
|
+
readonly localCoords?: boolean;
|
|
2918
|
+
/**
|
|
2919
|
+
* Override the local bounds from frame zero and skip GPU measurement.
|
|
2920
|
+
* @situation Supply known bounds for a particle cloud.
|
|
2921
|
+
* @constraint Must be a finite, non-empty box in the emitter's local space.
|
|
2922
|
+
*/
|
|
2923
|
+
readonly bounds?: Box3;
|
|
2924
|
+
/**
|
|
2925
|
+
* Metres added around the world box. Defaults to half the largest world scale.
|
|
2926
|
+
* @situation Cover the sprite quad; name padding when the material uses scaleNode.
|
|
2927
|
+
* @constraint Must be finite and non-negative, in world metres.
|
|
2928
|
+
*/
|
|
2929
|
+
readonly padding?: number;
|
|
2930
|
+
/**
|
|
2931
|
+
* Keep buffers on pause, or restart on return with clear. Defaults to pause.
|
|
2932
|
+
* @situation Choose whether a returning effect continues or starts again.
|
|
2933
|
+
* @constraint Must be pause or clear.
|
|
2934
|
+
*/
|
|
2935
|
+
readonly onCull?: "pause" | "clear";
|
|
2936
|
+
/**
|
|
2937
|
+
* Seconds continuously outside the view before culling. Defaults to 1.
|
|
2938
|
+
* @situation Avoid toggling effects near the view edge; Infinity disables view culling.
|
|
2939
|
+
* @constraint Must be non-negative; Infinity is allowed.
|
|
2940
|
+
*/
|
|
2941
|
+
readonly graceSeconds?: number;
|
|
2942
|
+
/**
|
|
2943
|
+
* Frames between GPU bounds measurements. Defaults to 8.
|
|
2944
|
+
* @situation Trade readback cost for a delayed view of the cloud bounds.
|
|
2945
|
+
* @constraint Must be a positive integer; paused emitters do not measure.
|
|
2946
|
+
*/
|
|
2947
|
+
readonly boundsEveryFrames?: number;
|
|
2948
|
+
}
|
|
2949
|
+
/** The closed-form tier: every particle is a function of time, `start` seeds the buffers. */
|
|
2950
|
+
interface IGPUParticles3DClosedFormOptions extends IGPUParticles3DBaseOptions {
|
|
2563
2951
|
readonly start: (buffers: IGPUParticles3DBuffers) => ComputeNode;
|
|
2564
|
-
readonly process: (buffers: IGPUParticles3DBuffers) => ComputeNode;
|
|
2952
|
+
readonly process: (buffers: IGPUParticles3DBuffers, runtime: IGPUParticles3DRuntime) => ComputeNode;
|
|
2953
|
+
readonly spawn?: undefined;
|
|
2954
|
+
readonly lifetime?: undefined;
|
|
2955
|
+
readonly maxSpawnPerFrame?: undefined;
|
|
2956
|
+
}
|
|
2957
|
+
/** The spawn tier: a burst is a request, and the engine owns the slots and the birth stamps. */
|
|
2958
|
+
interface IGPUParticles3DSpawnOptions extends IGPUParticles3DBaseOptions {
|
|
2959
|
+
/** Optional here: the engine already resets every birth. */
|
|
2960
|
+
readonly start?: (buffers: IGPUParticles3DSpawnBuffers) => ComputeNode;
|
|
2961
|
+
readonly process: (buffers: IGPUParticles3DSpawnBuffers, runtime: IGPUParticles3DRuntime) => ComputeNode;
|
|
2962
|
+
/**
|
|
2963
|
+
* Writes one burst. Dispatched over `amount` threads per `emitParticle`: a thread with
|
|
2964
|
+
* `instanceIndex >= request.count` returns at once. ponytail: costs `amount` threads per emit;
|
|
2965
|
+
* upgrade to an indirect dispatch of `count` threads if `amount` passes about 100,000.
|
|
2966
|
+
*/
|
|
2967
|
+
readonly spawn: (buffers: IGPUParticles3DSpawnBuffers, request: IGPUParticles3DSpawnRequest) => ComputeNode;
|
|
2968
|
+
/** Game-owned longest life in seconds. Lets `stats.recycledLive` count slots recycled while alive. */
|
|
2969
|
+
readonly lifetime?: number;
|
|
2970
|
+
/** Cap on particles spawned between two `process` calls. Defaults to `amount`. */
|
|
2971
|
+
readonly maxSpawnPerFrame?: number;
|
|
2972
|
+
}
|
|
2973
|
+
type IGPUParticles3DOptions = IGPUParticles3DClosedFormOptions | IGPUParticles3DSpawnOptions;
|
|
2974
|
+
interface IEmitParticleRequest {
|
|
2975
|
+
readonly count?: number;
|
|
2976
|
+
readonly origin?: {
|
|
2977
|
+
readonly x: number;
|
|
2978
|
+
readonly y: number;
|
|
2979
|
+
readonly z: number;
|
|
2980
|
+
};
|
|
2981
|
+
readonly direction?: {
|
|
2982
|
+
readonly x: number;
|
|
2983
|
+
readonly y: number;
|
|
2984
|
+
readonly z: number;
|
|
2985
|
+
};
|
|
2986
|
+
readonly seed?: number;
|
|
2987
|
+
}
|
|
2988
|
+
interface IGPUParticles3DStats {
|
|
2989
|
+
/** Particles requested but not spawned (over `amount` or over `maxSpawnPerFrame`). */
|
|
2990
|
+
readonly clamped: number;
|
|
2991
|
+
/** Particles spawned. */
|
|
2992
|
+
readonly spawned: number;
|
|
2993
|
+
/** Live slots overwritten by the ring. `undefined` without the `lifetime` option, never `0`. */
|
|
2994
|
+
readonly recycledLive: number | undefined;
|
|
2565
2995
|
}
|
|
2566
2996
|
declare class GPUParticles3D extends Sprite implements IComputeDriven$1 {
|
|
2567
2997
|
#private;
|
|
@@ -2569,11 +2999,34 @@ declare class GPUParticles3D extends Sprite implements IComputeDriven$1 {
|
|
|
2569
2999
|
readonly buffers: IGPUParticles3DBuffers;
|
|
2570
3000
|
readonly processCadence: "render";
|
|
2571
3001
|
readonly warmupNodes: readonly ComputeNode[];
|
|
3002
|
+
readonly localCoords: boolean;
|
|
2572
3003
|
emitting: boolean;
|
|
3004
|
+
/** Cooperate with measured frame-budget shedding without changing particle storage. */
|
|
3005
|
+
readonly budget: IBudgetCandidate;
|
|
2573
3006
|
constructor(options: IGPUParticles3DOptions);
|
|
2574
3007
|
get released(): boolean;
|
|
3008
|
+
get stats(): IGPUParticles3DStats;
|
|
3009
|
+
/** Seconds outside view before culling; Infinity disables it at runtime. */
|
|
3010
|
+
get graceSeconds(): number;
|
|
3011
|
+
set graceSeconds(value: number);
|
|
2575
3012
|
attachRenderer(renderer: IRendererLike): void;
|
|
2576
|
-
|
|
3013
|
+
/** The override or newest landed local bounds; absent until a valid sample lands. */
|
|
3014
|
+
get measuredBounds(): Box3 | undefined;
|
|
3015
|
+
/** Simulation compute calls, excluding starts and bounds reduction. */
|
|
3016
|
+
get dispatches(): number;
|
|
3017
|
+
/** Current cull state and the number of state changes. */
|
|
3018
|
+
get cull(): {
|
|
3019
|
+
readonly state: "running" | "paused" | "cleared";
|
|
3020
|
+
readonly reason: "outside-view" | "over-budget" | undefined;
|
|
3021
|
+
readonly transitions: number;
|
|
3022
|
+
};
|
|
3023
|
+
process(renderer?: IRendererLike | undefined, camera?: Camera, _covered?: boolean, _view?: undefined, simulatedSeconds?: number): void;
|
|
3024
|
+
/**
|
|
3025
|
+
* Spawns `count` particles at `origin` (world space unless `localCoords`). Every call gets its own ring
|
|
3026
|
+
* slots, so a second burst never touches the first one's live particles. No readback.
|
|
3027
|
+
*/
|
|
3028
|
+
emitParticle(request?: IEmitParticleRequest): void;
|
|
3029
|
+
/** Reruns `start`. A spawn-driven emitter instead kills every particle and rewinds the ring. */
|
|
2577
3030
|
restart(): void;
|
|
2578
3031
|
detach(): void;
|
|
2579
3032
|
}
|
|
@@ -2635,6 +3088,154 @@ declare class FluidField2D extends Group {
|
|
|
2635
3088
|
detach(): void;
|
|
2636
3089
|
}
|
|
2637
3090
|
|
|
3091
|
+
type Vec3 = readonly [number, number, number];
|
|
3092
|
+
type Vec4 = readonly [number, number, number, number];
|
|
3093
|
+
declare const instancedArray: any;
|
|
3094
|
+
interface IFluidBounds {
|
|
3095
|
+
readonly min: Vec3;
|
|
3096
|
+
readonly max: Vec3;
|
|
3097
|
+
}
|
|
3098
|
+
/** An obstacle the water flows around. Boxes carry an xyzw quaternion; spheres have no orientation. */
|
|
3099
|
+
type IFluidCollider = {
|
|
3100
|
+
readonly kind: "sphere";
|
|
3101
|
+
readonly center: Vec3;
|
|
3102
|
+
readonly radius: number;
|
|
3103
|
+
} | {
|
|
3104
|
+
readonly kind: "box";
|
|
3105
|
+
readonly center: Vec3;
|
|
3106
|
+
readonly halfExtents: Vec3;
|
|
3107
|
+
readonly rotation?: Vec4;
|
|
3108
|
+
};
|
|
3109
|
+
interface IFluidParticlesOptions {
|
|
3110
|
+
/** Particle slots. The solver never holds more than this many live particles. */
|
|
3111
|
+
readonly capacity: number;
|
|
3112
|
+
/** Rest spacing in metres. The smoothing radius is twice this. */
|
|
3113
|
+
readonly spacing?: number;
|
|
3114
|
+
/** The container. Particles are projected back inside it every iteration. */
|
|
3115
|
+
readonly bounds?: IFluidBounds;
|
|
3116
|
+
/** Density-constraint iterations per fixed step, 0 to 8. */
|
|
3117
|
+
readonly iterations?: number;
|
|
3118
|
+
readonly viscosity?: number;
|
|
3119
|
+
readonly cohesion?: number;
|
|
3120
|
+
readonly vorticity?: number;
|
|
3121
|
+
readonly gravity?: number;
|
|
3122
|
+
/** Vector speed limit in m/s. Prediction projects radius-sized segments; this is not swept CCD. */
|
|
3123
|
+
readonly maxSpeed?: number;
|
|
3124
|
+
readonly timeStep?: number;
|
|
3125
|
+
/** Colliders updated per step through `setColliders`. */
|
|
3126
|
+
readonly maxColliders?: number;
|
|
3127
|
+
/** Queued `fill`/`emit` calls consumed per step. Extra calls return `false`. */
|
|
3128
|
+
readonly maxSpawns?: number;
|
|
3129
|
+
/** Voxel edge of the density volume, in metres. Defaults to half the spacing. */
|
|
3130
|
+
readonly voxelSize?: number;
|
|
3131
|
+
/** Fixed steps between GPU-to-CPU copies of stats and column heights. */
|
|
3132
|
+
readonly readbackEvery?: number;
|
|
3133
|
+
/** Extra acceleration (m/s²) added to every particle, from the game's own TSL. */
|
|
3134
|
+
readonly force?: (position: Node$1<"vec3">, velocity: Node$1<"vec3">, time: Node$1<"float">) => Node$1;
|
|
3135
|
+
}
|
|
3136
|
+
interface IFluidParticlesStats {
|
|
3137
|
+
readonly count: number;
|
|
3138
|
+
/** Mean of `max(0, density - 1)` over live particles; 0 is incompressible. */
|
|
3139
|
+
readonly meanCompression: number;
|
|
3140
|
+
readonly maxSpeed: number;
|
|
3141
|
+
readonly min: Vec3;
|
|
3142
|
+
readonly max: Vec3;
|
|
3143
|
+
/** Fixed steps between the GPU state these numbers describe and now. */
|
|
3144
|
+
readonly staleFrames: number;
|
|
3145
|
+
}
|
|
3146
|
+
/**
|
|
3147
|
+
* Simulate liquid as particles on the GPU and expose the data, never the look.
|
|
3148
|
+
*
|
|
3149
|
+
* It is a Position Based Fluids solver (density constraints, XSPH viscosity, cohesion, vorticity
|
|
3150
|
+
* confinement) whose passes run as compute kernels every fixed step. Nothing is drawn: `positions`
|
|
3151
|
+
* and `velocities` are storage nodes (`.w` of `positions` is the live flag, `.w` of `velocities`
|
|
3152
|
+
* is a 0..1 foam hint), `density` is a 3D texture of smoothed particle density a game raymarches
|
|
3153
|
+
* or thresholds, and `sample(x, z)` is the free-surface height a `Buoyancy3D` consumes.
|
|
3154
|
+
* Appearance — refraction, absorption, foam, spray — stays in the game's `src/render/` code.
|
|
3155
|
+
* @situation pour, splash, or dam-break water that fills a container and flows around obstacles
|
|
3156
|
+
* @situation simulate water or another liquid as particles in a fluid simulation
|
|
3157
|
+
* @situation drop a ball or box into liquid and let it displace and float on the water
|
|
3158
|
+
* @situation emit a stream or waterfall of particle fluid and drain it somewhere else
|
|
3159
|
+
* @situation sample particle-fluid density or surface height in a game-owned render node
|
|
3160
|
+
* @constraint add the fluid through `ctx.add` so renderer attachment, fixed-step dispatch, and release are automatic
|
|
3161
|
+
* @constraint a renderer without WebGPU compute throws a named error at attach; it never draws nothing
|
|
3162
|
+
* @constraint `emit` recycles the oldest slot once `capacity` slots have been used; `fill` stops at capacity
|
|
3163
|
+
* @constraint `sample` and `stats` read a throttled GPU copy and report `staleFrames`; they are never live
|
|
3164
|
+
* @override iterations, viscosity, cohesion, vorticity, gravity and maxSpeed tune the solver without changing its pass order
|
|
3165
|
+
* @example const water = new FluidParticles3D({ capacity: 6000 });
|
|
3166
|
+
* ctx.add(water);
|
|
3167
|
+
* water.fill([-2.8, 0.1, -1.5], [-0.6, 3, 1.5]);
|
|
3168
|
+
*/
|
|
3169
|
+
declare class FluidParticles3D extends Group {
|
|
3170
|
+
#private;
|
|
3171
|
+
readonly capacity: number;
|
|
3172
|
+
readonly spacing: number;
|
|
3173
|
+
readonly bounds: IFluidBounds;
|
|
3174
|
+
readonly iterations: number;
|
|
3175
|
+
readonly maxSpeed: number;
|
|
3176
|
+
readonly timeStep: number;
|
|
3177
|
+
readonly maxColliders: number;
|
|
3178
|
+
readonly maxSpawns: number;
|
|
3179
|
+
readonly processCadence: "fixed";
|
|
3180
|
+
readonly warmupNodes: readonly ComputeNode[];
|
|
3181
|
+
/** vec4 per slot: xyz position, w = 1 live / 0 free. */
|
|
3182
|
+
readonly positions: ReturnType<typeof instancedArray>;
|
|
3183
|
+
/** vec4 per slot: xyz velocity, w = foam 0..1. */
|
|
3184
|
+
readonly velocities: ReturnType<typeof instancedArray>;
|
|
3185
|
+
/** Smoothed particle density, ~1 inside water; sample it with `texture3D`. */
|
|
3186
|
+
readonly density: Storage3DTexture;
|
|
3187
|
+
/** Voxel counts of `density`. */
|
|
3188
|
+
readonly volumeSize: Vec3;
|
|
3189
|
+
/** World-space corner of voxel (0,0,0) and the edge length of one voxel. */
|
|
3190
|
+
readonly volumeOrigin: Vec3;
|
|
3191
|
+
readonly voxelSize: number;
|
|
3192
|
+
constructor(options: IFluidParticlesOptions);
|
|
3193
|
+
get released(): boolean;
|
|
3194
|
+
/** Slots handed out so far; never above `capacity`. */
|
|
3195
|
+
get used(): number;
|
|
3196
|
+
get steps(): number;
|
|
3197
|
+
get viscosity(): number;
|
|
3198
|
+
set viscosity(value: number);
|
|
3199
|
+
get cohesion(): number;
|
|
3200
|
+
set cohesion(value: number);
|
|
3201
|
+
get vorticity(): number;
|
|
3202
|
+
set vorticity(value: number);
|
|
3203
|
+
get gravity(): number;
|
|
3204
|
+
set gravity(value: number);
|
|
3205
|
+
attachRenderer(renderer: IRendererLike): void;
|
|
3206
|
+
/**
|
|
3207
|
+
* Place a lattice of particles in `[min, max]`, one per `spacing`, and return how many fit.
|
|
3208
|
+
* Particles never wrap: a full solver places none.
|
|
3209
|
+
*/
|
|
3210
|
+
fill(min: Vec3, max: Vec3, velocity?: Vec3): number;
|
|
3211
|
+
/** Spawn one particle. Once every slot has been used the oldest slot is recycled. */
|
|
3212
|
+
emit(position: Vec3, velocity?: Vec3): boolean;
|
|
3213
|
+
/** Free every live particle inside the box on the next step. */
|
|
3214
|
+
drain(min: Vec3, max: Vec3): boolean;
|
|
3215
|
+
/** Push particles within `radius` of `point` outward and up, strongest at the centre. */
|
|
3216
|
+
stir(point: Vec3, strength: number, radius: number): boolean;
|
|
3217
|
+
/** Replace the colliders. Call it every fixed step with the bodies' current transforms. */
|
|
3218
|
+
setColliders(colliders: readonly IFluidCollider[]): void;
|
|
3219
|
+
/**
|
|
3220
|
+
* Free-surface height near `(x, z)`, box-filtered over open columns of the newest landed GPU
|
|
3221
|
+
* copy; `bounds.min.y` where no water is near or nothing has landed yet. Shaped for `Buoyancy3D`'s `surface`.
|
|
3222
|
+
*/
|
|
3223
|
+
sample(x: number, z: number, _time?: number): {
|
|
3224
|
+
readonly height: number;
|
|
3225
|
+
};
|
|
3226
|
+
/** Surface height at `(x, z)`; see {@link sample}. */
|
|
3227
|
+
heightAt(x: number, z: number): number;
|
|
3228
|
+
/**
|
|
3229
|
+
* Fixed steps between the GPU state the newest copy holds and now; grows until the first copy
|
|
3230
|
+
* lands. `sample` and `heightAt` read the same copy, so this is their age too.
|
|
3231
|
+
*/
|
|
3232
|
+
get staleFrames(): number;
|
|
3233
|
+
/** Counts and extremes from the newest landed GPU copy, or `undefined` before one lands. */
|
|
3234
|
+
get stats(): IFluidParticlesStats | undefined;
|
|
3235
|
+
process(renderer?: IRendererLike | undefined): void;
|
|
3236
|
+
detach(): void;
|
|
3237
|
+
}
|
|
3238
|
+
|
|
2638
3239
|
/**
|
|
2639
3240
|
* A disturbance that propagates. `WaveField` in this same package evaluates a fixed analytic
|
|
2640
3241
|
* swell: it is the sea a game always has, and nothing a game does changes it. This is the other
|
|
@@ -2846,20 +3447,13 @@ interface IWaterReflectionOptions {
|
|
|
2846
3447
|
/** Whether this surface may appear in other reflectors' passes. Off is one pass; on is n². */
|
|
2847
3448
|
readonly bounces?: boolean;
|
|
2848
3449
|
/**
|
|
2849
|
-
*
|
|
2850
|
-
*
|
|
2851
|
-
*
|
|
2852
|
-
*
|
|
2853
|
-
* This is how much *world* the second pass costs, and on a crowded scene it is the whole bill.
|
|
2854
|
-
* The mirrored pass is a second draw of everything, so a frame with sixty-eight aircraft in it
|
|
2855
|
-
* pays for sixty-eight aircraft twice — once where the player can see them and once in the water,
|
|
2856
|
-
* where they are a few pixels and half of them are behind the camera anyway. Put the big
|
|
2857
|
-
* silhouettes a player actually reads in the water on their own layer and name it here.
|
|
2858
|
-
*
|
|
2859
|
-
* The mask decides what appears in the mirror, so the game owns it: this only carries the number
|
|
2860
|
-
* through to the pass, and a game that omits it gets the whole world reflected as before.
|
|
3450
|
+
* Explicit Three Layers mask. Wins over automatic selection, including `1` (all layer-0 props).
|
|
3451
|
+
* Omit to reflect terrain-sized surfaces and large non-instanced shadow casters. Instanced and
|
|
3452
|
+
* skinned props are excluded automatically; sky/background and lighting remain available.
|
|
2861
3453
|
*/
|
|
2862
3454
|
readonly layers?: number;
|
|
3455
|
+
/** Minimum world-space extent for automatic terrain/casters, in metres. Default 10. */
|
|
3456
|
+
readonly minSize?: number;
|
|
2863
3457
|
/**
|
|
2864
3458
|
* How often the mirrored pass redraws, in presented frames.
|
|
2865
3459
|
*
|
|
@@ -2938,7 +3532,7 @@ declare class WaterSurface3D {
|
|
|
2938
3532
|
* cannot inspect is a reflection you cannot cost. Undefined when this surface has no reflection.
|
|
2939
3533
|
*/
|
|
2940
3534
|
reflectionCameraFor(camera: Camera): Camera | undefined;
|
|
2941
|
-
/**
|
|
3535
|
+
/** Explicit mask supplied by the game. Undefined means automatic terrain/large-caster selection. */
|
|
2942
3536
|
readonly reflectionLayers: number | undefined;
|
|
2943
3537
|
/** How often the mirrored pass redraws, in presented frames. `1` is every frame, the default. */
|
|
2944
3538
|
readonly reflectionRefreshInterval: number;
|
|
@@ -3642,6 +4236,6 @@ declare function boneLengthDeviations(root: Object3D, bind: IBoneLengthSnapshot,
|
|
|
3642
4236
|
* unavoidable here — core is bundled for browsers and cannot read `package.json` at runtime — so
|
|
3643
4237
|
* the spec now asserts this equals the manifest instead of asserting a number somebody typed.
|
|
3644
4238
|
*/
|
|
3645
|
-
declare const version = "0.3.
|
|
4239
|
+
declare const version = "0.3.5";
|
|
3646
4240
|
|
|
3647
|
-
export { ATLAS_PADDING, ATMOSPHERE_LUT_RESOLUTIONS, AnimationPlayer, Atmosphere, type AtmosphereDirection, AtmosphereLuts, type AtmosphereRgb, Billboard3D, type BillboardLockAxis, CameraShake, type CameraShakeCurve, ClusteredBatch, ClusteredMesh, Daylight, FlightModel, FluidField2D, FramePassKind, GPUParticles3D, GPUSceneBVH, type GPUSceneBVHTraceFunction, GroundSnap, type IAddInSlicesOptions, type IAddInSlicesProgress, type IAddInSlicesReport, type IAircraftAirframe, type IAnimationPlayOptions, type IAnimationPlayerOptions, type IAtmosphereLutResolution, type IAtmosphereLutResolutions, type IAtmosphereOptions, type IAtmosphereParameterPatch, type IAtmosphereParameters, type IAtmosphereScenePass, type IBillboard3DOptions, type IBoneContactReport, type IBoneLengthDeviation, type IBoneLengthDeviationReport, type IBoneLengthDeviationsOptions, type IBoneLengthSnapshot, type IBonePoseError, type ICameraShakeOffset, type ICameraShakeOptions, type IClipBindingReport, type IClipCoverageReport, type IClipPoseErrorOptions, type IClipPoseErrorReport, type IClipPoseSubject, type IClipTrackBinding, type IClusterTable, type IClusteredBatchBuildOptions, type IClusteredBatchOptions, type IClusteredMeshOptions, type IClusteredPlacement, IComputeDriven$1 as IComputeDriven, type IDaylightOptions, type IFlightAxes, type IFlightControls, type IFlightDeck, type IFlightEnvironment, type IFlightForces, type IFlightModelOptions, type IFlightModifiers, type IFlightQuaternion, type IFlightState, type IFlightVector3, type IFluidFieldOptions, type IFluidFieldSampler, type IFluidFieldVector2, IFrameBudgetWindow, IGPUReadbackSample, type IGPUSceneBVHMaterialGroup, type IGPUSceneBVHOptions, IGamePluginHooks, IGamePluginRuntime, type IGroundSnapOptions, type IInstancedBatchBuildOptions, type IInstancedBatchOptions, type IInstancedPlacement, type ILaunchFailure, type ILoadAllOptions, type ILoadAllProgress, type IMatrixWorldReport, type IMeasureThreePoseOptions, type IMergeByMaterialOptions, type IMergePart, type IMergePartsOptions, type INormaliseToMetresOptions, type IPathFollow3DOptions, type IPathFollow3DProjection, type IPathFollow3DSample, type IProbeVolumeBakeProgress, type IProbeVolumeCoefficient, type IProbeVolumeObservation, type IProbeVolumeOptions, type IReplayOptions, type IReplayRecording, type IReplayRecordingSample, type IResolvedAtmosphereParameters, type IRippleFieldFlow, type IRippleFieldOptions, type ISceneShape, type ISceneWarning, type ISkeletalMesh3DOptions, type ISoftBody3DOptions, type ISoftBodyCollision, type ISolarPosition, type ISolarPositionInput, type ISpanProbeTarget, type ISpanSummary, type ISpanWindow, type ISpectralOceanCascade, type ISpectralOceanHeight, type ISpectralOceanOptions, type ISpriteAnimator3DOptions, type ISpriteFrame3D, type IStaticTransformCensus, type IStrideReport, type IThreePoseBounds, type IThreePoseMeasurement, type ITracerPool3DOptions, type ITracerSpawnOptions, type IValidationReport, type IVirtualShadowOptions, type IVirtualShadowStats, type IWaterReflectionOptions, type IWaterSurfaceOptions, type IWaveFieldDomainWarp, type IWaveFieldGraphOptions, type IWaveFieldOptions, type IWaveFieldSample, type IWaveFieldWave, InstancedBatch, LUT_RESOLUTIONS, type LaunchFailureKind, type MatrixWorldMode, MatrixWorldPass, NEUTRAL_FLIGHT_MODIFIERS, type NormaliseAxis, PROBE_VOLUME_MARKER, PathFollow3D, ProbeVolume, type ProbeVolumeDensity, RENDERLIST_VALIDATE_FLAG, RENDERLIST_VALIDATE_MARKER, type Recording, RenderListValidator, type ReplayPointer, RippleField, SCENE_WARNING_MARKER, SPANS, SPANS_FLAG, SPANS_MARKER, SPAN_COUNT, SPAN_NAMES, STATIC_TRANSFORM_MARKER, SkeletalMesh3D, SoftBody3D, type SpanId, SpanRecorder, SpectralOcean, SpriteAnimator3D, type SpritePlaybackMode, type ThreePoseQuaternion, type ThreePoseVector, TracerPool3D, VIRTUAL_SHADOW_CASTER_LAYER, VIRTUAL_SHADOW_MARKER, VIRTUAL_SHADOW_MOVER_LAYER, VIRTUAL_SHADOW_WIDE_CASTER_LAYER, VirtualShadowNode, WaterSurface3D, type WaveDirection, WaveField, addInSlices, addSpan, aerodynamicCoefficients, airDensity, aircraftMass, alwaysRender, attachToBone, attitudeAxes,
|
|
4241
|
+
export { ATLAS_PADDING, ATMOSPHERE_LUT_RESOLUTIONS, AnimationComposer, AnimationPlayer, Atmosphere, type AtmosphereDirection, AtmosphereLuts, type AtmosphereRgb, Billboard3D, type BillboardLockAxis, BlendSpace1D, BlendSpace2D, CameraShake, type CameraShakeCurve, ClusteredBatch, ClusteredMesh, Daylight, ENVIRONMENT_TOO_SMALL_MARKER, FlightModel, FluidField2D, FluidParticles3D, FramePassKind, GPUParticles3D, GPUSceneBVH, type GPUSceneBVHTraceFunction, GroundSnap, type IAddInSlicesOptions, type IAddInSlicesProgress, type IAddInSlicesReport, type IAircraftAirframe, type IAnimationComposerOptions, type IAnimationLayer, type IAnimationMask, type IAnimationMotionDelta, type IAnimationPlayOptions, type IAnimationPlayerOptions, type IAnimationRootMotionOptions, type IAtmosphereLutResolution, type IAtmosphereLutResolutions, type IAtmosphereOptions, type IAtmosphereParameterPatch, type IAtmosphereParameters, type IAtmosphereScenePass, type IBillboard3DOptions, type IBoneContactReport, type IBoneLengthDeviation, type IBoneLengthDeviationReport, type IBoneLengthDeviationsOptions, type IBoneLengthSnapshot, type IBonePoseError, type ICameraShakeOffset, type ICameraShakeOptions, type IClipBindingReport, type IClipCoverageReport, type IClipPoseErrorOptions, type IClipPoseErrorReport, type IClipPoseSubject, type IClipTrackBinding, type IClusterTable, type IClusteredBatchBuildOptions, type IClusteredBatchOptions, type IClusteredMeshOptions, type IClusteredPlacement, IComputeDriven$1 as IComputeDriven, type IDaylightOptions, type IEmitParticleRequest, type IFlightAxes, type IFlightControls, type IFlightDeck, type IFlightEnvironment, type IFlightForces, type IFlightModelOptions, type IFlightModifiers, type IFlightQuaternion, type IFlightState, type IFlightVector3, type IFluidBounds, type IFluidCollider, type IFluidFieldOptions, type IFluidFieldSampler, type IFluidFieldVector2, type IFluidParticlesOptions, type IFluidParticlesStats, IFrameBudgetWindow, type IGPUParticles3DOptions, type IGPUParticles3DRuntime, type IGPUParticles3DSpawnBuffers, type IGPUParticles3DSpawnRequest, type IGPUParticles3DStats, IGPUReadbackSample, type IGPUSceneBVHMaterialGroup, type IGPUSceneBVHOptions, IGamePluginHooks, IGamePluginRuntime, type IGroundSnapOptions, type IInstancedBatchBuildOptions, type IInstancedBatchOptions, type IInstancedPlacement, type ILaunchFailure, type ILoadAllOptions, type ILoadAllProgress, type IMatrixWorldReport, type IMeasureThreePoseOptions, type IMergeByMaterialOptions, type IMergePart, type IMergePartsOptions, type INormaliseToMetresOptions, type IPathFollow3DOptions, type IPathFollow3DProjection, type IPathFollow3DSample, type IProbeVolumeBakeProgress, type IProbeVolumeCoefficient, type IProbeVolumeObservation, type IProbeVolumeOptions, type IReplayOptions, type IReplayRecording, type IReplayRecordingSample, type IResolvedAtmosphereParameters, type IRippleFieldFlow, type IRippleFieldOptions, type ISceneShape, type ISceneWarning, type ISkeletalMesh3DOptions, type ISoftBody3DOptions, type ISoftBodyCollision, type ISolarPosition, type ISolarPositionInput, type ISpanProbeTarget, type ISpanSummary, type ISpanWindow, type ISpectralOceanCascade, type ISpectralOceanHeight, type ISpectralOceanOptions, type ISpriteAnimator3DOptions, type ISpriteFrame3D, type IStaticTransformCensus, type IStrideReport, type IThreePoseBounds, type IThreePoseMeasurement, type ITracerPool3DOptions, type ITracerSpawnOptions, type IUnlitFoliageWarning, type IValidationReport, type IVirtualShadowOptions, type IVirtualShadowStats, type IWaterReflectionOptions, type IWaterSurfaceOptions, type IWaveFieldDomainWarp, type IWaveFieldGraphOptions, type IWaveFieldOptions, type IWaveFieldSample, type IWaveFieldWave, InstancedBatch, LUT_RESOLUTIONS, type LaunchFailureKind, type MatrixWorldMode, MatrixWorldPass, NEUTRAL_FLIGHT_MODIFIERS, type NormaliseAxis, OPACITY_IGNORED_MARKER, PROBE_VOLUME_MARKER, PathFollow3D, ProbeVolume, type ProbeVolumeDensity, RENDERLIST_VALIDATE_FLAG, RENDERLIST_VALIDATE_MARKER, type Recording, RenderListValidator, type ReplayPointer, RippleField, SCENE_WARNING_MARKER, SPANS, SPANS_FLAG, SPANS_MARKER, SPAN_COUNT, SPAN_NAMES, STATIC_TRANSFORM_MARKER, SkeletalMesh3D, SoftBody3D, type SpanId, SpanRecorder, SpectralOcean, SpriteAnimator3D, type SpritePlaybackMode, type ThreePoseQuaternion, type ThreePoseVector, TracerPool3D, UNLIT_FOLIAGE_FIX, UNLIT_FOLIAGE_MARKER, VIRTUAL_SHADOW_CASTER_LAYER, VIRTUAL_SHADOW_MARKER, VIRTUAL_SHADOW_MOVER_LAYER, VIRTUAL_SHADOW_WIDE_CASTER_LAYER, VirtualShadowNode, WaterSurface3D, type WaveDirection, WaveField, addInSlices, addSpan, aerodynamicCoefficients, airDensity, aircraftMass, alwaysRender, attachToBone, attitudeAxes, beginSpan, boneContact, boneLengthDeviations, boneLengths, bvhIntersectFirstHit, clipBoneCoverage, clipPoseError, clipTrackBindings, createReplayDriver, debugFlag, describeSceneShape, describeSceneWarning, directionFromSolarPosition, directionalTransmittance, displayPeriodMs, endSpan, exposeDebug, formatSceneWarning, formatSpansWindow, formatUnlitFoliageWarning, formatValidationReport, gearClearance, installSpanProbes, invalidateStatic, isStatic, loadAll, markStatic, measureThreePose, mergeByMaterial, mergeParts, normaliseToMetres, onLaunchFailure, parseReplayRecording, posedBounds, rayStruct, readProbeVolumeObservation, readVirtualShadowMarker, refreshStaticTransforms, renderListValidationRequested, renderTrapAudit, replay, resetStaticTransforms, resolveAtmosphereLutResolutions, resolveAtmosphereParameters, sceneWarning, setAttitude, setSpanRecorder, skeletonBones, softCircleDataTexture, solarPosition, solarPositionAt, spanNow, spanRecorder, spansRequested, staticTransformCensus, unlitFoliageWarning, unmarkStatic, updateAtmosphereParameters, updateClusteredMeshes, validateWorldMatrices, version, zenithTransmittance };
|