@threenative/core 0.3.6 → 0.3.8

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.
Files changed (137) hide show
  1. package/README.md +3 -5
  2. package/capabilities.json +739 -50
  3. package/dist/{assets-CqvE429w.d.ts → assets-YUbXa3-Y.d.ts} +101 -2
  4. package/dist/{canvas-layer-C1-5CviZ.d.ts → canvas-layer-vCtanIeB.d.ts} +1 -1
  5. package/dist/{game-Jz4Fdoeb.d.ts → game-cb99J-YE.d.ts} +100 -31
  6. package/dist/hot.d.ts +4 -4
  7. package/dist/hot.js +23 -5
  8. package/dist/index.d.ts +1742 -29
  9. package/dist/index.js +22443 -12423
  10. package/dist/{model-lod-BDAUYgsS.d.ts → model-lod-CTpZ6imz.d.ts} +1 -1
  11. package/dist/net.js +39 -12
  12. package/dist/playtest.d.ts +4 -4
  13. package/dist/playtest.js +48 -9
  14. package/dist/react-css.js +23 -0
  15. package/dist/react.d.ts +2 -2
  16. package/dist/{renderer-9yEo9hPa.d.ts → renderer-rZm0hVqq.d.ts} +178 -5
  17. package/dist/ui-layer.d.ts +11 -2
  18. package/dist/ui-layer.js +76 -4
  19. package/dist/worker.d.ts +36 -0
  20. package/dist/worker.js +1088 -0
  21. package/dist/world.d.ts +11 -3
  22. package/dist/world.js +1117 -197
  23. package/mcp/animation-server.mjs +265 -0
  24. package/mcp/animation.mjs +22 -0
  25. package/mcp/call.mjs +105 -0
  26. package/mcp/devtools.mjs +5 -0
  27. package/mcp/engine-server.mjs +713 -37
  28. package/mcp/launch.mjs +3 -2
  29. package/mcp/servers.d.mts +2 -0
  30. package/mcp/servers.mjs +33 -8
  31. package/package.json +12 -8
  32. package/patches/three@0.185.1-prd269-upgrade.patch +308 -0
  33. package/patches/three@0.185.1.patch +481 -272
  34. package/src/animation-packet-state.ts +88 -0
  35. package/src/animation-pose-packet.ts +537 -0
  36. package/src/animation.ts +779 -31
  37. package/src/asset-cache.ts +719 -0
  38. package/src/assets.ts +521 -152
  39. package/src/audio.ts +29 -3
  40. package/src/auto-batch.ts +792 -0
  41. package/src/config.ts +2 -0
  42. package/src/frame-budget.ts +268 -2
  43. package/src/game.ts +525 -105
  44. package/src/grounding.ts +7 -6
  45. package/src/hot.ts +19 -5
  46. package/src/index.ts +381 -6
  47. package/src/input.ts +21 -2
  48. package/src/interpolation.ts +19 -1
  49. package/src/launch-diagnostics.ts +7 -2
  50. package/src/look/ao-multibounce.ts +29 -0
  51. package/src/look/ao-reach.ts +39 -0
  52. package/src/look/auto-exposure.ts +264 -0
  53. package/src/look/default-tone-mapping.ts +44 -0
  54. package/src/look/exposure-graph.ts +208 -0
  55. package/src/look/exposure-readback.ts +97 -0
  56. package/src/look/exposure-settings.ts +132 -0
  57. package/src/look/filmic-tone-mapping.ts +852 -0
  58. package/src/look/gi-registry.ts +55 -0
  59. package/src/look/local-exposure.ts +507 -0
  60. package/src/look/look-diagnostics.ts +24 -0
  61. package/src/look/motion-blur.ts +42 -0
  62. package/src/look/quality.ts +309 -0
  63. package/src/look/reflection-trace.ts +344 -0
  64. package/src/look/unreal-bloom.ts +295 -0
  65. package/src/look/vignette.ts +14 -0
  66. package/src/look/world-environment.ts +2033 -0
  67. package/src/loop.ts +25 -1
  68. package/src/merge-parts.ts +25 -10
  69. package/src/model-lod.ts +14 -0
  70. package/src/net-session.ts +58 -14
  71. package/src/ocean/spectral.ts +41 -7
  72. package/src/picking.ts +72 -5
  73. package/src/platform.ts +29 -1
  74. package/src/playtest.ts +54 -8
  75. package/src/profiling/FrameCounters.ts +166 -5
  76. package/src/profiling/FrameStages.ts +289 -0
  77. package/src/profiling/Spans.ts +39 -25
  78. package/src/profiling/debug-telemetry.ts +312 -0
  79. package/src/profiling/scene-warning.ts +42 -6
  80. package/src/projection-apply.ts +11 -3
  81. package/src/projection-content.ts +189 -0
  82. package/src/projection-marker.ts +6 -2
  83. package/src/projection-plan.ts +279 -28
  84. package/src/projection-skinned.ts +620 -5
  85. package/src/projection-stability.ts +16 -0
  86. package/src/projection-uniform.ts +5 -1
  87. package/src/quiet-markers.ts +56 -0
  88. package/src/render/budget-ladder.ts +256 -0
  89. package/src/render/chain.ts +89 -7
  90. package/src/render/exposure-units.ts +59 -0
  91. package/src/render/frame-time-budget.ts +162 -0
  92. package/src/render/gi-budget.ts +231 -0
  93. package/src/render/gi-visualize.ts +49 -0
  94. package/src/render/material-key.ts +1 -0
  95. package/src/render/probe-volume.ts +196 -36
  96. package/src/render/rough-diffuse.ts +177 -0
  97. package/src/render/scene-trace.ts +532 -0
  98. package/src/render/shadow-filter-budget.ts +237 -0
  99. package/src/render/sky-capture.ts +194 -0
  100. package/src/render/soft-shadow.ts +607 -0
  101. package/src/render/surface-cache.ts +418 -0
  102. package/src/render/traced-reflections.ts +408 -0
  103. package/src/render/two-sided-foliage.ts +120 -0
  104. package/src/render/virtual-shadow-pages.ts +112 -12
  105. package/src/render/virtual-shadow.ts +386 -38
  106. package/src/render-camera-cull.ts +536 -31
  107. package/src/render-pass-budget.ts +140 -22
  108. package/src/renderProjection.ts +65 -9
  109. package/src/renderer-config.ts +3 -2
  110. package/src/renderer.ts +289 -14
  111. package/src/resolution-scaler.ts +65 -7
  112. package/src/skeletal-mesh.ts +4 -0
  113. package/src/snow-field.ts +46 -0
  114. package/src/softbody.ts +6 -5
  115. package/src/startup-offscreen-bytes.ts +168 -0
  116. package/src/startup-readiness.ts +137 -2
  117. package/src/ui-bridge.ts +38 -0
  118. package/src/ui-hit-regions.ts +6 -2
  119. package/src/ui-layer.ts +1 -0
  120. package/src/ui-state.ts +32 -3
  121. package/src/version.ts +1 -1
  122. package/src/viewport.ts +8 -5
  123. package/src/warmup.ts +76 -10
  124. package/src/worker-audio.ts +579 -0
  125. package/src/worker.ts +842 -0
  126. package/src/world-cells.ts +4 -1
  127. package/gpl/LICENSE.GPL +0 -117
  128. package/gpl/convert.py +0 -192
  129. package/gpl/fixtures/make_world_fixture.py +0 -184
  130. package/gpl/recipes/_common.py +0 -180
  131. package/gpl/recipes/bake_ao.py +0 -111
  132. package/gpl/recipes/decimate.py +0 -70
  133. package/gpl/recipes/export_world.py +0 -699
  134. package/gpl/recipes/retarget.py +0 -131
  135. package/gpl/recipes/unwrap.py +0 -71
  136. package/mcp/blender-server.mjs +0 -689
  137. package/mcp/blender.mjs +0 -26
package/dist/index.d.ts CHANGED
@@ -1,17 +1,18 @@
1
1
  import * as three from 'three';
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
- export { I as IAssetLoader, a as IAssetLoaderOptions, b as ITextureOptions, c as createAssetLoader, r as reconcileMirroredClips } from './assets-CqvE429w.js';
2
+ import { Object3D, AnimationClip, AnimationMixer, Vector3, Camera, Group, Scene, Texture, Matrix4, Mesh, BufferGeometry, Box3, Material, DataTexture, InstancedMesh, ColorRepresentation, DirectionalLight, DepthTexture, LightShadow, Color, HemisphereLight, ToneMapping, FogExp2, Vector2, RenderTarget, Sprite, CatmullRomCurve3 } from 'three';
3
+ export { A as AssetPriority, b as IAssetCacheReport, c as IAssetCacheState, I as IAssetLoader, a as IAssetLoaderOptions, d as IAssetPrefetchProgress, e as IAssetRequestOptions, f as ITextureOptions, g as createAssetLoader, r as reconcileMirroredClips } from './assets-YUbXa3-Y.js';
4
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-Jz4Fdoeb.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-Jz4Fdoeb.js';
5
+ export { C as CanvasLayer } from './canvas-layer-vCtanIeB.js';
6
+ import { b as IGamePluginRuntime, a as IGamePluginHooks } from './game-cb99J-YE.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-cb99J-YE.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, 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';
9
+ import { StorageTexture, ComputeNode, UniformNode, Node, TextureNode, CubeRenderTarget, WebGPURenderer, NodeMaterial, StorageBufferNode, StructTypeNode, Data3DTexture, ShadowBaseNode, NodeBuilder, NodeFrame, TempNode, SpriteNodeMaterial, StorageTextureNode, Storage3DTexture } from 'three/webgpu';
10
+ import { I as IRendererLike, h as IStageGpuReading, F as FramePassKind, a as IFrameBudgetWindow } from './renderer-rZm0hVqq.js';
11
+ export { D as DEFAULT_PIPELINE_CENSUS_LIMIT, i as DEFAULT_TARGET_FPS, j as FRAME_BUDGET_MARKER, k as FRAME_BUDGET_PHASES, l as FRAME_HITCH_MARKER, m as FrameBudget, n as FrameBudgetPhase, o as FrameCounters, p as ICounterDevice, g as IFrameBudgetOptions, q as IFrameBudgetPassSummary, b as IFrameBudgetSimulation, r as IFrameBudgetSummary, s as IFrameCounters, d as IFramePhaseSample, e as IPipelineCensus, t as IPipelineCensusCounts, u as IPipelineCensusEvent, v as IPipelineCensusOptions, w as IPipelineProvenance, x as IPipelineShaderObservation, y as IPlatformInfo, z as IRenderChainApplied, A as IRenderChainBudgetWindow, B as IRenderChainDroppedStage, C as IRenderChainOptions, E as IRenderChainRenderer, G as IRenderChainRequest, H as IRenderChainStage, J as IRenderChainStageContext, K as IRenderChainVelocityMeasurement, L as IRenderChainVelocityReport, M as IRenderChainVelocityRequest, N as IRenderChainVelocityResult, c as IRenderPassSample, O as ITargetFps, P as IVelocityRenderPass, Q as MAX_TARGET_FPS, R as MainDrawSource, S as PIPELINE_CENSUS_CAPABILITY, T as PIPELINE_CENSUS_VERSION, U as PipelineCensus, V as PipelineCensusMode, W as PipelineCensusStatus, X as PlatformFormFactor, Y as PlatformOS, Z as PlatformRuntime, _ as RENDER_CHAIN_MARKER, $ as RENDER_CHAIN_STAGE_ORDER, a0 as RENDER_CHAIN_TIERS, a1 as RenderChain, a2 as RenderChainSource, a3 as RenderChainStageId, a4 as RenderChainStageName, a5 as RenderChainTier, a6 as RenderChainTierRequest, a7 as RenderChainVelocitySource, a8 as RendererToneMapping, a9 as TargetFpsSource, aa as VELOCITY_OUTPUT_NAME, ab as VELOCITY_PREVIOUS_BONE_MATRICES, ac as VELOCITY_PREVIOUS_INSTANCE_MATRICES, ad as VELOCITY_PREVIOUS_WORLD_MATRIX, ae as VelocityTracker, af as counterDeviceOf, ag as createPipelineCensus, ah as ensureVelocityOutput, ai as getPlatform, aj as isMobile, ak as isNative, al as isTouchscreenAvailable, am as isWeb, an as prewarm, ao as readRenderChainObservation, ap as readRenderChainReport, aq as readVelocityPreviousBoneMatrices, ar as readVelocityPreviousMatrices, as as readVelocityPreviousWorldMatrix, at as resolveTargetFps, au as snapRefreshRate, av as stageGpuReading, aw as velocityTexture, ax as withVelocityContext } from './renderer-rZm0hVqq.js';
12
+ import { I as IComputeDriven$1, c as IGPUReadbackSample, d as IBudgetCandidate } from './model-lod-CTpZ6imz.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-CTpZ6imz.js';
14
14
  import { SkyMesh } from 'three/addons/objects/SkyMesh.js';
15
+ import { texture, pass } from 'three/tsl';
15
16
  import { Node as Node$1, UniformNode as UniformNode$1 } from 'three/src/nodes/Nodes.js';
16
17
  import 'zustand/vanilla';
17
18
 
@@ -40,7 +41,6 @@ import 'zustand/vanilla';
40
41
  * The ids are integers on the hot path — a span call must not allocate a string to be cheap enough
41
42
  * to put around a per-draw call — and the names exist only in the report.
42
43
  */
43
- /** Marker printed once per report window when spans are installed. */
44
44
  declare const SPANS_MARKER = "TN_FRAME_SPANS";
45
45
  /**
46
46
  * The launch flag that installs the spans. Off by default: this is a diagnostic that adds work to
@@ -88,6 +88,10 @@ declare const SPANS: {
88
88
  readonly terrainBlock: 14;
89
89
  /** Terrain seam reconciliation and bridge-attribute swap on the calling thread. */
90
90
  readonly terrainSeam: 15;
91
+ /** One actual AnimationPlayer.update call, measured by the crowd fixture. */
92
+ readonly animationUpdate: 16;
93
+ /** One actual SkinnedBatch.write call, including its guard and any skeleton/palette work. */
94
+ readonly skinnedWrite: 17;
91
95
  };
92
96
  type SpanId = (typeof SPANS)[keyof typeof SPANS];
93
97
  /** Names, indexed by id. The only place a span name is a string. */
@@ -229,6 +233,10 @@ interface IAnimationPlayerOptions {
229
233
  * way. Set `false` to keep the authored rate; the measurement below stays live either way and
230
234
  * says that it was overridden. The convention re-times locomotion only: a `"once"` clip — a
231
235
  * death, a flinch — always plays at its authored rate.
236
+ *
237
+ * Left unset, a rig carried by a camera (first-person hands, a held weapon) keeps its authored
238
+ * rate: the camera moves it, and a mouse turn sweeps its root metres a second, which read as
239
+ * stride played the hands at the 3x ceiling. `stride.cameraCarried` reports it; `true` syncs anyway.
232
240
  */
233
241
  readonly strideSync?: boolean;
234
242
  /**
@@ -239,6 +247,26 @@ interface IAnimationPlayerOptions {
239
247
  * the clip's motion back as if it were the body's.
240
248
  */
241
249
  readonly strideRoot?: Object3D;
250
+ /**
251
+ * Evaluate by measured screen size by default; a positive integer names a frame interval.
252
+ * A stride-synced walk at 32 px or more evaluates every frame.
253
+ * Public mixer listeners/speed overrides stay full-rate; action speed interpolations do until settled.
254
+ */
255
+ readonly updateRate?: "auto" | number;
256
+ /**
257
+ * Let the skinned batch evaluate a held, distant rig's pose on the GPU from keyframes and time.
258
+ * Off by default: each vertex re-evaluates the pose in the main and shadow passes, which cost
259
+ * 2.7 / 10.3 / 13.8 ms of GPU time at 32 / 128 / 256 rigs on Intel gen-12lp (PRD-570). Held rigs
260
+ * otherwise keep their last CPU pose until their next evaluation.
261
+ */
262
+ readonly gpuPose?: boolean;
263
+ }
264
+ interface IAnimationUpdateRateReport {
265
+ readonly rate: number;
266
+ readonly overridden: boolean;
267
+ readonly evaluated: boolean;
268
+ /** Frames between CPU bone refreshes: `rate`, or longer while the GPU evaluates the pose. */
269
+ readonly boneRate: number;
242
270
  }
243
271
  /**
244
272
  * What the feet are doing against what the body is doing.
@@ -257,6 +285,8 @@ interface IStrideReport {
257
285
  readonly synced: boolean;
258
286
  /** True when a rate was measured and deliberately not applied. */
259
287
  readonly overridden: boolean;
288
+ /** True when a camera carries the rig, so an unset `strideSync` keeps the authored rate. */
289
+ readonly cameraCarried: boolean;
260
290
  /**
261
291
  * True when the clip carries no root motion and its stride was read off the feet instead.
262
292
  *
@@ -274,12 +304,21 @@ interface IAnimationPlayOptions {
274
304
  * also keeps its authored rate — stride sync re-times locomotion, not events.
275
305
  */
276
306
  readonly mode?: "loop" | "once";
307
+ /**
308
+ * The playback rate of this play of a `"once"` clip, like Godot's `play(name, blend, speed)`.
309
+ * `1` (the default) is the authored rate; the next play without it returns to `1`. A looping clip
310
+ * keeps its stride-synced rate and ignores it.
311
+ */
312
+ readonly speed?: number;
277
313
  }
278
314
  declare class AnimationPlayer {
279
315
  #private;
280
316
  readonly mixer: AnimationMixer;
281
317
  readonly root: Object3D;
282
318
  constructor(options: IAnimationPlayerOptions);
319
+ get updateRate(): "auto" | number;
320
+ set updateRate(value: "auto" | number);
321
+ get updateRateReport(): IAnimationUpdateRateReport;
283
322
  get current(): string | undefined;
284
323
  get advancedFrames(): number;
285
324
  /** True when a `"once"` clip has reached its end and is holding. */
@@ -330,7 +369,8 @@ declare class AnimationPlayer {
330
369
  readonly transition?: number;
331
370
  readonly phaseSync?: boolean;
332
371
  }): void;
333
- update(dt: number): void;
372
+ /** `force` evaluates accumulated time now, even outside this player's stagger slot. */
373
+ update(dt: number, force?: boolean): void;
334
374
  stop(): void;
335
375
  dispose(): void;
336
376
  }
@@ -508,6 +548,8 @@ interface ISkeletalMesh3DOptions {
508
548
  readonly size?: INormaliseToMetresOptions;
509
549
  readonly strideRoot?: Object3D;
510
550
  readonly strideSync?: boolean;
551
+ readonly updateRate?: "auto" | number;
552
+ readonly gpuPose?: boolean;
511
553
  }
512
554
  declare class SkeletalMesh3D extends AnimationPlayer {
513
555
  constructor(options: ISkeletalMesh3DOptions);
@@ -809,6 +851,39 @@ declare class Atmosphere extends Group implements IComputeDriven {
809
851
  */
810
852
  declare function solarPositionAt(date: Date | string, latitude: number, longitude: number): ISolarPosition;
811
853
 
854
+ interface ISkyCaptureOptions {
855
+ /** Power of two, at least 16. Defaults to 128 texels per face. */
856
+ readonly resolution?: number;
857
+ /** Radians, in [0, PI]. Defaults to one degree; equality does not refresh. */
858
+ readonly thresholdAngle?: number;
859
+ /** Integer in [1, 6]. Defaults to one (six frames per capture). */
860
+ readonly facesPerFrame?: number;
861
+ readonly lowerHemisphereBlack?: boolean;
862
+ }
863
+ /** GPU-free sun movement and cube-face budget. An in-flight capture always finishes. */
864
+ declare class SkyCaptureSchedule {
865
+ #private;
866
+ constructor(options?: Pick<ISkyCaptureOptions, "thresholdAngle" | "facesPerFrame">);
867
+ next(sunDirection: Vector3): number[];
868
+ /** Retry the entire capture after a render or filter failure. */
869
+ reset(): void;
870
+ }
871
+ /** Capture game-owned radiance and prefilter it with Three.js WebGPU PMREM.
872
+ * @situation light a scene from a procedural sky when its sun moves
873
+ * @constraint call update once per frame on an initialized WebGPURenderer; assign texture after it returns true
874
+ * @constraint sky nodes use a world-space view direction; keep supplied sky resources alive until dispose
875
+ * @example const capture = new SkyCapture(renderer, skyNode); if (capture.update(sun)) scene.environment = capture.texture;
876
+ */
877
+ declare class SkyCapture {
878
+ #private;
879
+ readonly cubeTarget: CubeRenderTarget;
880
+ constructor(renderer: WebGPURenderer, sky: Scene | Node<"vec3">, options?: ISkyCaptureOptions);
881
+ get texture(): Texture | undefined;
882
+ /** True only when all six faces have been captured and PMREM-filtered. No timer. */
883
+ update(sunDirection: Vector3): boolean;
884
+ dispose(): void;
885
+ }
886
+
812
887
  interface IClothTopologyOptions {
813
888
  /** Original geometry vertex indices that never move. Duplicate positions pin together. */
814
889
  readonly pinned: readonly number[];
@@ -924,6 +999,140 @@ declare class GPUSceneBVH extends Group implements IComputeDriven$1 {
924
999
  detach(): void;
925
1000
  }
926
1001
 
1002
+ interface ITraceSceneReport {
1003
+ readonly triangles: number;
1004
+ readonly nodes: number;
1005
+ readonly materials: number;
1006
+ /** Meshes left out because their triangles move (instanced, skinned, batched, morphing). */
1007
+ readonly skippedMoving: number;
1008
+ readonly milliseconds: number;
1009
+ }
1010
+ interface ITraceScene {
1011
+ readonly report: ITraceSceneReport;
1012
+ readonly bounds: Box3;
1013
+ /** The material of every id, for what the table cannot hold (a map, a node). */
1014
+ readonly materials: readonly Material[];
1015
+ readonly nodes: DataTexture;
1016
+ readonly triangles: DataTexture;
1017
+ readonly materialTable: DataTexture;
1018
+ readonly nodeData: Float32Array;
1019
+ readonly triangleData: Float32Array;
1020
+ readonly materialData: Float32Array;
1021
+ dispose(): void;
1022
+ }
1023
+
1024
+ interface ITracedReflectionsOptions {
1025
+ /** Which meshes a ray can hit. Default: every mesh under a visible parent chain. */
1026
+ readonly include?: (mesh: Mesh) => boolean;
1027
+ /** Surfaces rougher than this take no traced reflection. Unreal's `LumenMaxRoughnessToTrace`: 0.4. */
1028
+ readonly maxRoughnessToTrace?: number;
1029
+ /** The weight falls from 1 to 0 over this much roughness, ending at `maxRoughnessToTrace`: 0.1. */
1030
+ readonly roughnessFadeLength?: number;
1031
+ /**
1032
+ * Surfaces rougher than this take the diffuse GI for specular, not the radiance cache. Unreal's
1033
+ * `MaxRoughnessToEvaluateRoughSpecular`: 0.8.
1034
+ */
1035
+ readonly maxRoughnessToEvaluateRoughSpecular?: number;
1036
+ /** The share of diffuse GI rises from 0 to 1 over this much roughness, ending at the limit above: 0.2. */
1037
+ readonly roughSpecularFadeLength?: number;
1038
+ /**
1039
+ * Most nodes one ray visits before it stops walking with the nearest surface found so far, which may be the
1040
+ * wrong one. A walk visits each node at most once, so the default, the tree's node count up to 2048, never
1041
+ * cuts a ray short in a scene of up to 2048 nodes.
1042
+ */
1043
+ readonly maxSteps?: number;
1044
+ /** False silences the TN_TRACED_REFLECTIONS line, not the report. */
1045
+ readonly marker?: boolean;
1046
+ }
1047
+ /**
1048
+ * Where a surface's specular comes from, as shares that add to 1: the traced ray, the radiance cache read along the
1049
+ * reflected direction (a rough lobe), or the diffuse GI (a surface too rough for a lobe).
1050
+ */
1051
+ interface IReflectionRoute<T> {
1052
+ readonly traced: T;
1053
+ readonly roughSpecular: T;
1054
+ readonly diffuse: T;
1055
+ }
1056
+ /** One ray's answer, as nodes. Every field is meaningful only where `hit` is 1. */
1057
+ interface ITracedHit {
1058
+ /** 1 where the ray found a surface, else 0. */
1059
+ readonly hit: Node<"float">;
1060
+ /** Metres along the (unit) ray, or -1 on a miss. */
1061
+ readonly distance: Node<"float">;
1062
+ readonly position: Node<"vec3">;
1063
+ /** The interpolated vertex normal, flipped to face the ray. */
1064
+ readonly normal: Node<"vec3">;
1065
+ /** The hit triangle's index in the pack's leaf order. */
1066
+ readonly triangle: Node<"float">;
1067
+ /** The hit material's colour, roughness, emissive (times intensity) and metalness, from the pack's table. */
1068
+ readonly albedo: Node<"vec3">;
1069
+ readonly roughness: Node<"float">;
1070
+ readonly emissive: Node<"vec3">;
1071
+ readonly metalness: Node<"float">;
1072
+ /** The index into `TracedReflections.scene.materials`: a game that needs a map or a node looks the material up. */
1073
+ readonly material: Node<"float">;
1074
+ }
1075
+ interface ITracedRay {
1076
+ readonly origin: Node<"vec3">;
1077
+ /** Unit length. */
1078
+ readonly direction: Node<"vec3">;
1079
+ /** Closest hit allowed, in metres. Default 0.001. */
1080
+ readonly near?: Node<"float"> | number;
1081
+ /** Farthest hit allowed, in metres. Default 1e4. */
1082
+ readonly far?: Node<"float"> | number;
1083
+ /**
1084
+ * Stop at the first surface found, which need not be the nearest: the answer for a shadow ray, which only asks
1085
+ * whether anything is in the way. `distance`, `position` and the material then describe that surface.
1086
+ */
1087
+ readonly anyHit?: boolean;
1088
+ }
1089
+ /**
1090
+ * Ray queries against the scene's triangles for reflections, in the engine's own TSL: the pack is float
1091
+ * textures and the walk is a loop, so the kernel needs no storage buffer and no WGSL of its own.
1092
+ *
1093
+ * Unreal's Lumen reflections trace what the screen cannot see through a software scene (mesh SDFs, or hardware
1094
+ * rays) for surfaces smoother than a roughness cut-off, and fall back to a cached radiance below it. This is
1095
+ * the scene half of that: `trace()` answers "what does this ray hit" and the material at the hit. How the hit
1096
+ * is lit, what a miss sees and how the result joins the frame stay in the game's `src/render/` code.
1097
+ */
1098
+ declare class TracedReflections {
1099
+ #private;
1100
+ /** The packed triangles; `scene.materials[hit.material]` is the three material of a hit. */
1101
+ readonly scene: ITraceScene;
1102
+ readonly maxRoughnessToTrace: number;
1103
+ readonly roughnessFadeLength: number;
1104
+ readonly maxRoughnessToEvaluateRoughSpecular: number;
1105
+ readonly roughSpecularFadeLength: number;
1106
+ readonly maxSteps: number;
1107
+ constructor(root: Object3D, options?: ITracedReflectionsOptions);
1108
+ get report(): ITraceSceneReport & {
1109
+ readonly bytes: number;
1110
+ };
1111
+ /**
1112
+ * 1 for a surface at least as smooth as the cut-off minus the fade, falling to 0 at `maxRoughnessToTrace`.
1113
+ * Multiply a traced reflection by it so a rough surface never shows a trace's noise.
1114
+ */
1115
+ weight(roughness: Node<"float">): Node<"float">;
1116
+ /** `weight` for one roughness on the CPU: a surface rougher than `maxRoughnessToTrace` casts no ray. */
1117
+ weightAt(roughness: number): number;
1118
+ /**
1119
+ * Where a surface's specular comes from (Unreal: `LumenCombineReflectionsAlpha` picks the ray, and
1120
+ * `RoughReflectionsDiffuseLerp` in `LumenReflectionsCombine.ush` fades the rest from the gather's rough specular to
1121
+ * the diffuse GI). The ray's share is `weight`; of the rest, the diffuse share rises from 0 at the limit minus the
1122
+ * fade to 1 at the limit, and the radiance cache answers for what is left.
1123
+ */
1124
+ route(roughness: Node<"float">): IReflectionRoute<Node<"float">>;
1125
+ /** `route` for one roughness on the CPU. */
1126
+ routeAt(roughness: number): IReflectionRoute<number>;
1127
+ /**
1128
+ * The nearest surface along a ray, with its normal and material. The walk is the depth-first, skip-pointer one
1129
+ * `traceScene` runs on the CPU: a node's box is tested, a miss jumps to the node after the subtree, a hit on an
1130
+ * inner node steps to its left child, a leaf tests its triangles in a loop.
1131
+ */
1132
+ trace(ray: ITracedRay): ITracedHit;
1133
+ dispose(): void;
1134
+ }
1135
+
927
1136
  interface IInstancedLodOptions {
928
1137
  /** Baked-chain selection is automatic. `false` leaves detail to the caller. */
929
1138
  readonly autoLod?: false | {
@@ -1090,6 +1299,12 @@ interface IMergeByMaterialOptions {
1090
1299
  * trading one draw for a single enormous buffer. See `CHUNK_MERGE_MAX_VERTICES`.
1091
1300
  */
1092
1301
  readonly maxGroupVertices?: number;
1302
+ /**
1303
+ * Told which meshes went into each merged mesh, part by part in the order their triangles sit in
1304
+ * the merged buffer (an `InstancedMesh` appears once per instance it expanded into). The caller
1305
+ * that detaches the sources uses it to give one back without rebuilding the merge.
1306
+ */
1307
+ readonly onGroup?: (merged: Mesh, sources: readonly Mesh[]) => void;
1093
1308
  }
1094
1309
  /**
1095
1310
  * Merge game-authored pieces into one buffer, keeping each piece's own colour and, when asked,
@@ -1500,6 +1715,335 @@ declare class MatrixWorldPass {
1500
1715
  dispose(): void;
1501
1716
  }
1502
1717
 
1718
+ /**
1719
+ * The frame-period rule that decides when a render cost moves, as Unreal's DynamicRenderScaling does.
1720
+ *
1721
+ * It compares the whole GPU frame with the frame period, never one stage's milliseconds. A stage
1722
+ * reading depends on the GPU clock (the SSGI pass read 6.3 ms at P5 and 2.1 to 3.0 ms at boost on one
1723
+ * scene), and the frame period does not. The rule follows UE 5.8.3:
1724
+ * `Engine/Source/Runtime/Engine/Private/DynamicResolution.cpp` (the `r.DynamicRes.*` defaults at
1725
+ * `:32-103`, the history walk at `:219-330`, the change gate at `:370-390`) and
1726
+ * `Engine/Source/Runtime/RenderCore/Private/DynamicRenderScaling.cpp` (`GetTargetedMs`,
1727
+ * `EstimateResolutionFactor`, `DoesResolutionChangeEnough`).
1728
+ *
1729
+ * Measurement and decision only: the caller applies a move and calls `reset()`, because the frames of
1730
+ * the old level say nothing about the new one.
1731
+ */
1732
+ type FrameTimeModel = "linear" | "quadratic";
1733
+ interface IFrameTimeBudgetOptions {
1734
+ /** The frame period in milliseconds: `r.DynamicRes.FrameTimeBudget`, such as 1000 / 60. */
1735
+ readonly periodMs: number;
1736
+ /** The share of the period to keep free: `TargetedGPUHeadRoomPercentage`. Default 0.10. */
1737
+ readonly headroom?: number;
1738
+ /** Frames kept in the history: `r.DynamicRes.HistorySize`. Default 16. */
1739
+ readonly historyFrames?: number;
1740
+ /** Weight of frame N-1 against frame N: `r.DynamicRes.FrameWeightExponent`. Default 0.9. */
1741
+ readonly frameWeight?: number;
1742
+ /** Frames between two changes: `r.DynamicRes.MinResolutionChangePeriod`. Default 8. */
1743
+ readonly minChangeFrames?: number;
1744
+ /** Consecutive frames over the period that force an immediate drop: `MaxConsecutiveOverBudgetGPUFrameCount`. Default 2. */
1745
+ readonly panicFrames?: number;
1746
+ /** The smallest move worth a change: `ChangePercentageThreshold`. Default 0.02. */
1747
+ readonly changeThreshold?: number;
1748
+ /** How cost scales with the lever: pixels are quadratic in the resolution fraction, a throttle is linear. Default quadratic. */
1749
+ readonly model?: FrameTimeModel;
1750
+ }
1751
+
1752
+ /**
1753
+ * A cost ladder for one stage: the stage runs at one level, and the whole GPU frame moves it. The
1754
+ * frame-period rule of `FrameTimeBudget` (Unreal's DynamicRenderScaling heuristic) says when the
1755
+ * frame is too dear or has room. A stage steps down only when it could absorb the overage even at
1756
+ * zero cost, so a frame that another stage made slow keeps its level. A level that failed waits a
1757
+ * growing number of frames before the next try, because the cheaper level's own reading cannot say
1758
+ * what the dearer one would cost.
1759
+ *
1760
+ * Measurement and decision only. What a level draws belongs to the game, which applies the step.
1761
+ * The same ladder serves the shadow filter samples (`ShadowFilterBudget`) and, with one level, the
1762
+ * GI report (`GIBudget`).
1763
+ */
1764
+ interface IBudgetLadderOptions<L extends string> {
1765
+ /** Levels from the cheapest to the dearest. */
1766
+ readonly levels: readonly L[];
1767
+ /** The level the stage starts at. */
1768
+ readonly start: L;
1769
+ /** The author fixed the level: an over-budget frame is reported and the level never changes. */
1770
+ readonly explicit?: boolean;
1771
+ /** The frame period in milliseconds, such as 1000 / 60. The rule compares the whole GPU frame with it. */
1772
+ readonly framePeriodMs: number;
1773
+ /** The Unreal settings of the rule. Defaults are the primary dynamic resolution ones. */
1774
+ readonly rule?: Omit<IFrameTimeBudgetOptions, "periodMs">;
1775
+ /** Frames per report when nothing moves. Default 120. */
1776
+ readonly windowFrames?: number;
1777
+ /** Frames to wait before retrying a level that failed once; each further failure doubles it. Default 600. */
1778
+ readonly retryFrames?: number;
1779
+ }
1780
+ type BudgetVerdict = "over" | "within" | "under" | "unobserved";
1781
+ /** One closed window: a report every `windowFrames` frames, or earlier when the level moves. */
1782
+ interface IBudgetWindow<L extends string> {
1783
+ /** 1 for the first window the ladder closes. */
1784
+ readonly number: number;
1785
+ readonly level: L;
1786
+ /** Mean of the stage's resolved readings, or `undefined` when none resolved. */
1787
+ readonly windowMs: number | undefined;
1788
+ /** The frame period the rule compares the GPU frame with. */
1789
+ readonly periodMs: number;
1790
+ /** The period less its headroom: the frame the rule steers to. */
1791
+ readonly targetMs: number;
1792
+ /** Frames in the window. */
1793
+ readonly frames: number;
1794
+ /** Frames in the window with a resolved whole-frame reading. */
1795
+ readonly samples: number;
1796
+ /** Mean of the whole frame's readings in the window, or `undefined` when none resolved. */
1797
+ readonly frameMs: number | undefined;
1798
+ readonly verdict: BudgetVerdict;
1799
+ /** The level the ladder moved to when this window moved it. */
1800
+ readonly stepped: L | undefined;
1801
+ /** Two consecutive frames over the period moved the level without the change-period gate. */
1802
+ readonly panic: boolean;
1803
+ /** The frame was over the target but the stage could not absorb the overage even at zero cost. */
1804
+ readonly notBlamed: boolean;
1805
+ readonly explicit: boolean;
1806
+ }
1807
+
1808
+ declare class BudgetLadder<L extends string> {
1809
+ #private;
1810
+ constructor(options: IBudgetLadderOptions<L>);
1811
+ get level(): L;
1812
+ get explicit(): boolean;
1813
+ get periodMs(): number;
1814
+ get targetMs(): number;
1815
+ /**
1816
+ * Feeds one loop frame. `ms` is the stage's GPU time and `frameMs` the whole frame's; `undefined`
1817
+ * is a frame whose GPU time has not resolved. Returns the closed window on the frame that ends
1818
+ * one or moves the level, `undefined` while a window is open.
1819
+ */
1820
+ observe(ms: number | undefined, frameMs?: number): IBudgetWindow<L> | undefined;
1821
+ }
1822
+
1823
+ /**
1824
+ * The ways a game gathers bounce light, from the cheapest to the dearest. The names follow Unreal's
1825
+ * `r.Lumen.FinalGatherMethod` and the three levels of `sg.GlobalIlluminationQuality` the tiers map to.
1826
+ */
1827
+ declare const GI_METHODS: readonly ["none", "irradianceField", "screenProbeGather"];
1828
+ type GIMethod = (typeof GI_METHODS)[number];
1829
+ interface IGIBudgetReport {
1830
+ /** The method the game runs. It never changes while the game runs, as in Unreal. */
1831
+ readonly finalGatherMethod: GIMethod;
1832
+ /** Read-only: the `sg.GlobalIlluminationQuality` the method follows. */
1833
+ readonly globalIlluminationQuality: 0 | 1 | 3;
1834
+ /** The quality tier the game started at, when it named one. */
1835
+ readonly tier: string | undefined;
1836
+ /** Mean GI-stage GPU milliseconds over the window, or `undefined` when no frame resolved. */
1837
+ readonly windowMs: number | undefined;
1838
+ /** Mean whole-frame GPU milliseconds over the window. */
1839
+ readonly frameMs: number | undefined;
1840
+ /** The GI stage's share of the GPU frame, or `undefined` when either reading is missing. */
1841
+ readonly share: number | undefined;
1842
+ /** The frame period the frame is compared with. */
1843
+ readonly periodMs: number;
1844
+ /** The frame period less its headroom. */
1845
+ readonly targetMs: number;
1846
+ /** Resolved whole-frame readings in the window. */
1847
+ readonly samples: number;
1848
+ /** 1 for the first window the watcher closes, so a reader can skip the warm-up window. */
1849
+ readonly window: number;
1850
+ /** Which of the named `stages` resolved in the window. Empty when a stage name is wrong: that reads as 0 ms. */
1851
+ readonly stagesSeen: readonly string[];
1852
+ /** Every nested pass name that resolved in the window, to find the name a stage goes by. */
1853
+ readonly passes: readonly string[];
1854
+ /** `over` when the frame mean is above the target. The primary resolution scale is the lever, not the method. */
1855
+ readonly verdict: "over" | "within" | "unobserved";
1856
+ readonly reason: string;
1857
+ }
1858
+ interface IGIBudgetOptions {
1859
+ /** The method the game runs: the tier's `finalGatherMethod`. */
1860
+ readonly method: GIMethod;
1861
+ /** Names of the render passes that are GI work (three names its passes by scene, such as `SSGI`). */
1862
+ readonly stages: readonly string[];
1863
+ /** The frame period in milliseconds, such as 1000 / 60. The whole GPU frame is compared with it. */
1864
+ readonly framePeriodMs: number;
1865
+ /** The quality tier the method came from, for the report. */
1866
+ readonly tier?: string;
1867
+ /** Frames per window. Default 120. */
1868
+ readonly windowFrames?: number;
1869
+ /** Where `TN_GI` lines go. Default `console.info`. */
1870
+ readonly report?: (line: string) => void;
1871
+ /** Reads a renderer's newest stage reading. Default `stageGpuReading`; a test supplies its own. */
1872
+ readonly read?: (renderer: unknown) => IStageGpuReading | undefined;
1873
+ }
1874
+ /**
1875
+ * Reports what a game's global illumination costs against the frame period. The method holds its
1876
+ * scalability level while the game runs, as Unreal's Lumen does: no Lumen file declares a run-time
1877
+ * budget (`sg.GlobalIlluminationQuality` comes from the benchmark or the device profile). A frame
1878
+ * over its period gets cheaper through the primary resolution scale (`ResolutionScaler`), and the
1879
+ * GI pass follows the lower resolution.
1880
+ *
1881
+ * This reads the GPU time of the passes the game names, once per resolved frame. A window of frames
1882
+ * (120 by default) reports the GI share of the whole GPU frame and whether the frame fits its
1883
+ * period less 10% headroom (`FrameTimeBudget`). An adapter without timestamp queries resolves no
1884
+ * frame, so the window is reported unobserved.
1885
+ *
1886
+ * @situation global illumination costs too much on a weak GPU
1887
+ * @situation see what share of the GPU frame the bounce light takes
1888
+ * @situation quality tier for indirect lighting that follows the hardware
1889
+ * @constraint the method never changes while the game runs: the primary resolution scale is the run-time lever
1890
+ * @constraint the GPU time of a pass is read by the scene name three or the game gave it, so name every GI pass in `stages`
1891
+ * @constraint timestamp queries are needed: without them every window is unobserved
1892
+ * @alias lumen scalability
1893
+ * @alias sg.GlobalIlluminationQuality
1894
+ * @alias final gather method
1895
+ * @example
1896
+ * const gi = new GIBudget({ method: "screenProbeGather", stages: ["SSGI"], framePeriodMs: 1000 / 60 });
1897
+ * ctx.beforeRender(() => gi.observeRenderer(ctx.renderer.raw));
1898
+ */
1899
+ declare class GIBudget {
1900
+ #private;
1901
+ constructor(options: IGIBudgetOptions);
1902
+ get finalGatherMethod(): GIMethod;
1903
+ get globalIlluminationQuality(): 0 | 1 | 3;
1904
+ /** The newest closed window's report, or `undefined` before the first closes. */
1905
+ lastReport(): IGIBudgetReport | undefined;
1906
+ /**
1907
+ * Feeds one loop frame: the GI stages' GPU milliseconds and the whole frame's, or `undefined` for
1908
+ * a frame whose GPU time has not resolved. Returns the report when this frame closes a window.
1909
+ */
1910
+ observe(ms: number | undefined, frameMs?: number): IGIBudgetReport | undefined;
1911
+ /**
1912
+ * Feeds one loop frame from a renderer the frame budget instruments: the named GI passes of the
1913
+ * newest whole resolved frame, counted once however many loop frames wait for the next one.
1914
+ */
1915
+ observeRenderer(renderer: unknown): IGIBudgetReport | undefined;
1916
+ }
1917
+ /** Parses a `TN_GI` line back into its report, or `undefined` for any other line. */
1918
+ declare function readGIMarker(line: string): IGIBudgetReport | undefined;
1919
+
1920
+ /**
1921
+ * What a visualize mode shows. `off` is the finished frame; `indirectDiffuse` is the bounce light alone, the
1922
+ * counterpart of Unreal's `r.Lumen.Visualize.IndirectDiffuse`. Other GI work adds its modes here when its data exists.
1923
+ */
1924
+ declare const GI_VISUALIZE_MODES: readonly ["off", "indirectDiffuse"];
1925
+ type GIVisualizeMode = (typeof GI_VISUALIZE_MODES)[number];
1926
+ interface IGIVisualizeOptions {
1927
+ readonly mode: GIVisualizeMode;
1928
+ /** The finished frame, returned unchanged in `off` mode. */
1929
+ readonly beauty: Node<"vec4">;
1930
+ /**
1931
+ * The indirect diffuse light as the surface returns it: the gathered and cached light times the surface's own
1932
+ * albedo, in the frame's exposure. The game's chain builds it, because it owns what the chain gathers.
1933
+ */
1934
+ readonly indirectDiffuse?: Node<"vec3">;
1935
+ }
1936
+ /**
1937
+ * Shows one lighting term of a frame by itself, so a lighting difference against a reference can be told apart from a
1938
+ * scene difference. The game builds each term in its own chain and picks the mode; this class only selects, and it
1939
+ * fails when the chain did not build the term the mode needs, so a frame never claims to show a term it does not hold.
1940
+ */
1941
+ declare class GIVisualize {
1942
+ readonly mode: GIVisualizeMode;
1943
+ /** The node to output: `beauty` for `off`, the chosen term with an opaque alpha otherwise. */
1944
+ readonly node: Node<"vec4">;
1945
+ constructor(options: IGIVisualizeOptions);
1946
+ }
1947
+
1948
+ /** The shadow filter tiers, cheapest first. The game maps each one to its own sample counts. */
1949
+ declare const SHADOW_FILTER_TIERS: readonly ["low", "medium", "high"];
1950
+ type ShadowFilterTier = (typeof SHADOW_FILTER_TIERS)[number];
1951
+ /** The stage the engines name the shadow passes' GPU time by: the owned engine's shadow segment, three's `Shadow Map` passes. */
1952
+ declare const SHADOW_STAGES: readonly string[];
1953
+ interface IShadowFilterReport {
1954
+ /** The tier after this window. */
1955
+ readonly tier: ShadowFilterTier;
1956
+ /** Read-only: the `sg.ShadowQuality` the tier follows. */
1957
+ readonly shadowQuality: 0 | 1 | 3;
1958
+ /** Mean GPU milliseconds of the shadow stages over the window, or `undefined` when no frame resolved. */
1959
+ readonly windowMs: number | undefined;
1960
+ /** Mean whole-frame GPU milliseconds over the window. */
1961
+ readonly frameMs: number | undefined;
1962
+ /** The frame period the frame is compared with. */
1963
+ readonly periodMs: number;
1964
+ /** The frame period less its headroom. */
1965
+ readonly targetMs: number;
1966
+ /** Resolved whole-frame readings in the window. */
1967
+ readonly samples: number;
1968
+ /** Which of the named `stages` resolved in the window. Empty when a stage name is wrong: that reads as 0 ms. */
1969
+ readonly stagesSeen: readonly string[];
1970
+ readonly stepped: ShadowFilterTier | undefined;
1971
+ /** Two consecutive frames over the period moved the tier without the change-period gate. */
1972
+ readonly panic: boolean;
1973
+ /** The frame was over the target but the shadow passes could not absorb the overage even at zero cost. */
1974
+ readonly notBlamed: boolean;
1975
+ readonly verdict: BudgetVerdict;
1976
+ readonly explicit: boolean;
1977
+ readonly reason: string;
1978
+ }
1979
+ interface IShadowFilterBudgetOptions {
1980
+ /** The tier the game starts at: its quality tier's shadow row. */
1981
+ readonly tier: ShadowFilterTier;
1982
+ /** The game set the sample counts itself: the watcher reports and never changes them. */
1983
+ readonly explicit?: boolean;
1984
+ /** Names of the render passes that are shadow work. Default {@link SHADOW_STAGES}. */
1985
+ readonly stages?: readonly string[];
1986
+ /** The frame period in milliseconds, such as 1000 / 60. The whole GPU frame is compared with it. */
1987
+ readonly framePeriodMs: number;
1988
+ /** Frames per report when nothing moves. Default 120. */
1989
+ readonly windowFrames?: number;
1990
+ /** Called after the watcher moved the tier; the game rebuilds its filter with that tier's samples. */
1991
+ readonly onStep?: (tier: ShadowFilterTier, report: IShadowFilterReport) => void;
1992
+ /** Where `TN_SHADOW_TIER` lines go. Default `console.info`. */
1993
+ readonly report?: (line: string) => void;
1994
+ /** Reads a renderer's newest GPU reading. Default `stageGpuReading`; a test supplies its own. */
1995
+ readonly read?: (renderer: unknown) => IStageGpuReading | undefined;
1996
+ }
1997
+ /**
1998
+ * Steps a game's soft-shadow tier down when the whole GPU frame stays over the frame period, and
1999
+ * back up when the frame has room. The rule is Unreal's DynamicRenderScaling heuristic with the
2000
+ * settings of its virtual shadow map budget (`VirtualShadowMapArray.cpp:831-845`: a linear model,
2001
+ * 5% headroom, a 1% change threshold). Unreal's own budget compares the stage with a time the
2002
+ * author sets, which is off by default and depends on the GPU clock, so this one compares the
2003
+ * frame with its period. A frame that is slow for another reason keeps its shadows: the tier steps
2004
+ * only when the shadow passes could absorb the overage even at zero cost. The game owns what each
2005
+ * tier draws and rebuilds its filter on each step.
2006
+ *
2007
+ * Two frames over the period step the tier down at once. Otherwise a move waits 8 frames after the
2008
+ * last one, and a tier that failed is retried after a longer wait each time. A game that sets the
2009
+ * sample counts itself keeps them: the report says the frame is over and nothing changes. An
2010
+ * adapter without timestamp queries resolves no frame, so every window is unobserved and the tier
2011
+ * holds. Redraw cost keeps its own levers in `VirtualShadowNode`.
2012
+ *
2013
+ * @situation soft shadow filter costs too much on a weak GPU
2014
+ * @situation step the shadow quality tier when the GPU frame goes over the frame period
2015
+ * @situation shadow quality tier that follows the hardware
2016
+ * @constraint the game rebuilds its filter with the tier's sample counts on each step; this class draws nothing
2017
+ * @constraint timestamp queries are needed: without them every window is unobserved and the tier holds
2018
+ * @constraint the rule reads the whole GPU frame and the `Shadow` stage, which the receiver filter inside the colour pass is not part of
2019
+ * @override explicit: true keeps the game's own sample counts and reports an over-budget frame
2020
+ * @alias virtual shadow map scalability
2021
+ * @alias sg.ShadowQuality
2022
+ * @example
2023
+ * const filter = new ShadowFilterBudget({ tier: "high", framePeriodMs: 1000 / 60, onStep: (tier) => { light.shadow.filterNode = filterFor(tier); } });
2024
+ * ctx.beforeRender(() => filter.observeRenderer(ctx.renderer.raw));
2025
+ */
2026
+ declare class ShadowFilterBudget {
2027
+ #private;
2028
+ constructor(options: IShadowFilterBudgetOptions);
2029
+ get tier(): ShadowFilterTier;
2030
+ get shadowQuality(): 0 | 1 | 3;
2031
+ /** The newest closed window's report, or `undefined` before the first closes. */
2032
+ lastReport(): IShadowFilterReport | undefined;
2033
+ /**
2034
+ * Feeds one loop frame: the shadow stages' GPU milliseconds and the whole frame's, or `undefined`
2035
+ * for a frame whose GPU time has not resolved. Returns the report when this frame closes a window.
2036
+ */
2037
+ observe(ms: number | undefined, frameMs?: number): IShadowFilterReport | undefined;
2038
+ /**
2039
+ * Feeds one loop frame from an instrumented renderer: the named shadow stages of the newest whole
2040
+ * resolved frame, counted once however many loop frames wait for the next one.
2041
+ */
2042
+ observeRenderer(renderer: unknown): IShadowFilterReport | undefined;
2043
+ }
2044
+ /** Parses a `TN_SHADOW_TIER` line back into its report, or `undefined` for any other line. */
2045
+ declare function readShadowTierMarker(line: string): IShadowFilterReport | undefined;
2046
+
1503
2047
  /**
1504
2048
  * Where the spans attach to three's own render path.
1505
2049
  *
@@ -1546,8 +2090,9 @@ declare function installSpanProbes(target: ISpanProbeTarget, root: Object3D): ()
1546
2090
  * **The rule is derived, never a constant an author is told to revisit.** It fires when
1547
2091
  *
1548
2092
  * - the GPU used less than a third of the frame — the device is not the constraint, and
1549
- * - the JS render phase alone is longer than the display's own period — so the scene cannot make
1550
- * the display's rate even if everything else in the frame were free.
2093
+ * - the JS render phase alone, in the typical (median) frame, is longer than the display's own
2094
+ * period — so the scene cannot make the display's rate even if everything else in the frame
2095
+ * were free.
1551
2096
  *
1552
2097
  * Both numbers come from the frame meter. The display's period comes from the host's own
1553
2098
  * presentation cap where there is one, and otherwise from the frame rate the game itself declared;
@@ -1583,7 +2128,7 @@ interface ISceneWarning {
1583
2128
  readonly window: number;
1584
2129
  /** The GPU's share of the frame, as a fraction. */
1585
2130
  readonly gpuShare: number;
1586
- /** The JS render phase's mean, in milliseconds. */
2131
+ /** The JS render phase's median, in milliseconds. */
1587
2132
  readonly renderMs: number;
1588
2133
  /** The period the display works at, in milliseconds, and where that number came from. */
1589
2134
  readonly displayPeriodMs: number;
@@ -1611,8 +2156,11 @@ declare function displayPeriodMs(declaredTargetFps: number | undefined): {
1611
2156
  * Fails closed in both directions: a window whose GPU was never measured gets no verdict, because
1612
2157
  * "the GPU is idle" is a claim and an absent reading is not evidence for it; and a window with no
1613
2158
  * shape to report gets none either, because a warning that cannot say what to change is noise.
2159
+ * A software adapter gets none: its rasteriser runs inside the CPU's submit, so the render phase
2160
+ * carries the GPU's work and "the GPU is idle" is false (a 3-draw UI frame read 54 ms on
2161
+ * `Microsoft Basic Render Driver`).
1614
2162
  */
1615
- declare function sceneWarning(window: IFrameBudgetWindow, shape: ISceneShape | undefined, declaredTargetFps: number | undefined): ISceneWarning | undefined;
2163
+ declare function sceneWarning(window: IFrameBudgetWindow, shape: ISceneShape | undefined, declaredTargetFps: number | undefined, gpuClass?: string): ISceneWarning | undefined;
1616
2164
  /**
1617
2165
  * The scene's shape for one window, from the counts the frame already reported.
1618
2166
  *
@@ -1846,11 +2394,20 @@ interface IProbeVolumeOptions {
1846
2394
  };
1847
2395
  /** Probe spacing expressed as probes per world unit. */
1848
2396
  readonly density: ProbeVolumeDensity;
2397
+ /**
2398
+ * Where the atlas is rendered. `auto` (default) probes the device: a host that rejects a 3D render
2399
+ * attachment (wgpu-native) renders each slice into a 2D target and copies it into the 3D atlas,
2400
+ * and a host that accepts one renders into the atlas directly. `render3d` and `copy` force a path.
2401
+ */
2402
+ readonly atlasTarget?: "auto" | "render3d" | "copy";
1849
2403
  /** Optional device limit supplied by a host that knows it before construction. */
1850
2404
  readonly maxTextureDimension3D?: number;
1851
2405
  /** Alias for integrations that expose the WebGPU limit under a device-oriented name. */
1852
2406
  readonly deviceTextureLimit?: number;
1853
- /** Maximum wall-clock work per render phase, in milliseconds. */
2407
+ /**
2408
+ * Maximum wall-clock work per render phase, in milliseconds. A work item that outruns it fails the
2409
+ * bake, except on a CPU rasteriser (the renderer's `softwareAdapter`), where `bakeCostMs` reports it.
2410
+ */
1854
2411
  readonly bakeBudgetMs?: number;
1855
2412
  /** Additional guard that keeps a clock-less host from processing an unbounded queue. */
1856
2413
  readonly maxWorkItemsPerFrame?: number;
@@ -1915,6 +2472,8 @@ declare class ProbeVolume extends Object3D implements IComputeDriven$1 {
1915
2472
  readonly resolution: Vector3;
1916
2473
  constructor(options: IProbeVolumeOptions);
1917
2474
  get texture(): Data3DTexture;
2475
+ /** The atlas render path in use; `undefined` until the device probe settles. */
2476
+ get atlasTarget(): "render3d" | "copy" | undefined;
1918
2477
  get atlasDepth(): number;
1919
2478
  get atlasBytes(): number;
1920
2479
  get probeCount(): number;
@@ -1945,6 +2504,17 @@ declare class ProbeVolume extends Object3D implements IComputeDriven$1 {
1945
2504
  sample(position: Vector3, normal: Vector3): Vector3;
1946
2505
  sample(position: IProbePosition, normal?: Vector3 | Node<"vec3">): Vector3 | Node<"vec3">;
1947
2506
  sampleIrradiance(position: Vector3, normal: Vector3): Vector3;
2507
+ /**
2508
+ * The irradiance averaged over every normal at a point, for a surface or a sample that has no side facing the light:
2509
+ * a translucent pane (Unreal's default Volumetric NonDirectional lighting) and a fog sample (its isotropic term). It
2510
+ * is the L0 coefficient, `0.886227 * c0`, so it is the mean of `sample(position, n)` over any set of normals that
2511
+ * integrates the L2 basis, the six axes among them. It reads one atlas texel, where `sample` reads seven.
2512
+ *
2513
+ * Divide by pi for the mean radiance a fog sample scatters, and multiply by the colour for a pane: the volume owns
2514
+ * no colour.
2515
+ */
2516
+ sampleNonDirectional(position: Vector3): Vector3;
2517
+ sampleNonDirectional(position?: Node<"vec3">): Node<"vec3">;
1948
2518
  /** The GPU graph used by `sample`; exposed so generated materials can compose it explicitly. */
1949
2519
  sampleNode(position?: Node<"vec3">, normal?: Node<"vec3">): Node<"vec3">;
1950
2520
  /** Internal data seam used by unit/conformance fixtures to seed a known SH atlas without a GPU. */
@@ -1958,6 +2528,126 @@ declare class ProbeVolume extends Object3D implements IComputeDriven$1 {
1958
2528
  probePosition(ix: number, iy: number, iz: number, target?: Vector3): Vector3;
1959
2529
  }
1960
2530
 
2531
+ /**
2532
+ * The Surface Cache: what a traced global-illumination ray reads at the surface it hits (PRD-639).
2533
+ *
2534
+ * Unreal keeps a lit proxy of every mesh, the Surface Cache, and its rays read that, never the material
2535
+ * (UE 5.8.3: `Engine/Shaders/Private/Lumen/LumenSoftwareRayTracing.ush`, `SurfaceCache/LumenSurfaceCache.usf`).
2536
+ * This is the same job in texture space: the meshes already carry UVs, so a material's base colour and
2537
+ * emissive maps are reduced to one small tile each and packed into an atlas, and a hit reads the tile at its
2538
+ * UV. A material without a map keeps its flat colour. `SurfaceLights` adds the local lights at the hit.
2539
+ *
2540
+ * Mechanism only. Every colour, texture and light comes from the game's materials and lights; the cache owns none.
2541
+ */
2542
+ /** A colour channel triple in linear light, as three's `Color` holds it. */
2543
+ interface IRgb {
2544
+ readonly r: number;
2545
+ readonly g: number;
2546
+ readonly b: number;
2547
+ }
2548
+ /** The part of a three `Texture` the cache reads. `image` is an `ImageData`, an `ImageBitmap` or a canvas. */
2549
+ interface ISurfaceCacheTexture {
2550
+ readonly image?: unknown;
2551
+ /** "srgb" (three's `SRGBColorSpace`) is decoded to linear; anything else is taken as linear. */
2552
+ readonly colorSpace?: string;
2553
+ /** three's default is true; glTF textures load with false (v = 0 is the top row). */
2554
+ readonly flipY?: boolean;
2555
+ /** Wrap mode as three's constants: 1000 repeat, 1001 clamp, 1002 mirrored repeat. Default repeat. */
2556
+ readonly wrapS?: number;
2557
+ readonly wrapT?: number;
2558
+ /** three's UV transform; `updateMatrix` is called when present. */
2559
+ readonly matrix?: {
2560
+ readonly elements: ArrayLike<number>;
2561
+ };
2562
+ updateMatrix?(): void;
2563
+ }
2564
+ /** The part of a three `MeshStandardMaterial` the cache reads. */
2565
+ interface ISurfaceCacheMaterial {
2566
+ readonly name?: string;
2567
+ readonly color?: IRgb;
2568
+ readonly map?: ISurfaceCacheTexture | null;
2569
+ readonly metalness?: number;
2570
+ readonly emissive?: IRgb;
2571
+ readonly emissiveIntensity?: number;
2572
+ readonly emissiveMap?: ISurfaceCacheTexture | null;
2573
+ }
2574
+ interface ISurfaceCacheOptions {
2575
+ /** Atlas edge in texels, a power of two. Default 2048 (Unreal: 2048 at Medium, 4096 at Epic). */
2576
+ readonly atlasSize?: number;
2577
+ /** Scales the 64-texel tile a material starts from. Default 1. The atlas budget still shrinks it. */
2578
+ readonly cardTexelDensityScale?: number;
2579
+ /**
2580
+ * The pixels of a map whose own `image` carries none. The owned engine decodes a glTF's maps itself, so JS sees
2581
+ * their size and nothing else: the game hands over the image it read from the same file. Returning `undefined`
2582
+ * keeps the texture's own `image`.
2583
+ */
2584
+ readonly images?: (material: ISurfaceCacheMaterial, slot: "map" | "emissiveMap") => unknown;
2585
+ }
2586
+ interface ISurfaceCacheReport {
2587
+ readonly atlasSize: number;
2588
+ /** Bytes of the albedo and emissive atlases as 8-bit RGBA, the form a GPU upload takes. */
2589
+ readonly atlasBytes: number;
2590
+ readonly tileEdge: number;
2591
+ readonly tilesInUse: number;
2592
+ readonly mappedMaterials: number;
2593
+ readonly flatMaterials: number;
2594
+ /** Materials that have a map the cache could not use, so their hits return the flat colour. */
2595
+ readonly fallbacks: readonly {
2596
+ readonly material: string;
2597
+ readonly reason: "unreadable-image";
2598
+ /** What the image was and why it could not be read. */
2599
+ readonly detail: string;
2600
+ }[];
2601
+ }
2602
+ /**
2603
+ * A material atlas over a fixed list of materials. A hit names the material by its index in that list (the
2604
+ * trace's material table) and the UV from the triangle's barycentrics. Static, like the scene's BVH: build
2605
+ * a new one when the materials change.
2606
+ */
2607
+ declare class SurfaceCache {
2608
+ #private;
2609
+ readonly report: ISurfaceCacheReport;
2610
+ private constructor();
2611
+ static from(materials: readonly ISurfaceCacheMaterial[], options?: ISurfaceCacheOptions): SurfaceCache;
2612
+ /** Writes the diffuse albedo (linear RGB) at `u`, `v` of material `slot`: the map times the colour factor. */
2613
+ albedo(slot: number, u: number, v: number, out: number[]): number[];
2614
+ /** Writes the emitted radiance at `u`, `v`: the emissive map times the colour times the intensity. */
2615
+ emissive(slot: number, u: number, v: number, out: number[]): number[];
2616
+ }
2617
+ /** A local light, in three's units: `intensity` is candela and `distance` the cutoff (0 = none). */
2618
+ interface ISurfaceLight {
2619
+ readonly kind: "point" | "spot";
2620
+ readonly position: readonly [number, number, number];
2621
+ readonly color: readonly [number, number, number];
2622
+ readonly intensity: number;
2623
+ readonly distance: number;
2624
+ /** Spot only: unit direction the cone points along, half angle in radians, penumbra 0..1. */
2625
+ readonly direction?: readonly [number, number, number];
2626
+ readonly angle?: number;
2627
+ readonly penumbra?: number;
2628
+ }
2629
+ interface ISurfaceLightsOptions {
2630
+ /** The most lights evaluated at one hit, the brightest first. Default 8. */
2631
+ readonly maxLights?: number;
2632
+ }
2633
+ /**
2634
+ * The local lights at a hit: culled to the ones whose range reaches the point, the brightest first, capped, with
2635
+ * one shadow ray each, supplied by the caller (the bake's BVH ray, or the kernel's). Lights skipped by the cap are
2636
+ * counted in `skipped`.
2637
+ */
2638
+ declare class SurfaceLights {
2639
+ #private;
2640
+ /** Lights left out by the cap, summed over every `shade` call. */
2641
+ skipped: number;
2642
+ constructor(lights: readonly ISurfaceLight[], options?: ISurfaceLightsOptions);
2643
+ /**
2644
+ * Adds the light the hit receives to `out` (RGB, linear): albedo x colour x (intensity / pi) / d^2 x window x cos
2645
+ * (x cone for a spot). `visible(i)` answers the shadow ray to light `i`; it is not asked for a light behind the
2646
+ * surface, out of range or outside its cone.
2647
+ */
2648
+ shade(point: readonly [number, number, number], normal: readonly [number, number, number], albedo: readonly [number, number, number], out: number[], visible: (light: number) => boolean): number[];
2649
+ }
2650
+
1961
2651
  /**
1962
2652
  * Renderer-independent bookkeeping for virtual shadow pages.
1963
2653
  *
@@ -2012,7 +2702,8 @@ interface IDirectionalClipmapOptions {
2012
2702
  readonly direction: IVector3Like;
2013
2703
  /** Half-width of each level's window in world units, finest first. */
2014
2704
  readonly clipExtents: readonly number[];
2015
- readonly pagesPerAxis: number;
2705
+ /** Texels per window edge: one value for every level, or one per level finest first. */
2706
+ readonly pagesPerAxis: number | readonly number[];
2016
2707
  /**
2017
2708
  * Fraction of an extent inside which a point selects that level, `(0, 1]`, default 0.9. One value
2018
2709
  * for every level, or one per level finest first, the last entry standing in for the rest.
@@ -2025,6 +2716,15 @@ interface IDirectionalClipmapOptions {
2025
2716
  * for every level, or one per level finest first, the last entry standing in for the rest.
2026
2717
  */
2027
2718
  readonly refreshStep?: number | readonly number[];
2719
+ /**
2720
+ * The smallest ratio of a window's light-space height to its width, `(0, 1]`, default 1. A low
2721
+ * sun stretches a texel along the light's V axis by `1 / sin(elevation)` of floor, so a window
2722
+ * the same height as it is wide would make every shadow edge across the floor that much blurrier.
2723
+ * A ratio below 1 shrinks the height to `sin(elevation)`, never under this value, and the texels
2724
+ * then cover the same floor area at any sun height. A sun within 18 degrees of the zenith keeps
2725
+ * square windows. Page coordinates stay square: `v` counts pages in that shrunken height.
2726
+ */
2727
+ readonly minAspect?: number;
2028
2728
  }
2029
2729
  /**
2030
2730
  * Camera-centred clip windows in a light-space basis, snapped to whole pages.
@@ -2036,7 +2736,6 @@ interface IDirectionalClipmapOptions {
2036
2736
  declare class DirectionalClipmap {
2037
2737
  #private;
2038
2738
  readonly clipExtents: readonly number[];
2039
- readonly pagesPerAxis: number;
2040
2739
  /**
2041
2740
  * Per level, finest first; the last entry stands in for every level past it. Mutable through
2042
2741
  * {@link setRefreshStep} so a level whose own render is expensive can be stepped further, which
@@ -2049,9 +2748,12 @@ declare class DirectionalClipmap {
2049
2748
  basisU: IVector3Like;
2050
2749
  basisV: IVector3Like;
2051
2750
  basisW: IVector3Like;
2751
+ /** Window height over width: `v` is metres along `basisV` divided by this. 1 is a square window. */
2752
+ vScale: number;
2753
+ readonly minAspect: number;
2052
2754
  centerWorld: IVector3Like;
2053
2755
  centerLight: ILightSpacePoint;
2054
- constructor({ direction, clipExtents, pagesPerAxis, selectionGuard, refreshStep, }: IDirectionalClipmapOptions);
2756
+ constructor({ direction, clipExtents, pagesPerAxis, selectionGuard, refreshStep, minAspect, }: IDirectionalClipmapOptions);
2055
2757
  /** Re-orient the basis; returns true when it changed enough that cached pages are stale. */
2056
2758
  setDirection(direction: IVector3Like): boolean;
2057
2759
  project(worldPoint: IVector3Like): ILightSpacePoint;
@@ -2062,6 +2764,10 @@ declare class DirectionalClipmap {
2062
2764
  }): IVector3Like;
2063
2765
  /** Re-step one level's window: the trail its followed centre may move before it re-renders. */
2064
2766
  setRefreshStep(level: number, step: number): void;
2767
+ /** Texels per edge of `level`'s window. */
2768
+ pagesAt(level: number): number;
2769
+ /** Resize the windows (one value, or one per level); every window is placed afresh. */
2770
+ setPagesPerAxis(pagesPerAxis: number | readonly number[]): void;
2065
2771
  updateCenter(worldPoint: IVector3Like): readonly IClipWindow[];
2066
2772
  getWindow(level: number): IClipWindow;
2067
2773
  pageWorldSize(level: number): number;
@@ -2123,8 +2829,27 @@ interface IVirtualShadowOptions {
2123
2829
  * increasing. Default `[16, 48, 144]`: three windows, each three times wider than the last.
2124
2830
  */
2125
2831
  readonly clipExtents?: readonly number[];
2126
- /** Texels per level edge. Default: the light's `shadow.mapSize.width`. */
2127
- readonly mapSize?: number;
2832
+ /**
2833
+ * Resolution bias in stops, default 0. Mirrors Unreal's
2834
+ * `r.Shadow.Virtual.ResolutionLodBiasDirectional`; a quality tier sets it. With the default map
2835
+ * sizes each stop doubles every level's texel: `-1` halves it (twice the resolution), `-1.5` is
2836
+ * 2.83 times finer, a positive bias coarsens it. With an authored `mapSize` the finest window
2837
+ * scales by `2 ** bias` instead and every coarser level keeps its extent; a bias that would push
2838
+ * that window past the next level throws.
2839
+ */
2840
+ readonly resolutionLodBiasDirectional?: number;
2841
+ /**
2842
+ * Texels per level edge: one number for every level, or one per level, finest first. Default:
2843
+ * Unreal's clipmap rule, measured on the camera and viewport that first read the shadow, so a
2844
+ * receiver's texel is at most `2^(1 + bias)` of its own screen pixels (`clipmapMapSizes`). Set it to
2845
+ * hold fixed sizes.
2846
+ */
2847
+ readonly mapSize?: number | readonly number[];
2848
+ /**
2849
+ * The page budget of the default map sizes, in 128² pages over all levels, default 4096 (Unreal's
2850
+ * `r.Shadow.Virtual.MaxPhysicalPages` at Epic). Sizes over it raise the bias until they fit.
2851
+ */
2852
+ readonly maxPhysicalPages?: number;
2128
2853
  /**
2129
2854
  * Texels per edge of each level's mover map — the map tracked casters draw into every frame.
2130
2855
  * Default: `mapSize`, the cached levels' own density, so a caster keeps the edge it had at rest
@@ -2238,17 +2963,36 @@ interface IVirtualShadowOptions {
2238
2963
  * Default true; false keeps eye follow for every camera. Walking cameras keep eye follow.
2239
2964
  */
2240
2965
  readonly followViewFocus?: boolean;
2966
+ /**
2967
+ * The smallest ratio of a level's light-space height to its width, `(0, 1]`, default 1 (square levels).
2968
+ * A low sun stretches a shadow texel along the floor by `1 / sin(elevation)`. A value under 1 shrinks
2969
+ * the height to `sin(elevation)` times the width, never under this value, so a texel covers the same
2970
+ * floor area at any sun height. The costs: a wall taller than a level's height is read from a wider
2971
+ * level, a level centred on the eye holds the floor only about `eye height / tan(elevation)` from the
2972
+ * camera, and a wide filter disc (a source angle near 0.7 degrees) crosses the level's top and bottom
2973
+ * edge and leaves a lit patch in a thin shadow (PRD-634, sun 4 ramp), so it is an opt-in.
2974
+ */
2975
+ readonly minWindowAspect?: number;
2241
2976
  /** Measure receiver-plane slope across each level's texel footprint to prevent coarse acne.
2242
2977
  * Default true; false preserves only the authored bias. Custom filterNode owns its footprint.
2243
2978
  */
2244
2979
  readonly receiverPlaneBias?: boolean;
2245
2980
  /**
2246
- * Draw registered AutoLOD chains with their coarsest geometry past the finest level, default true.
2981
+ * Draw registered AutoLOD chains with a coarser rung past the finest level, default true. A level
2982
+ * takes the coarsest rung whose geometric error is within one of its texels, and never a rung
2983
+ * finer than the main pass shows; where no rung is that accurate the caster keeps its geometry.
2247
2984
  * Alpha-tested and transparent casters keep casting on every level that resolves their bounds;
2248
2985
  * dropping their whole shadow at the fine window edge loses canopy and fences.
2249
2986
  * Geometry swaps are restored before the next level, mover map and main pass.
2250
2987
  */
2251
2988
  readonly shadowLodBias?: boolean;
2989
+ /**
2990
+ * The most error, in texels of a level, that a coarser rung may have on that level, default 1.
2991
+ * A rung within a texel is as good as the full mesh at that resolution; a larger budget draws
2992
+ * fewer triangles and shows facets on a shadow's edge, and `Infinity` draws the coarsest rung on
2993
+ * every level past the finest. Read only with `shadowLodBias`.
2994
+ */
2995
+ readonly shadowLodTexels?: number;
2252
2996
  /**
2253
2997
  * Redraw only the pages an invalidation dirtied, default true. A level whose window did not move
2254
2998
  * and whose asks named under half its pages renders those rectangles alone: pages casters were
@@ -2258,8 +3002,8 @@ interface IVirtualShadowOptions {
2258
3002
  */
2259
3003
  readonly partialRedraw?: boolean;
2260
3004
  /**
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
3005
+ * Quiet frames an automatically detected mover must exceed before it goes back into the cached
3006
+ * levels, default 100 (Unreal's `FramesStaticThreshold`: it settles on quiet frame 101). A caster whose world matrix, instance matrix or
2263
3007
  * deformation changed is drawn through the mover maps without a `trackCaster` call; this is how
2264
3008
  * long it must hold still before its shadow is baked into the cache again. Positive integer.
2265
3009
  */
@@ -2444,6 +3188,7 @@ declare const VIRTUAL_SHADOW_WIDE_CASTER_LAYER = 27;
2444
3188
  * @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
2445
3189
  * @override bias, biasNode, normalBias, intensity, radius, blurSamples, mapType and filterNode stay on `light.shadow`; mapSize and the other options here have defaults
2446
3190
  * @override followViewFocus: false keeps eye follow; receiverPlaneBias: false uses only authored bias
3191
+ * @override minWindowAspect: below 1, a level is as high as `sin(sun elevation)` times its width, never under this, so a low sun's floor shadows keep the texel density of a high sun's; the default 1 keeps square levels
2447
3192
  * @example
2448
3193
  * const sun = new DirectionalLight(0xffffff, 3);
2449
3194
  * sun.castShadow = true;
@@ -2452,8 +3197,15 @@ declare const VIRTUAL_SHADOW_WIDE_CASTER_LAYER = 27;
2452
3197
  declare class VirtualShadowNode extends ShadowBaseNode {
2453
3198
  #private;
2454
3199
  static get type(): string;
2455
- readonly options: Required<Omit<IVirtualShadowOptions, "marker" | "refreshStep" | "selectionGuard" | "invalidationDelay">> & {
3200
+ readonly options: Required<Omit<IVirtualShadowOptions, "marker" | "refreshStep" | "selectionGuard" | "invalidationDelay" | "mapSize">> & {
2456
3201
  readonly markerEvery: number;
3202
+ /**
3203
+ * Texels per level edge, one per level. With `autoMapSize` the node measures them on the first
3204
+ * camera that reads the shadow; until then each level holds the light's `shadow.mapSize.width`.
3205
+ */
3206
+ readonly mapSize: readonly number[];
3207
+ /** The sizes follow Unreal's texel-per-pixel rule, because no `mapSize` was authored. */
3208
+ readonly autoMapSize: boolean;
2457
3209
  /** Per level, finest first; the last entry stands in for every level past it. */
2458
3210
  readonly refreshStep: readonly number[];
2459
3211
  /** The per-level `selectionGuard` each level's own window is drawn with. */
@@ -2527,6 +3279,209 @@ declare class VirtualShadowNode extends ShadowBaseNode {
2527
3279
  * if (stats !== undefined) console.log(stats.reuseRatio);
2528
3280
  */
2529
3281
  declare function readVirtualShadowMarker(line: string): IVirtualShadowStats | undefined;
3282
+ /**
3283
+ * One frame's shadow passes on the owned engine with the spot and point light maps apart from the
3284
+ * sun's (PRD-650). The sun's draws and the lamps' add up to every shadow draw the renderer submitted.
3285
+ */
3286
+ interface ILampShadowStats {
3287
+ readonly frame: number;
3288
+ readonly shadowDraws: number;
3289
+ /** The sun's maps: its virtual levels or its plain map. `gpuMs` is -1 until a GPU sample resolves. */
3290
+ readonly sun: {
3291
+ readonly draws: number;
3292
+ readonly gpuMs: number;
3293
+ };
3294
+ /** The lamp maps the frame redrew (a cube's six faces are one), their draws, and their GPU time. */
3295
+ readonly lamps: {
3296
+ readonly redraws: number;
3297
+ readonly draws: number;
3298
+ readonly gpuMs: number;
3299
+ };
3300
+ }
3301
+ declare const LAMP_SHADOW_MARKER = "TN_LAMP_SHADOW";
3302
+ interface ILampShadowCounters {
3303
+ readonly lampRedraws: number;
3304
+ readonly lampDraws: number;
3305
+ readonly shadowDraws: number;
3306
+ readonly sunGpuMs: number;
3307
+ readonly lampGpuMs: number;
3308
+ }
3309
+ /**
3310
+ * The `TN_LAMP_SHADOW` line for the renderer's last frame, or `undefined` on a renderer that keeps
3311
+ * no lamp counters (three's own).
3312
+ *
3313
+ * @situation log lamp shadow redraws and GPU time apart from the sun's on the owned engine
3314
+ * @constraint counters that do not add up to the frame's shadow draws throw TN_LAMP_SHADOW_INVALID
3315
+ * @example
3316
+ * const line = lampShadowMarker(renderer, frame);
3317
+ * if (line !== undefined) console.info(line);
3318
+ */
3319
+ declare function lampShadowMarker(renderer: {
3320
+ readonly info?: {
3321
+ readonly engine?: {
3322
+ readonly shadows?: ILampShadowCounters;
3323
+ };
3324
+ };
3325
+ }, frame: number): string | undefined;
3326
+ /**
3327
+ * Parse a `TN_LAMP_SHADOW` line back into its stats, or `undefined`.
3328
+ *
3329
+ * @situation count lamp shadow redraws from a renderer log, for example a moving-caster run
3330
+ * @constraint non-marker lines and markers whose sun and lamp draws do not add up return `undefined`
3331
+ * @example
3332
+ * const stats = readLampShadowMarker(line);
3333
+ * if (stats !== undefined) console.log(stats.lamps.redraws);
3334
+ */
3335
+ declare function readLampShadowMarker(line: string): ILampShadowStats | undefined;
3336
+
3337
+ declare module "three" {
3338
+ interface Material {
3339
+ /**
3340
+ * Unreal's Two Sided Foliage shading model (PRD-651). The receiver looks its shadow up where it
3341
+ * stands, without the normal bias, and sees a sun of at least 5 degrees. The default is off: a
3342
+ * card with two sides and a cut is a default lit material in Unreal, and keeps the normal bias.
3343
+ */
3344
+ twoSidedFoliage?: boolean;
3345
+ }
3346
+ }
3347
+ /** World-space gap to UV radius; sourceAngleRad is in radians, in [0, PI/2). */
3348
+ declare function penumbraUv(gapMetres: number, sourceAngleRad: number, frustumWidthMetres: number, mapSize: number): number;
3349
+ interface ISourceAngleShadowOptions {
3350
+ /** Required game-owned angular radius in radians, in [0, PI/2). No default. */
3351
+ sourceAngleRad: number;
3352
+ /** Fixed sample count, integer 1–64; default 16. Recreate the filter to change it. */
3353
+ blockerSamples?: number;
3354
+ /** Fixed sample count, integer 1–64; default 16. */
3355
+ filterSamples?: number;
3356
+ /**
3357
+ * The receiver's own pixel, this many times over, blurs the edge on top of the source angle (the two add as
3358
+ * the blur of two independent sources), so a contact edge is not a one-texel step that crawls as the camera
3359
+ * moves. Unreal's sharpest sun-shadow edge is about a pixel wide (its texel dither and temporal resolve).
3360
+ * Finite, in [0, 16]; default 0, which leaves the source angle alone.
3361
+ */
3362
+ minPenumbraPixels?: number;
3363
+ /**
3364
+ * Unreal's shadow-map ray samples (`r.Shadow.Virtual.SMRT.SamplesPerRayDirectional`, 4 at Epic): the edge
3365
+ * spreads from the caster gap that the ray test sees (`shadowRayOccluderGap`). Integer 0–64; default 4.
3366
+ * 0 is the override that spreads the edge by the full geometric gap.
3367
+ */
3368
+ samplesPerRay?: number;
3369
+ /** The ray's length over the receiver's view distance (`r.Shadow.Virtual.SMRT.RayLengthScaleDirectional`); default 1.5. */
3370
+ rayLengthScale?: number;
3371
+ }
3372
+ /** The object passed by three r185 ShadowNode.setupShadowFilter. */
3373
+ interface ISourceAngleShadowInputs {
3374
+ depthTexture: DepthTexture;
3375
+ shadowCoord: Node<"vec3">;
3376
+ shadow: LightShadow;
3377
+ depthLayer?: number;
3378
+ }
3379
+ /**
3380
+ * Blocker search followed by variable-radius PCF for orthographic directional shadows.
3381
+ * Camera bounds, zoom, near/far and mapSize are live references. Use a depth shadow map,
3382
+ * not VSM. Both ordinary and reversed depth comparisons are supported.
3383
+ * Ideas only: Unreal Engine/Shaders/Private/ShadowPercentageCloserFiltering.ush,
3384
+ * DirectionalPCSS (blocker average and source-angle gap); independently written TSL.
3385
+ */
3386
+ declare function sourceAngleShadowFilter({ sourceAngleRad, blockerSamples, filterSamples, minPenumbraPixels, samplesPerRay, rayLengthScale, }: ISourceAngleShadowOptions): (inputs: ISourceAngleShadowInputs) => Node<"float">;
3387
+ /**
3388
+ * A lamp's penumbra radius in tangent units (offset over distance) at the receiver: the disk of
3389
+ * `sourceRadius` metres seen past a blocker at `blockerDistance` from a receiver at `receiverDistance`.
3390
+ * Times the receiver distance it is the penumbra's world radius, linear in the caster gap and the radius.
3391
+ */
3392
+ declare function lampPenumbraTangent(sourceRadius: number, blockerDistance: number, receiverDistance: number): number;
3393
+ interface ISourceRadiusShadowOptions {
3394
+ /** Required game-owned lamp radius in metres (Unreal's SourceRadius); 0 is one hard tap. */
3395
+ sourceRadius: number;
3396
+ /** Fixed sample count, integer 1–64; default 16. Recreate the filter to change it. */
3397
+ blockerSamples?: number;
3398
+ /** Fixed sample count, integer 1–64; default 16. */
3399
+ filterSamples?: number;
3400
+ /**
3401
+ * The share of the geometric penumbra the lamp keeps, in (0, 4]; default `LAMP_PENUMBRA_SCALE`.
3402
+ * 1 is the width a disk lamp throws; Unreal's shadow-map ray test samples each ray a few times and
3403
+ * resolves about 0.6 of it at its Epic counts.
3404
+ */
3405
+ penumbraScale?: number;
3406
+ }
3407
+ /** A spot light's filter inputs (ShadowNode), or a point light's (PointShadowNode: `bd3D`, `dp`). */
3408
+ interface ISourceRadiusShadowInputs extends ISourceAngleShadowInputs {
3409
+ bd3D?: Node<"vec3">;
3410
+ dp?: Node<"float">;
3411
+ }
3412
+ /**
3413
+ * Blocker search followed by variable-radius PCF for a spot light's map or a point light's cube: the
3414
+ * penumbra is `penumbraScale * lampPenumbraTangent` at the average blocker that shades the receiver, at
3415
+ * least half a texel. The search runs `blockerPasses` times: the nearest blocker in a cone has the widest
3416
+ * penumbra and every blocker that shades the receiver lies inside it, so the cone shrinks to that penumbra;
3417
+ * the last cone averages only the blockers whose own penumbra reaches the receiver, so a volume's far
3418
+ * faces, a wall's own texels and a nearer object off to the side never pull the width. A texel is a blocker
3419
+ * only when it is nearer than the receiver's own plane (read from the screen derivatives), so a tilted wall
3420
+ * that the lamp sees nearer on one side never shades itself, and the filter compares each tap against
3421
+ * that plane too. The receiver's own ray is a tap of every cone and always counts when it is blocked, since
3422
+ * it lies inside the lamp's disk: a back-face map stores a box's far face within centimetres of the floor
3423
+ * behind it, and a thin rod falls between the taps. A receiver no blocker reaches is lit. Distances are
3424
+ * along the receiver's ray, so a cube's faces agree: a face stores the depth along its own axis.
3425
+ * The spot map reads raw depth like `sourceAngleShadowFilter`. A cube has no integer load in WGSL and
3426
+ * three r185 gives a depth texture one sampler, so the point light's search compares each tap at four
3427
+ * depths between the light and the plane and takes the blocker from the step where it turns dark.
3428
+ * Ideas only: Unreal VirtualShadowMapProjectionSpot.ush (rays in a cone of SourceRadius / distance);
3429
+ * independently written TSL. The owned engine reads the cube's raw depths instead.
3430
+ */
3431
+ declare function sourceRadiusShadowFilter({ sourceRadius, blockerSamples, filterSamples, penumbraScale, }: ISourceRadiusShadowOptions): (inputs: ISourceRadiusShadowInputs) => Node<"float">;
3432
+
3433
+ declare module "three" {
3434
+ interface Material {
3435
+ /**
3436
+ * The colour a Two Sided Foliage leaf returns from light that reaches its other face (PRD-643). Unreal's
3437
+ * `SubsurfaceColor`. Read only where `twoSidedFoliage` is true: a material without it gets no back term
3438
+ * and lets no sun through.
3439
+ */
3440
+ subsurfaceColor?: Color;
3441
+ /**
3442
+ * Marks a Two Sided Foliage leaf (PRD-651). Declared here too, with the type that soft-shadow.ts gives it, so that a
3443
+ * declaration build whose entry reaches this file through `renderer.ts` and not through `soft-shadow.ts` still sees it.
3444
+ */
3445
+ twoSidedFoliage?: boolean;
3446
+ }
3447
+ }
3448
+ /**
3449
+ * The light a Two Sided Foliage leaf takes through its back face: `subsurfaceColor` times the irradiance
3450
+ * (E / pi, the unit of `irradianceNode`) that arrives along the opposite of the normal the viewer sees.
3451
+ * Unreal adds the same product to the diffuse indirect light at Epic and Cinematic gather quality
3452
+ * (UE 5.8.3: `Engine/Shaders/Private/DiffuseIndirectComposite.usf`, the `SHADINGMODELID_TWOSIDED_FOLIAGE` branch).
3453
+ * The game reads its own cache along `normal.negate()` and passes the result; this adds it to the material's
3454
+ * `emissiveNode`, which both engines evaluate, so the leaf keeps its colours and the engine owns none of them.
3455
+ * @situation add bounce light to the far face of a two sided foliage leaf
3456
+ * @constraint the material needs `twoSidedFoliage = true` and a `subsurfaceColor`, or nothing is added and false is returned; backIrradiance is a vec3 node in the unit of `irradianceNode`; call once per material
3457
+ * @example addFoliageBackLight(leaf, cache.irradianceAt(positionWorld, normalWorld.negate()));
3458
+ */
3459
+ declare function addFoliageBackLight(material: Material, backIrradiance: Node<"vec3">): boolean;
3460
+
3461
+ declare module "three" {
3462
+ interface Material {
3463
+ /**
3464
+ * Unreal's Substrate rough diffuse, the EON model (PRD-653): direct light shades the diffuse lobe of a
3465
+ * standard or physical material with EON where three shades Lambert. The default is off. Indirect light
3466
+ * stays Lambert, and a material changed after its first draw needs `needsUpdate`.
3467
+ */
3468
+ roughDiffuse?: boolean;
3469
+ }
3470
+ interface PointLight {
3471
+ /** Unreal's Source Radius in metres: how large the lamp is. A rough diffuse surface blends back to Lambert at 20 cm. */
3472
+ sourceRadius?: number;
3473
+ }
3474
+ interface SpotLight {
3475
+ /** Unreal's Source Radius in metres, as on PointLight. */
3476
+ sourceRadius?: number;
3477
+ }
3478
+ }
3479
+ /**
3480
+ * Shades every standard and physical material under `root` the way Unreal's Substrate does a rough surface: direct light
3481
+ * meets the diffuse lobe with the EON model, not Lambert. Returns how many materials changed. `enabled: false` puts Lambert
3482
+ * back. The owned engine reads `material.roughDiffuse` itself; on three's own WebGPU renderer this also installs the hook.
3483
+ */
3484
+ declare function useRoughDiffuse(root: Object3D, enabled?: boolean): number;
2530
3485
 
2531
3486
  /** Every value is the game's: this rig wires them and chooses none. */
2532
3487
  interface IDaylightOptions {
@@ -2613,6 +3568,746 @@ declare class Daylight extends Group implements IComputeDriven$1 {
2613
3568
  detach(): void;
2614
3569
  }
2615
3570
 
3571
+ interface IFilmicCurve {
3572
+ readonly slope: number;
3573
+ readonly toe: number;
3574
+ readonly shoulder: number;
3575
+ readonly blackClip: number;
3576
+ readonly whiteClip: number;
3577
+ readonly blueCorrection: number;
3578
+ /**
3579
+ * Unreal's "Expand Gamut" (1 in a fresh project, `Engine/Source/Runtime/Engine/Private/Scene.cpp:437`): bright,
3580
+ * saturated colour is pushed toward a wider gamut before the blue correction and the curve. 0 turns it off.
3581
+ * Unreal's linear EXR frames are taken after this step (`Engine/Shaders/Private/PostProcessCombineLUTs.usf`,
3582
+ * the expansion runs before the output-device branches), so a curve applied to an Unreal EXR needs 0 here.
3583
+ */
3584
+ readonly expandGamut: number;
3585
+ /**
3586
+ * The ACES reference rendering's glow, which Unreal keeps in its filmic curve (`Engine/Shaders/Private/TonemapCommon.ush`):
3587
+ * dark, saturated colour gets up to 5% brighter. 1 is Unreal's amount, 0 turns it off.
3588
+ */
3589
+ readonly glow: number;
3590
+ /**
3591
+ * The ACES reference rendering's red modifier, also in Unreal's filmic curve: the red of a saturated red is pulled
3592
+ * toward a dark pivot, up to 18%. 1 is Unreal's amount, 0 turns it off.
3593
+ */
3594
+ readonly redModifier: number;
3595
+ /**
3596
+ * Output dither in 8-bit steps: triangular grain added to the display colour before the backbuffer rounds it.
3597
+ * Unreal 5.8.3 uses one step for an 8-bit backbuffer, so a dim gradient reads as grain of one level instead of
3598
+ * contour bands. 0 turns it off. Only the tone-mapping node dithers; `filmicToneMap()` stays noise-free.
3599
+ */
3600
+ readonly dither: number;
3601
+ /**
3602
+ * The largest scene-linear value, after exposure, that one channel can hold when the colour goes into Unreal's
3603
+ * colour LUT (the top of its 14-stop log shaper, `Engine/Shaders/Private/GammaCorrectionCommon.ush`: `LogToLin(1)`
3604
+ * minus `LogToLin(0)`). A channel above it is clipped there, so the sun disc and a hot emitter lose their hue
3605
+ * earlier than an unbounded curve would. 0, the default, leaves the channel unbounded; pass `LUT_CLIP` for Unreal's.
3606
+ */
3607
+ readonly lutClip: number;
3608
+ }
3609
+ /** Red, green, blue and a master factor, as Unreal's colour grading panel shows each control. */
3610
+ type Vec4$1 = readonly [number, number, number, number];
3611
+ /** One set of Unreal's colour grading controls. */
3612
+ interface IGradeControls {
3613
+ readonly saturation: Vec4$1;
3614
+ readonly contrast: Vec4$1;
3615
+ readonly gamma: Vec4$1;
3616
+ readonly gain: Vec4$1;
3617
+ readonly offset: Vec4$1;
3618
+ }
3619
+ /**
3620
+ * Unreal's colour grading and white balance, run in the combined LUT before the film curve
3621
+ * (`Engine/Shaders/Private/PostProcessCombineLUTs.usf:88-140` and `:369-403`; defaults in
3622
+ * `Engine/Source/Runtime/Engine/Private/Scene.cpp:405-433`). Every default below is Unreal's, and at the
3623
+ * defaults none of it costs a shader instruction.
3624
+ */
3625
+ interface IColorGrade {
3626
+ /** Kelvin, 1500 to 15000. 6500 with tint 0 is a no-op. */
3627
+ readonly whiteTemp: number;
3628
+ /** -1 to 1 along the isotherm. */
3629
+ readonly whiteTint: number;
3630
+ /**
3631
+ * `"whiteBalance"`: the temperature is the light the scene was lit by, and it turns neutral.
3632
+ * `"colorTemperature"`: neutral turns into that temperature.
3633
+ */
3634
+ readonly temperatureMode: "whiteBalance" | "colorTemperature";
3635
+ /** 1 is the full film curve, 0 the graded colour with no curve. */
3636
+ readonly toneCurveAmount: number;
3637
+ /** Applied to every pixel, and combined with each range below. */
3638
+ readonly global: IGradeControls;
3639
+ readonly shadows: IGradeControls;
3640
+ readonly midtones: IGradeControls;
3641
+ readonly highlights: IGradeControls;
3642
+ /** Luma (AP1) up to which the shadows range has full weight, fading out by here. */
3643
+ readonly shadowsMax: number;
3644
+ /** Luma where the highlights range starts and where it has full weight. */
3645
+ readonly highlightsMin: number;
3646
+ readonly highlightsMax: number;
3647
+ }
3648
+ type RangeName = "global" | "shadows" | "midtones" | "highlights";
3649
+ /** What a game passes: any field, and any control of a range. */
3650
+ type ColorGradeOptions = {
3651
+ readonly [K in keyof IColorGrade]?: K extends RangeName ? Partial<IGradeControls> : IColorGrade[K];
3652
+ };
3653
+ /**
3654
+ * Registers the curve with a WebGPU renderer and returns the tone-mapping constant to assign.
3655
+ * A renderer without a node library (the WebGL fallback) keeps ACES and says so.
3656
+ */
3657
+ declare function installFilmicToneMapping(raw: unknown, c?: IFilmicCurve, grade?: IColorGrade): number | undefined;
3658
+
3659
+ interface IExposureSettings {
3660
+ enabled: boolean;
3661
+ /** Middle-grey target; increase to brighten the metered subject. */
3662
+ key: number;
3663
+ /** Exposure limits in stops. Expand only if the scene needs more range. */
3664
+ minStops: number;
3665
+ maxStops: number;
3666
+ /**
3667
+ * Percent of metered weight, dark to bright, ignored at each end of the histogram.
3668
+ * Raise highPercent's gap (lower it) when a large bright backdrop still sets the exposure.
3669
+ */
3670
+ lowPercent: number;
3671
+ highPercent: number;
3672
+ /** Exponential response per second in log2 space. Up opens the eye; down squints. */
3673
+ rateUp: number;
3674
+ rateDown: number;
3675
+ /** Stop error where cut acceleration begins / reaches its authored maximum. */
3676
+ snapLo: number;
3677
+ snapHi: number;
3678
+ snapGain: number;
3679
+ /**
3680
+ * Seed for reset(value). The first frame and reset() without a value adopt the measured target.
3681
+ */
3682
+ initialExposure: number;
3683
+ settleStops: number;
3684
+ /**
3685
+ * Limit catch-up after a suspended frame, avoiding an unrequested cut. A frame the renderer's
3686
+ * gate declined is not a suspension: the drawn frame already spans that time, so it is spent.
3687
+ */
3688
+ maxDelta: number;
3689
+ /** Readback/marker cadence in seconds. Metering still runs on every drawn frame. */
3690
+ reportInterval: number;
3691
+ }
3692
+ declare const exposureSettings: Readonly<IExposureSettings>;
3693
+
3694
+ type ColourTexture = ReturnType<typeof texture>;
3695
+ type Meter = (colour: Node<"vec4">, uv: Node<"vec2">) => Node<"vec2">;
3696
+ type Decode = (mean: Node<"float">) => Node<"float">;
3697
+
3698
+ /** Owns scratch targets only. Never draws the world or installs another output transform. */
3699
+ declare class AutoExposureNode extends TempNode<"float"> {
3700
+ #private;
3701
+ static get type(): string;
3702
+ readonly input: ColourTexture;
3703
+ readonly settings: Readonly<IExposureSettings>;
3704
+ constructor(input: ColourTexture, settings: IExposureSettings, constantExposure: number, meter?: Meter, decode?: Decode);
3705
+ setup(builder: NodeBuilder): Node<"float">;
3706
+ get exposureNode(): Node<"float">;
3707
+ reset(exposure?: number): void;
3708
+ setEnabled(enabled: boolean): void;
3709
+ /**
3710
+ * Exposure compensation in stops over the metered key, live: Unreal's AutoExposureBias
3711
+ * (UE 5.8.3: Engine/Source/Runtime/Engine/Classes/Engine/Scene.h:1933), which post-process
3712
+ * volumes blend at run time. Unreal applies 2^bias outside the smoothing
3713
+ * (Engine/Shaders/Private/PostProcessEyeAdaptation.usf:179); here it moves the goal, so a change
3714
+ * adapts at `rateUp`/`rateDown` and the reported exposure includes it.
3715
+ */
3716
+ setExposureBias(stops: number): void;
3717
+ getObservation(): Record<string, unknown>;
3718
+ updateBefore(frame: NodeFrame): undefined;
3719
+ dispose(): void;
3720
+ }
3721
+
3722
+ /** Godot's `Viewport.screen_space_aa`: which post-process antialiasing smooths the frame's edges. */
3723
+ type ScreenSpaceAA = "smaa" | "fxaa" | "disabled";
3724
+ /**
3725
+ * Godot's `Environment.tonemap_mode`: the modes Three.js ships, plus `filmic`, the Unreal 5
3726
+ * default curve written in `tonemap.ts`.
3727
+ */
3728
+ type TonemapMode = "aces" | "agx" | "filmic" | "neutral";
3729
+ /**
3730
+ * SSGI sample budget. The three tiers are the presets SSGINode's own documentation
3731
+ * recommends for the temporally-filtered case, not numbers invented here. An unknown
3732
+ * tier throws rather than quietly becoming the default.
3733
+ */
3734
+ type SsgiQuality = "low" | "medium" | "high" | "epic";
3735
+ interface IWorldEnvironmentOptions {
3736
+ /** World-pass MSAA samples. Omit to inherit the renderer; 0 leaves post AA in charge. */
3737
+ readonly samples?: number;
3738
+ /**
3739
+ * How bounce light reaches a pixel, Unreal's `r.Lumen.FinalGatherMethod` by the quality tier's name
3740
+ * (`giPreset`). The screen-space gather runs only for `screenProbeGather`; the world cache is
3741
+ * installed by the scene (`giCache.ts`) for `irradianceField` and `screenProbeGather`. Omit it and
3742
+ * the harness layer decides.
3743
+ */
3744
+ readonly finalGatherMethod?: "none" | "irradianceField" | "screenProbeGather";
3745
+ /** Screen-space indirect diffuse light. Godot calls this `ssil_enabled`. */
3746
+ readonly ssgiEnabled?: boolean;
3747
+ readonly ssgiQuality?: SsgiQuality;
3748
+ /** How much of the gathered indirect light reaches the frame. Godot's `ssil_intensity`. */
3749
+ readonly ssgiIntensity?: number;
3750
+ /** How far, in world units, indirect light is gathered from. Room scale, not contact scale. */
3751
+ readonly ssgiRadius?: number;
3752
+ /** Screen-space reflections. Godot's `ssr_enabled`. */
3753
+ readonly ssrEnabled?: boolean;
3754
+ /**
3755
+ * How far, in world units, a reflection ray is traced.
3756
+ *
3757
+ * `SSRNode` defaults this to **1**, which is one metre. On any scene larger than a
3758
+ * tabletop that reads as "screen-space reflections are on and do nothing" — the ray
3759
+ * terminates before it reaches the thing that should be standing in the floor.
3760
+ */
3761
+ readonly ssrMaxDistance?: number;
3762
+ /**
3763
+ * Fraction of the display resolution the reflection is traced at.
3764
+ *
3765
+ * A reflection in a rough surface carries almost no high-frequency detail, so tracing it
3766
+ * at half resolution costs a quarter of the rays and is very hard to see in the result.
3767
+ */
3768
+ readonly ssrResolutionScale?: number;
3769
+ /**
3770
+ * The most steps one reflection ray marches. Defaults to Unreal's count for the render chain
3771
+ * tier (`RENDER_CHAIN_TIERS`: 32 on high, 16 on medium, 8 on low). Fewer steps cost less and
3772
+ * step over thin objects sooner.
3773
+ */
3774
+ readonly ssrMaxSteps?: number;
3775
+ /** Spatial denoise over the SSGI result. Off is noisier and cheaper. */
3776
+ readonly denoiseEnabled?: boolean;
3777
+ /** The SSGI denoise's reach in gather pixels; omit for DenoiseNode's 5. A half-resolution gather wants more. */
3778
+ readonly ssgiDenoiseRadius?: number;
3779
+ /**
3780
+ * Gather the SSGI with screen probes (one per 16 x 16 pixels, an 8 x 8 octahedron of rays each) instead of per-pixel
3781
+ * rays: Unreal's ScreenProbeGather at its Epic settings (PRD-640). Owned engine only; elsewhere the per-pixel gather runs.
3782
+ */
3783
+ readonly ssgiScreenProbes?: boolean;
3784
+ /** Shows one lighting term alone (`GIVisualize`); `off` draws the finished frame. Needs the gather (`ssgiEnabled`). */
3785
+ readonly giVisualize?: GIVisualizeMode;
3786
+ /** Screen probes only: 0 keeps every probe's rays on the same octahedron, 1 (default) offsets them per probe. */
3787
+ readonly ssgiProbeJitter?: number;
3788
+ /** Screen probes only: rays on a side of each probe's octahedron. Omit for 8 (Unreal's real-time Epic; its cinematic setting is 16). */
3789
+ readonly ssgiProbeRays?: number;
3790
+ /** Screen probes only, diagnosis: 1 draws the probes' weight and trust, 2 the sign of the gathered delta. */
3791
+ readonly ssgiProbeDebug?: number;
3792
+ /**
3793
+ * Diagnosis, owned engine only: label one pass group as the `SSGI` GPU stage and leave the others in the frame, so
3794
+ * `info.engine.gpuStages.SSGI` times that group alone (`trace`, `filter`, `gather` of the screen probes, or the chain's
3795
+ * `denoise`). Omit to time every GI pass.
3796
+ */
3797
+ readonly ssgiTimedPass?: "trace" | "filter" | "gather" | "denoise";
3798
+ /**
3799
+ * Denoise passes over the SSGI gather, each turning the tap pattern by its index. The default is the render chain
3800
+ * tier's `denoiseIterations` (high 3, medium 2, low 1): one pass left the sunlit room's walls grainy at `high`.
3801
+ */
3802
+ readonly giDenoisePasses?: number;
3803
+ /** Raymarched shafts. Needs `godraysLight`, and that light must cast shadows. */
3804
+ readonly godraysEnabled?: boolean;
3805
+ /** How dense the participating medium is. Higher is foggier — and the whole frame brighter. */
3806
+ readonly godraysDensity?: number;
3807
+ /**
3808
+ * Haze below this value is discarded instead of added to the frame.
3809
+ *
3810
+ * Without it the pass is a uniform brightener rather than a shaft renderer: it returns a
3811
+ * non-zero value for nearly every pixel, and that "something" is tiny in linear space and
3812
+ * enormous after the tone curve, which lifts shadows hardest. Subtracting a floor keeps
3813
+ * the air inside a real beam and discards the ambient lift.
3814
+ */
3815
+ readonly godraysFloor?: number;
3816
+ /** Multiplier applied after the floor, so beams can be bright without the haze returning. */
3817
+ readonly godraysIntensity?: number;
3818
+ /**
3819
+ * Raymarch steps per pixel. `GodraysNode` defaults to 60.
3820
+ *
3821
+ * Every step is a shadow-map sample, so this multiplies directly into the cost of the
3822
+ * whole pass. The pass jitters its sample positions, so a lower count trades a hard shaft
3823
+ * edge for a slightly noisier one rather than for banding — which the denoiser then
3824
+ * largely absorbs.
3825
+ */
3826
+ readonly godraysSteps?: number;
3827
+ /**
3828
+ * Ceiling on shaft brightness.
3829
+ *
3830
+ * This is also the single strongest control over how bright the *whole* scene looks: the
3831
+ * pass adds its accumulated illumination to every pixel, not only to the pixels inside a
3832
+ * visible beam, so raising it raises the shadow floor of the entire frame.
3833
+ */
3834
+ readonly godraysMaxDensity?: number;
3835
+ /**
3836
+ * Ground-truth ambient occlusion, at contact scale. Godot's `ssao_enabled`.
3837
+ *
3838
+ * Deliberately a *second* occlusion term next to the one SSGI already produces. SSGI's AO
3839
+ * is gathered over `ssgiRadius` — metres — the right scale for "this hall is enclosed"
3840
+ * and the wrong one for "this foot is standing on this floor". This pass runs at a radius
3841
+ * of centimetres and multiplies on top.
3842
+ */
3843
+ readonly gtaoEnabled?: boolean;
3844
+ /**
3845
+ * Occlusion gather radius in world units, a named override. Left out, the radius follows Unreal's rule
3846
+ * instead: a fixed reach on the screen (`gtaoReachPx`), so a contact is as wide at any distance.
3847
+ */
3848
+ readonly gtaoRadius?: number;
3849
+ /** Screen reach of the occlusion in pixels at the display height when `gtaoRadius` is not set. Unreal's is 32. */
3850
+ readonly gtaoReachPx?: number;
3851
+ /** Exponent on the occlusion term: higher is a darker, tighter contact. */
3852
+ readonly gtaoScale?: number;
3853
+ /** Directions sampled per pixel. Cost is linear in this. */
3854
+ readonly gtaoSamples?: number;
3855
+ /** Spacing of the samples along a direction: 1 is even, 2 packs them near the pixel, as Unreal's horizon search does. */
3856
+ readonly gtaoDistanceExponent?: number;
3857
+ /** 0 weighs every sample alike, 1 (the node's default) weighs far samples less. */
3858
+ readonly gtaoDistanceFalloff?: number;
3859
+ /** Depth difference in world units beyond which a sample is no occluder. */
3860
+ readonly gtaoThickness?: number;
3861
+ /** The occlusion denoise's reach in pixels (DenoiseNode's 5 when omitted); 0 leaves the occlusion raw. */
3862
+ readonly gtaoDenoiseRadius?: number;
3863
+ /**
3864
+ * The albedo cap of the occlusion's multi-bounce: pale surfaces keep more of the light a crease blocks. Unreal's is
3865
+ * 0.5 (`MaxMultibounceAlbedo`); 0 leaves the occlusion as GTAO computed it. Applies where the cache holds the
3866
+ * indirect light.
3867
+ */
3868
+ readonly gtaoMultiBounceAlbedo?: number;
3869
+ /**
3870
+ * Where the cache holds the indirect light, only that share takes the occlusion (Unreal's AO darkens indirect light
3871
+ * only). `false` is the named override: the whole frame takes the occlusion, as an engine without a cache does.
3872
+ */
3873
+ readonly gtaoIndirectOnly?: boolean;
3874
+ /** Fraction of display resolution the occlusion is traced at. */
3875
+ readonly gtaoResolutionScale?: number;
3876
+ /**
3877
+ * The fraction of the frame SSGI actually gathers at. Half by default.
3878
+ *
3879
+ * `GTAONode` and `SSRNode` both carry a `resolutionScale` of their own; **`SSGINode` does not**,
3880
+ * and its `setSize` passes width and height straight into its render target with no factor. So
3881
+ * screen-space GI — a low-frequency effect every production renderer gathers at half or quarter
3882
+ * res — was the only stage in this chain running at full resolution, and it cost accordingly.
3883
+ *
3884
+ * Measured on a 46,190-instance forest at 1600x900 on an RTX 2080, with the resolution scaler
3885
+ * left on auto so the engine's own verdict is part of the result:
3886
+ *
3887
+ * fps still/walk scale it settled on interior median dead shadow
3888
+ * full res 38.0 / 47.2 0.44 704x396 0.0299 19.19%
3889
+ * off 60.0 / 60.0 0.61 976x549 0.0987 4.54%
3890
+ * half res 59.8 / 60.0 0.72 1152x648 0.0301 18.58%
3891
+ *
3892
+ * Half res is better than both: it holds the budget like switching SSGI off, keeps the look
3893
+ * within noise of full res, and produces the *sharpest* frame of the three — because the budget
3894
+ * it hands back is spent by the scaler on pixels rather than on a gather nobody can see at full
3895
+ * rate. Full-res SSGI was not buying quality, it was trading it.
3896
+ *
3897
+ * Fixed without touching three: `setSize` is public and the pass drives the node through it with
3898
+ * the full frame size, so the instance is wrapped to hand it a smaller one. The node's own maths
3899
+ * reads the `_resolution` uniform that `setSize` writes, so it stays self-consistent, and the
3900
+ * result is sampled by UV rather than by texel — which is what makes the upsample free and is
3901
+ * exactly the mechanism `GTAONode` uses internally.
3902
+ */
3903
+ readonly ssgiResolutionScale?: number;
3904
+ /**
3905
+ * Contrast-adaptive sharpening (RCAS) over the finished frame.
3906
+ *
3907
+ * Everything upstream of it blurs: the GI gather is denoised, the reflection is traced at
3908
+ * reduced resolution and roughness-blurred. Each is worth its softness on its own and the
3909
+ * sum is a frame with no micro-detail left. RCAS is contrast-adaptive, so it puts the
3910
+ * edges back without ringing the soft areas.
3911
+ */
3912
+ readonly sharpenEnabled?: boolean;
3913
+ /** RCAS sharpness. **0 is maximum sharpening and 2 is none** — it is a radius, not a gain. */
3914
+ readonly sharpenStrength?: number;
3915
+ /** Unreal's VignetteIntensity (Scene.cpp default 0.4), the cosine-fourth law. Zero disables it. */
3916
+ readonly vignetteAmount?: number;
3917
+ /** Unreal's default motion blur on the velocity the render chain provisions (harness overlay). */
3918
+ readonly motionBlurEnabled?: boolean;
3919
+ /**
3920
+ * Post-process antialiasing, run last. Godot's `Viewport.screen_space_aa`. Default `"smaa"`.
3921
+ *
3922
+ * Not optional in practice: the chain renders `pass(scene, camera)` single-sampled, so the moment
3923
+ * any stage runs, the renderer's own multisampling no longer reaches the frame and every edge
3924
+ * stairsteps — the single loudest "this is a prototype" signal in a frame. It is requested only
3925
+ * when some other stage (or a `baseColour`) installs a chain; with nothing installed the renderer
3926
+ * draws straight to the canvas with its own MSAA and this would be paying twice.
3927
+ */
3928
+ readonly screenSpaceAA?: ScreenSpaceAA;
3929
+ /**
3930
+ * Temporal antialiasing, Unreal's default method (`r.AntiAliasingMethod` 4, temporal super resolution). Default `false`
3931
+ * here, and `true` in the `high` and `medium` tiers of `quality.ts`.
3932
+ *
3933
+ * The engine jitters the camera by a sub-pixel offset every frame, draws each pixel's motion, and blends the frames
3934
+ * before it into this one. The `traa` stage resolves the finished frame, after the screen-space stages (occlusion,
3935
+ * global illumination, reflections) and ahead of blur, bloom and the grade, so their edges are smoothed with the rest.
3936
+ * It replaces `screenSpaceAA` while it runs: Unreal runs one method too. It runs on the owned engine only. On
3937
+ * `engine: "threejs"` and on a fallback renderer this option is refused with a reason in the applied report and
3938
+ * `screenSpaceAA` stays in charge. Read `debug().temporal` for the live frame, history and jitter.
3939
+ */
3940
+ readonly temporalAA?: boolean;
3941
+ /** Godot's `glow_enabled`. */
3942
+ readonly bloomEnabled?: boolean;
3943
+ readonly bloomStrength?: number;
3944
+ /** How far a bright pixel bleeds, as a fraction of the screen. */
3945
+ readonly bloomRadius?: number;
3946
+ /** Luminance a pixel must exceed before it blooms at all. */
3947
+ readonly bloomThreshold?: number;
3948
+ /**
3949
+ * Which of this kit's authored stages to run.
3950
+ *
3951
+ * Separate from the graph below, and not for tidiness: the chain has to know whether anything
3952
+ * was requested at all before the scene pass exists — with nothing requested it sets an
3953
+ * exposure and returns, and no pass is ever built. So the request is a static decision the kit
3954
+ * makes from its own config, and only the graph needs the pass.
3955
+ */
3956
+ readonly authoredStageNames?: readonly string[];
3957
+ /**
3958
+ * This kit's own stages, composed after the built-ins.
3959
+ *
3960
+ * A factory because an authored stage needs the two things only this file can produce: the
3961
+ * scene pass's depth texture node, which does not exist until the pass is built, and the
3962
+ * resolved tier. It returns the complete graph — including stages left dormant this frame — so
3963
+ * that an anchor like `watercolor after kuwahara` keeps naming a stage that exists.
3964
+ *
3965
+ * Naming specific stages here instead — an `outlineEnabled`, a `kuwaharaRadius` — is what put
3966
+ * one kit's look inside the plumbing every kit copies verbatim, which
3967
+ * `shared-render-sources.spec.ts` exists to refuse.
3968
+ */
3969
+ readonly authoredStages?: (context: IWorldEnvironmentStageContext) => readonly ChainStage[];
3970
+ /** Quality tier passed to the measured chain; the quality module owns this value. */
3971
+ readonly renderChainTier?: ChainTier;
3972
+ readonly tonemapMode?: TonemapMode;
3973
+ /**
3974
+ * The numbers of the `"filmic"` curve, any field of `IFilmicCurve` (slope, toe, shoulder, black clip, white
3975
+ * clip, blue correction, expand gamut, glow, red modifier, dither, lutClip). Unreal 5.8.3's project defaults
3976
+ * apply to every field left out. Only `tonemapMode: "filmic"` reads it; any other mode with this set throws.
3977
+ */
3978
+ readonly filmicCurve?: Partial<IFilmicCurve>;
3979
+ /**
3980
+ * Unreal's colour grade and white balance for `"filmic"`: saturation, contrast, gamma, gain and offset
3981
+ * (`[red, green, blue, master]`) for the whole frame and for `shadows`, `midtones` and `highlights`, the
3982
+ * luma limits, `whiteTemp` and `whiteTint` in Kelvin and -1 to 1, and `toneCurveAmount`. Left out, the grade
3983
+ * is neutral and costs no shader instruction. Only `tonemapMode: "filmic"` reads it.
3984
+ */
3985
+ readonly colorGrade?: ColorGradeOptions;
3986
+ /**
3987
+ * Scene-referred exposure: multiplied into the scene pass **before** the tone curve, so
3988
+ * the GI gather, reflections and bloom threshold all see the exposed image and the bloom
3989
+ * threshold means the same thing at any exposure.
3990
+ *
3991
+ * `renderer.toneMappingExposure` is live too (measured on three@0.185.1 — see
3992
+ * `docs/verification/exposure-ab-2026-08-30.md`), and applies at the same point in the
3993
+ * graph, but only when no output node is installed. When every stage here is off, this
3994
+ * class falls back to that scalar; when any stage runs, this multiply is the shutter.
3995
+ */
3996
+ readonly exposure?: number;
3997
+ /** Cost opt-in. False retains the direct constant-exposure path. */
3998
+ readonly autoExposureEnabled?: boolean;
3999
+ /** Unreal's bilateral local exposure on top of the automatic exposure (harness overlay). */
4000
+ readonly localExposureEnabled?: boolean;
4001
+ /** Unreal's standard bloom in place of the stock bloom stage (harness overlay). */
4002
+ readonly unrealBloomEnabled?: boolean;
4003
+ /** Editable game policy; disabled application still measures when cost is opted in. */
4004
+ readonly exposurePolicy?: Readonly<IExposureSettings>;
4005
+ }
4006
+ interface IWorldEnvironmentTarget {
4007
+ /** The directional light godrays are raymarched against. Required only by `godraysEnabled`. */
4008
+ readonly godraysLight?: DirectionalLight;
4009
+ /**
4010
+ * Composes the colour the chain starts from, given the scene pass it renders.
4011
+ *
4012
+ * The chain builds `pass(scene, camera)` itself, so a game that composes something onto the
4013
+ * beauty pass before any stage runs — aerial perspective, read against that pass's own view-Z,
4014
+ * is the one in these templates — has nowhere else to put it. The node returned here is the
4015
+ * game's; the chain only decides where it is spliced in, which is first, ahead of exposure and
4016
+ * every stage.
4017
+ */
4018
+ readonly baseColour?: (scenePass: ReturnType<typeof pass>) => Node<"vec4">;
4019
+ /**
4020
+ * The scene's static triangles, for the `ssr` stage: a smooth surface (roughness under the trace's
4021
+ * `maxRoughnessToTrace`) then reflects what its ray hits in the scene, as Unreal's Lumen reflections do,
4022
+ * not only what the screen drew. Build it after the static scene exists; omit it and the stage marches the screen.
4023
+ * @alias Lumen reflections, hit lighting, reflection rays
4024
+ */
4025
+ readonly reflectionTrace?: TracedReflections;
4026
+ }
4027
+ type ResolutionSubrectView = {
4028
+ readonly viewFraction: Vector2;
4029
+ readonly halfTexel: Vector2;
4030
+ };
4031
+ /**
4032
+ * The scene pass's depth texture, as the pass itself types it.
4033
+ *
4034
+ * Named through `pass()` rather than written out because the addon's return type is the only
4035
+ * honest spelling of it, and a hand-written alias here would drift the first time three changes it.
4036
+ */
4037
+ type DepthTextureNode = ReturnType<ReturnType<typeof pass>["getTextureNode"]>;
4038
+ type ChainTier = "high" | "medium" | "low" | "off";
4039
+ type ChainContext = {
4040
+ readonly tier: ChainTier;
4041
+ readonly resolutionSubrect?: ResolutionSubrectView;
4042
+ /**
4043
+ * The sampled velocity texture, present only when this chain request provisioned one.
4044
+ *
4045
+ * Distinct from the accessor TRAANode wants: the chain passes the texture here and installs the
4046
+ * accessor on the graph separately, so a stage that handed this node over as the accessor would
4047
+ * sample a texture that no fragment stage writes.
4048
+ */
4049
+ readonly velocityNode?: Node;
4050
+ };
4051
+ /**
4052
+ * What a kit's `authoredStages` factory is handed. The depth node is the scene pass's, so a
4053
+ * stage that reads depth gets the same texture the built-in stages read rather than its own.
4054
+ */
4055
+ interface IWorldEnvironmentStageContext {
4056
+ readonly depthNode: DepthTextureNode;
4057
+ readonly tier: ChainTier;
4058
+ /** The camera the scene pass renders with, which is the one a temporal stage must jitter. */
4059
+ readonly camera: Camera;
4060
+ }
4061
+ type ChainStage = {
4062
+ readonly name: string;
4063
+ readonly supportsResolutionSubrect?: boolean;
4064
+ readonly before?: string;
4065
+ readonly after?: string;
4066
+ /**
4067
+ * This stage reads display-referred colour — tone-mapped and sRGB-encoded — so the chain
4068
+ * installs the graph with the renderer's automatic output transform switched off and the stage
4069
+ * applies that transform itself (`renderOutput` from `three/tsl`).
4070
+ *
4071
+ * For effects authored against the picture rather than against light: a `.cube` table, an
4072
+ * sRGB-space edge filter. Such a stage runs last and may not declare an anchor, and the chain
4073
+ * only hands the renderer its transform back when the stage was actually refused.
4074
+ */
4075
+ readonly afterOutputTransform?: boolean;
4076
+ readonly available?: (context: ChainContext) => boolean | string;
4077
+ readonly dispose?: () => void;
4078
+ readonly minimumTier?: ChainTier;
4079
+ /**
4080
+ * A temporal stage's completed rejection measurement. Its shape is the engine's velocity
4081
+ * contract, restated here so this file keeps importing nothing, and it is asked once per frame
4082
+ * after rendering. A stage that has not built, or has nothing landed yet, answers `undefined` —
4083
+ * which the chain reports as absent rather than as zero.
4084
+ */
4085
+ readonly rejectionMeasurement?: () => {
4086
+ frame: number;
4087
+ rejectionFraction: number;
4088
+ } | undefined;
4089
+ /** The chain plumbing is stage-agnostic, so it names the node it carries `unknown`. */
4090
+ readonly build: (input: unknown, context: ChainContext) => unknown;
4091
+ };
4092
+ type OutputInstallation = {
4093
+ isCurrent(): boolean;
4094
+ dispose(): void;
4095
+ };
4096
+ type ResolutionSubrectTarget = {
4097
+ setSize(width: number, height: number, depth?: number): void;
4098
+ };
4099
+ type ResolutionSubrectController = {
4100
+ readonly active?: boolean;
4101
+ readonly view?: ResolutionSubrectView;
4102
+ retain(node: ResolutionSubrectTarget, targets: readonly RenderTarget[]): void;
4103
+ release(node: ResolutionSubrectTarget): void;
4104
+ textureView(texture: Texture): ResolutionSubrectView | undefined;
4105
+ dispose(): void;
4106
+ };
4107
+ type OutputSetter = ((node: unknown, worldPass?: unknown) => void) | ((node: unknown, worldPass?: unknown) => OutputInstallation);
4108
+ type OutputRenderer = {
4109
+ kind: string;
4110
+ raw: unknown;
4111
+ createResolutionSubrect?: () => ResolutionSubrectController;
4112
+ /**
4113
+ * Installs a node graph directly. Only reached when a `baseColour` is composed and every
4114
+ * stage is off: the chain installs nothing for an empty stage list, and dropping the game's
4115
+ * own composition on the floor would be the silent no-op this class exists to prevent.
4116
+ */
4117
+ setOutputNode?: OutputSetter;
4118
+ /** Legacy node-only clear. The returned receipt distinguishes same-node reinstalls. */
4119
+ clearOutputNode?: (expectedNode?: unknown) => void;
4120
+ createRenderChain?: (options: {
4121
+ input?: unknown;
4122
+ worldPass?: unknown;
4123
+ request?: {
4124
+ stages?: readonly string[];
4125
+ tier?: ChainContext["tier"];
4126
+ /**
4127
+ * The scene pass that owns the shared velocity output, for a temporal stage to read. Its
4128
+ * shape is the engine's velocity contract, restated here so this file keeps importing
4129
+ * nothing: `pass(scene, camera)` returns exactly this.
4130
+ */
4131
+ velocity?: {
4132
+ pass?: ReturnType<typeof pass>;
4133
+ /** How a host whose scene pass owns the velocity output provides it; the chain's MRT route is the default. */
4134
+ provision?: {
4135
+ texture(scenePass: ReturnType<typeof pass>): Node;
4136
+ attach<T>(node: T, source: unknown): T;
4137
+ };
4138
+ rejectionMeasurement?: () => {
4139
+ frame: number;
4140
+ rejectionFraction: number;
4141
+ } | undefined;
4142
+ };
4143
+ };
4144
+ stages?: readonly ChainStage[];
4145
+ resolutionSubrect?: ResolutionSubrectController;
4146
+ }) => {
4147
+ applied: {
4148
+ dropped: readonly {
4149
+ name: string;
4150
+ reason: string;
4151
+ }[];
4152
+ stages: readonly string[];
4153
+ };
4154
+ dispose(): void;
4155
+ };
4156
+ };
4157
+ declare class WorldEnvironment {
4158
+ #private;
4159
+ /**
4160
+ * A scene with no options starts from the `high` quality tier, a fresh Unreal 5.8.3 project's look; the tier named by
4161
+ * `renderChainTier` ("medium" or "low") starts from that tier instead. An option you give always wins, and an
4162
+ * `undefined` one does not count as given.
4163
+ */
4164
+ constructor(given?: IWorldEnvironmentOptions);
4165
+ /**
4166
+ * Installs the chain. Returns what actually ran — the same applied report the chain
4167
+ * printed — so a scene can assert on it instead of scraping the console.
4168
+ */
4169
+ apply(renderer: OutputRenderer, scene: Scene, camera: Camera, target?: IWorldEnvironmentTarget): {
4170
+ dropped: readonly {
4171
+ name: string;
4172
+ reason: string;
4173
+ }[];
4174
+ stages: readonly string[];
4175
+ dispose?: () => void;
4176
+ exposure?: AutoExposureNode;
4177
+ /** The engine's live temporal state; present only while `temporalAA` runs. */
4178
+ temporalReport?: () => Record<string, unknown>;
4179
+ };
4180
+ }
4181
+
4182
+ /**
4183
+ * Diagnosis knobs of the calibration harness, kept out of the engine's own reading of the page URL: the harness sets
4184
+ * them before it builds a `WorldEnvironment`, and a game never needs to. The defaults are the shipped look.
4185
+ */
4186
+ declare const lookDiagnostics: {
4187
+ /** The harness ladder layer, 0 to 9 (9 is everything on): below 7 the SSGI gather is off, below 8 so are the reflections. */
4188
+ layer: number;
4189
+ /** Brings back the antialias stage that squeezed alpha with the colour, for the BEFORE arm of the glint proof. */
4190
+ aaAlphaSqueezed: boolean;
4191
+ /** Runs N denoise passes over the SSGI gather at any layer, for an A/B against the tier's count. */
4192
+ denoisePasses: number | undefined;
4193
+ /** Turns on the film curve's 43.7 channel clip (off by default), the ON arm of a paired capture. */
4194
+ lutClipOn: boolean;
4195
+ /** Draws one GI term alone (PRD-646); needs the gather, so it applies at layer 7 and above. */
4196
+ giVisualize: GIVisualizeMode;
4197
+ };
4198
+
4199
+ /**
4200
+ * This game's authored looks. GPU family picks the start; measured frame budgets refine it.
4201
+ * Edit these presets to change the look without changing the framework.
4202
+ */
4203
+ type QualityTier = "low" | "medium" | "high";
4204
+ /**
4205
+ * Picks the tier: an explicit `tier` always wins, otherwise the platform decides.
4206
+ *
4207
+ * Fails closed. An unrecognised tier name throws with the value it was handed rather than
4208
+ * quietly rendering the default, because a silent fallback here looks exactly like a tier that
4209
+ * turned out to have no effect.
4210
+ */
4211
+ declare function resolveQualityTier(request?: {
4212
+ readonly gpuClass?: string;
4213
+ readonly mobile?: boolean;
4214
+ readonly software?: boolean;
4215
+ readonly tier?: string;
4216
+ }): QualityTier;
4217
+ /**
4218
+ * Harness: the screen-space gather Unreal's L7 (Epic) is judged against: 32 rays a pixel at half resolution, denoised
4219
+ * over 16 gather pixels. A calibration tool, not a shipping tier (PRD-640 Phase 1: about 31 ms at 1080p). Every harness
4220
+ * scene that renders global illumination spreads it, so no scene falls back to the `high` preset's 2-slice gather.
4221
+ */
4222
+ declare const EPIC_SSGI: IWorldEnvironmentOptions;
4223
+ /** The stages and strengths a tier turns on. Throws on a name that is not a tier. */
4224
+ declare function qualityPreset(tier: string): IWorldEnvironmentOptions;
4225
+ /**
4226
+ * Global illumination and shadow filtering per tier, named after Unreal's scalability levels
4227
+ * (Engine/Config/BaseScalability.ini, `[GlobalIlluminationQuality@0..3]` and `[ShadowQuality@0..3]`).
4228
+ * A fresh Unreal project runs Epic (3), so `high` is Epic; `medium` is level 1 and `low` is level 0.
4229
+ * Unreal's own level 2 (High) is not a ThreeNative tier: the three tiers are the three levels a
4230
+ * calibration scene is judged against (PRD-644, PRD-652).
4231
+ */
4232
+ type FinalGatherMethod = "none" | "irradianceField" | "screenProbeGather";
4233
+ interface IGiTier {
4234
+ /**
4235
+ * How bounce light reaches a pixel. `none` is Unreal's Low: no diffuse GI, the sky light at 0.8.
4236
+ * `irradianceField` is Medium: world-space probes only (the baked cache here). `screenProbeGather`
4237
+ * is Epic: the screen-space gather over the same cache. The preset of the tier names it.
4238
+ */
4239
+ readonly finalGatherMethod: FinalGatherMethod;
4240
+ /** Read-only report: the `sg.GlobalIlluminationQuality` this tier follows. */
4241
+ readonly globalIlluminationQuality: 0 | 1 | 3;
4242
+ /**
4243
+ * `r.DistanceFieldAO`: whether the scene's distance fields shadow the sky light. Unreal's Low turns it off, so
4244
+ * the sky light reaches the inside of a room unoccluded (measured on `sunlit-room`, PRD-644 `## Decisions`).
4245
+ */
4246
+ readonly distanceFieldAO: boolean;
4247
+ /** `r.SkylightIntensityMultiplier`: Unreal suppresses the sky light to 0.8 at Low, where DFAO is off. */
4248
+ readonly skylightIntensityMultiplier: number;
4249
+ }
4250
+ /** The GI method and Unreal level of a tier. Throws on a name that is not a tier. */
4251
+ declare function giPreset(tier: string): IGiTier;
4252
+ interface IShadowFilter {
4253
+ readonly blockerSamples: number;
4254
+ readonly filterSamples: number;
4255
+ }
4256
+ interface IShadowTier {
4257
+ /** Read-only report: the `sg.ShadowQuality` this tier follows. */
4258
+ readonly shadowQuality: 0 | 1 | 3;
4259
+ /**
4260
+ * Whether the sun and the lamps cast dynamic shadows. Unreal draws none at `sg.ShadowQuality` 0
4261
+ * (`r.ShadowQuality=0`), measured on `penumbra-lab` (PRD-652 `## Decisions`), so `low` casts none.
4262
+ */
4263
+ readonly castShadows: boolean;
4264
+ /**
4265
+ * The receiver filter taps of the sun and of every lamp: Unreal's directional and local ray counts
4266
+ * are equal at Medium and Epic, so one pair serves both.
4267
+ */
4268
+ readonly filter: IShadowFilter;
4269
+ /** `r.Shadow.Virtual.ResolutionLodBiasDirectional`: -1 halves the finest sun level's texel. */
4270
+ readonly resolutionLodBiasDirectional: number;
4271
+ }
4272
+ /** The shadow filter and resolution bias of a tier. Throws on a name that is not a tier. */
4273
+ declare function shadowPreset(tier: string): IShadowTier;
4274
+ /** The tier tables as one object: `resolve` a start tier from a GPU class, `gi` and `shadow` settings of a tier. */
4275
+ declare const qualityTiers: {
4276
+ readonly resolutionScale: {
4277
+ readonly low: 1;
4278
+ readonly medium: 0.72;
4279
+ readonly high: 0.85;
4280
+ };
4281
+ readonly gi: typeof giPreset;
4282
+ readonly resolve: typeof resolveQualityTier;
4283
+ readonly shadow: typeof shadowPreset;
4284
+ };
4285
+
4286
+ /** The renderer multiplier for an exposure value at ISO 100.
4287
+ * @situation expose a frame lit in lux and nits with a physical camera exposure value
4288
+ * @constraint ev100 must be finite; a unitless scene keeps its own multiplier instead
4289
+ * @example renderer.toneMappingExposure = exposureFromEv100(14.5);
4290
+ */
4291
+ declare function exposureFromEv100(ev100: number): number;
4292
+ /** The exposure value at ISO 100 that a renderer multiplier stands for.
4293
+ * @situation report a hand-set exposure multiplier as an EV100
4294
+ * @constraint multiplier must be finite and greater than zero
4295
+ * @example const ev = ev100FromExposure(renderer.toneMappingExposure);
4296
+ */
4297
+ declare function ev100FromExposure(multiplier: number): number;
4298
+ /** The exposure value at ISO 100 of a physical camera: aperture f-number, shutter seconds, ISO.
4299
+ * @situation expose like a camera with an aperture, a shutter time and an ISO
4300
+ * @constraint every argument must be finite and greater than zero
4301
+ * @example const ev = ev100FromCamera(4, 1 / 60, 100); // 9.91
4302
+ */
4303
+ declare function ev100FromCamera(aperture: number, shutterSeconds: number, iso: number): number;
4304
+ /** The exposure value at ISO 100 that a reflected-light meter reads for an average luminance.
4305
+ * @situation meter a frame's average luminance in cd/m² into an exposure value
4306
+ * @constraint luminance must be finite and greater than zero
4307
+ * @example const ev = ev100FromLuminance(averageNits);
4308
+ */
4309
+ declare function ev100FromLuminance(luminance: number): number;
4310
+
2616
4311
  /**
2617
4312
  * Two load-time mechanisms every streaming game writes by hand, and gets wrong in the same places.
2618
4313
  *
@@ -2825,6 +4520,19 @@ interface ISpectralOceanOptions {
2825
4520
  readonly readbackResolution: number;
2826
4521
  /** Frames between height copies. Ignored when `readbackResolution` is zero. */
2827
4522
  readonly readbackEveryFrames: number;
4523
+ /**
4524
+ * The spectrum's shape, as energy per wavenumber cell at `(kx, kz)` in rad/m, replacing Phillips.
4525
+ *
4526
+ * Each cascade still keeps only its own band, so a custom curve is never counted twice. The game
4527
+ * owns the curve — a fetch-limited wind sea, an independent swell — and this runs on the CPU at
4528
+ * construction, so it must return a finite, non-negative number or construction throws.
4529
+ */
4530
+ readonly energy?: (kx: number, kz: number) => number;
4531
+ /**
4532
+ * The wavenumber, in rad/m, above which surface tension speeds waves up: `ω² = g·k·(1 + (k/km)²)`.
4533
+ * Omitted, the dispersion is plain deep water.
4534
+ */
4535
+ readonly capillaryWavenumber?: number;
2828
4536
  }
2829
4537
  /** A height read from the CPU copy, with the age of the frame that produced it. */
2830
4538
  interface ISpectralOceanHeight {
@@ -3693,7 +5401,12 @@ declare class PathFollow3D {
3693
5401
  interface IGroundSnapOptions {
3694
5402
  /** Whether to apply the correction. Measurement and `clearance` continue when this is false. */
3695
5403
  readonly enabled?: boolean;
3696
- /** Maximum correction speed in metres per second. Unset follows the authored pose exactly. */
5404
+ /**
5405
+ * Maximum downward correction speed in metres per second. Unset follows the authored pose
5406
+ * exactly. A pose below the surface is still raised at once: the rate stops the snap pulling a
5407
+ * run cycle's flight phase onto the floor, where the leading foot skates, and never lets a foot
5408
+ * sink through it.
5409
+ */
3697
5410
  readonly maxRate?: number;
3698
5411
  /** Visual meshes to measure. Defaults to every mesh below `model`. */
3699
5412
  readonly meshes?: readonly Object3D[];
@@ -4236,6 +5949,6 @@ declare function boneLengthDeviations(root: Object3D, bind: IBoneLengthSnapshot,
4236
5949
  * unavoidable here — core is bundled for browsers and cannot read `package.json` at runtime — so
4237
5950
  * the spec now asserts this equals the manifest instead of asserting a number somebody typed.
4238
5951
  */
4239
- declare const version = "0.3.6";
5952
+ declare const version = "0.3.8";
4240
5953
 
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 };
5954
+ export { ATLAS_PADDING, ATMOSPHERE_LUT_RESOLUTIONS, AnimationComposer, AnimationPlayer, Atmosphere, type AtmosphereDirection, AtmosphereLuts, type AtmosphereRgb, AutoExposureNode, Billboard3D, type BillboardLockAxis, BlendSpace1D, BlendSpace2D, BudgetLadder, type BudgetVerdict, CameraShake, type CameraShakeCurve, type ChainStage, ClusteredBatch, ClusteredMesh, Daylight, ENVIRONMENT_TOO_SMALL_MARKER, EPIC_SSGI, type FinalGatherMethod, FlightModel, FluidField2D, FluidParticles3D, FramePassKind, GIBudget, type GIMethod, GIVisualize, type GIVisualizeMode, GI_METHODS, GI_VISUALIZE_MODES, 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 IAnimationUpdateRateReport, 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 IBudgetLadderOptions, type IBudgetWindow, 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 IExposureSettings, 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 IGIBudgetOptions, type IGIBudgetReport, type IGIVisualizeOptions, type IGPUParticles3DOptions, type IGPUParticles3DRuntime, type IGPUParticles3DSpawnBuffers, type IGPUParticles3DSpawnRequest, type IGPUParticles3DStats, IGPUReadbackSample, type IGPUSceneBVHMaterialGroup, type IGPUSceneBVHOptions, IGamePluginHooks, IGamePluginRuntime, type IGiTier, type IGroundSnapOptions, type IInstancedBatchBuildOptions, type IInstancedBatchOptions, type IInstancedPlacement, type ILampShadowStats, 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 IReflectionRoute, type IReplayOptions, type IReplayRecording, type IReplayRecordingSample, type IResolvedAtmosphereParameters, type IRippleFieldFlow, type IRippleFieldOptions, type ISceneShape, type ISceneWarning, type IShadowFilter, type IShadowFilterBudgetOptions, type IShadowFilterReport, type IShadowTier, type ISkeletalMesh3DOptions, type ISkyCaptureOptions, type ISoftBody3DOptions, type ISoftBodyCollision, type ISolarPosition, type ISolarPositionInput, type ISourceAngleShadowInputs, type ISourceAngleShadowOptions, type ISpanProbeTarget, type ISpanSummary, type ISpanWindow, type ISpectralOceanCascade, type ISpectralOceanHeight, type ISpectralOceanOptions, type ISpriteAnimator3DOptions, type ISpriteFrame3D, IStageGpuReading, type IStaticTransformCensus, type IStrideReport, type ISurfaceCacheMaterial, type ISurfaceCacheOptions, type ISurfaceCacheReport, type ISurfaceCacheTexture, type ISurfaceLight, type ISurfaceLightsOptions, type IThreePoseBounds, type IThreePoseMeasurement, type ITracedHit, type ITracedRay, type ITracedReflectionsOptions, 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, type IWorldEnvironmentOptions, type IWorldEnvironmentStageContext, type IWorldEnvironmentTarget, InstancedBatch, LAMP_SHADOW_MARKER, LUT_RESOLUTIONS, type LaunchFailureKind, type MatrixWorldMode, MatrixWorldPass, NEUTRAL_FLIGHT_MODIFIERS, type NormaliseAxis, OPACITY_IGNORED_MARKER, type OutputRenderer, PROBE_VOLUME_MARKER, PathFollow3D, ProbeVolume, type ProbeVolumeDensity, type QualityTier, RENDERLIST_VALIDATE_FLAG, RENDERLIST_VALIDATE_MARKER, type Recording, RenderListValidator, type ReplayPointer, RippleField, SCENE_WARNING_MARKER, SHADOW_FILTER_TIERS, SHADOW_STAGES, SPANS, SPANS_FLAG, SPANS_MARKER, SPAN_COUNT, SPAN_NAMES, STATIC_TRANSFORM_MARKER, type ScreenSpaceAA, ShadowFilterBudget, type ShadowFilterTier, SkeletalMesh3D, SkyCapture, SkyCaptureSchedule, SoftBody3D, type SpanId, SpanRecorder, SpectralOcean, SpriteAnimator3D, type SpritePlaybackMode, type SsgiQuality, SurfaceCache, SurfaceLights, type ThreePoseQuaternion, type ThreePoseVector, type TonemapMode, TracedReflections, 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, WorldEnvironment, addFoliageBackLight, addInSlices, addSpan, aerodynamicCoefficients, airDensity, aircraftMass, alwaysRender, attachToBone, attitudeAxes, beginSpan, boneContact, boneLengthDeviations, boneLengths, bvhIntersectFirstHit, clipBoneCoverage, clipPoseError, clipTrackBindings, createReplayDriver, debugFlag, describeSceneShape, describeSceneWarning, directionFromSolarPosition, directionalTransmittance, displayPeriodMs, endSpan, ev100FromCamera, ev100FromExposure, ev100FromLuminance, exposeDebug, exposureFromEv100, exposureSettings, formatSceneWarning, formatSpansWindow, formatUnlitFoliageWarning, formatValidationReport, gearClearance, installFilmicToneMapping, installSpanProbes, invalidateStatic, isStatic, lampPenumbraTangent, lampShadowMarker, loadAll, lookDiagnostics, markStatic, measureThreePose, mergeByMaterial, mergeParts, normaliseToMetres, onLaunchFailure, parseReplayRecording, penumbraUv, posedBounds, qualityPreset, qualityTiers, rayStruct, readGIMarker, readLampShadowMarker, readProbeVolumeObservation, readShadowTierMarker, readVirtualShadowMarker, refreshStaticTransforms, renderListValidationRequested, renderTrapAudit, replay, resetStaticTransforms, resolveAtmosphereLutResolutions, resolveAtmosphereParameters, sceneWarning, setAttitude, setSpanRecorder, skeletonBones, softCircleDataTexture, solarPosition, solarPositionAt, sourceAngleShadowFilter, sourceRadiusShadowFilter, spanNow, spanRecorder, spansRequested, staticTransformCensus, unlitFoliageWarning, unmarkStatic, updateAtmosphereParameters, updateClusteredMeshes, useRoughDiffuse, validateWorldMatrices, version, zenithTransmittance };