@woosh/meep-engine 3.46.0 → 3.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (827) hide show
  1. package/build/bundle-worker-terrain.js +1 -1
  2. package/editor/actions/concrete/TransformModifyAction.d.ts.map +1 -1
  3. package/editor/actions/concrete/TransformModifyAction.js +10 -2
  4. package/editor/ecs/component/FieldDescriptor.js +15 -0
  5. package/editor/ecs/component/createObjectEditor.js +41 -12
  6. package/editor/ecs/component/editors/ecs/Transform64Editor.d.ts.map +1 -1
  7. package/editor/ecs/component/editors/ecs/Transform64Editor.js +77 -70
  8. package/editor/particles/effect/ParticleReferenceSimulation.d.ts +1 -2
  9. package/editor/particles/effect/ParticleReferenceSimulation.d.ts.map +1 -1
  10. package/editor/particles/effect/ParticleReferenceSimulation.js +2 -4
  11. package/editor/tools/TransformToolV2.d.ts.map +1 -1
  12. package/editor/tools/TransformToolV2.js +4 -0
  13. package/editor/tools/v2/TransformControls.d.ts.map +1 -1
  14. package/editor/tools/v2/TransformControls.js +7 -0
  15. package/editor/view/ecs/EntityEditor.d.ts.map +1 -1
  16. package/editor/view/ecs/EntityEditor.js +4 -2
  17. package/editor/view/particles/effect/ParticleGraphEditorView.js +1 -1
  18. package/package.json +1 -1
  19. package/src/core/collection/array/array_insert_at.d.ts +16 -0
  20. package/src/core/collection/array/array_insert_at.d.ts.map +1 -0
  21. package/src/core/collection/array/array_insert_at.js +32 -0
  22. package/src/core/collection/array/array_remove_at.d.ts +15 -0
  23. package/src/core/collection/array/array_remove_at.d.ts.map +1 -0
  24. package/src/core/collection/array/array_remove_at.js +30 -0
  25. package/src/core/geom/3d/quaternion/quat3_look_rotation.d.ts +37 -0
  26. package/src/core/geom/3d/quaternion/quat3_look_rotation.d.ts.map +1 -0
  27. package/src/core/geom/3d/quaternion/quat3_look_rotation.js +172 -0
  28. package/src/core/geom/Quaternion.d.ts +1 -0
  29. package/src/core/geom/Quaternion.d.ts.map +1 -1
  30. package/src/core/geom/Quaternion.js +12 -48
  31. package/src/engine/Engine.d.ts.map +1 -1
  32. package/src/engine/Engine.js +9 -4
  33. package/src/engine/ecs/async/WORKER_SYSTEM_PLAN.md +27 -11
  34. package/src/engine/ecs/storage/populateEngineSerializationRegistry.d.ts.map +1 -1
  35. package/src/engine/ecs/storage/populateEngineSerializationRegistry.js +21 -0
  36. package/src/engine/ecs/transform/t64_look_rotation.d.ts +4 -4
  37. package/src/engine/ecs/transform/t64_look_rotation.d.ts.map +1 -1
  38. package/src/engine/ecs/transform/t64_look_rotation.js +7 -18
  39. package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSystem.d.ts.map +1 -1
  40. package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSystem.js +30 -1
  41. package/src/engine/graphics/ecs/particles/ParticleEffect.d.ts +2 -2
  42. package/src/engine/graphics/ecs/particles/ParticleEffect.d.ts.map +1 -1
  43. package/src/engine/graphics/ecs/particles/ParticleEffect.js +7 -7
  44. package/src/engine/graphics/ecs/particles/ParticleEffectSerializationAdapter.d.ts +8 -0
  45. package/src/engine/graphics/ecs/particles/ParticleEffectSerializationAdapter.d.ts.map +1 -1
  46. package/src/engine/graphics/ecs/particles/ParticleEffectSerializationAdapter.js +11 -3
  47. package/src/engine/graphics/ecs/particles/ParticleEffectSerializationUpgrader_1_2.d.ts +26 -0
  48. package/src/engine/graphics/ecs/particles/ParticleEffectSerializationUpgrader_1_2.d.ts.map +1 -0
  49. package/src/engine/graphics/ecs/particles/ParticleEffectSerializationUpgrader_1_2.js +91 -0
  50. package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts +6 -0
  51. package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts.map +1 -1
  52. package/src/engine/graphics3/GPUParticleEmitterSystem.js +72 -29
  53. package/src/engine/graphics3/GraphicsEngine.d.ts.map +1 -1
  54. package/src/engine/graphics3/GraphicsEngine.js +8 -1
  55. package/src/engine/graphics3/ParticipatingMedia.d.ts +84 -1
  56. package/src/engine/graphics3/ParticipatingMedia.d.ts.map +1 -1
  57. package/src/engine/graphics3/ParticipatingMedia.js +139 -5
  58. package/src/engine/graphics3/ParticipatingMediaSerializationAdapter.d.ts +6 -2
  59. package/src/engine/graphics3/ParticipatingMediaSerializationAdapter.d.ts.map +1 -1
  60. package/src/engine/graphics3/ParticipatingMediaSerializationAdapter.js +29 -4
  61. package/src/engine/graphics3/ParticipatingMediaSerializationUpgrader_0_1.d.ts +10 -0
  62. package/src/engine/graphics3/ParticipatingMediaSerializationUpgrader_0_1.d.ts.map +1 -0
  63. package/src/engine/graphics3/ParticipatingMediaSerializationUpgrader_0_1.js +38 -0
  64. package/src/engine/graphics3/ParticipatingMediaSystem.d.ts.map +1 -1
  65. package/src/engine/graphics3/ParticipatingMediaSystem.js +46 -3
  66. package/src/engine/input/devices/KeyboardDevice.d.ts +1 -0
  67. package/src/engine/input/devices/KeyboardDevice.d.ts.map +1 -1
  68. package/src/engine/input/devices/KeyboardDevice.js +7 -6
  69. package/src/engine/navigation/ecs/path_following/PathFollowingSystem.d.ts.map +1 -1
  70. package/src/engine/navigation/ecs/path_following/PathFollowingSystem.js +15 -2
  71. package/src/engine/network/CONGESTION_CONTROL.md +9 -9
  72. package/src/engine/network/MESSAGE_TRANSPORT.md +364 -0
  73. package/src/engine/network/NetworkSession.d.ts +47 -16
  74. package/src/engine/network/NetworkSession.d.ts.map +1 -1
  75. package/src/engine/network/NetworkSession.js +556 -292
  76. package/src/engine/network/README.md +104 -28
  77. package/src/engine/network/SMOOTHNESS_DESIGN.md +13 -5
  78. package/src/engine/network/diagnostics/BandwidthMeter.d.ts +1 -1
  79. package/src/engine/network/diagnostics/BandwidthMeter.js +1 -1
  80. package/src/engine/network/orchestrator/HostJoin.d.ts +111 -0
  81. package/src/engine/network/orchestrator/HostJoin.d.ts.map +1 -0
  82. package/src/engine/network/orchestrator/HostJoin.js +271 -0
  83. package/src/engine/network/orchestrator/NetworkPeer.d.ts +151 -112
  84. package/src/engine/network/orchestrator/NetworkPeer.d.ts.map +1 -1
  85. package/src/engine/network/orchestrator/NetworkPeer.js +450 -499
  86. package/src/engine/network/orchestrator/PendingSlices.d.ts +30 -0
  87. package/src/engine/network/orchestrator/PendingSlices.d.ts.map +1 -0
  88. package/src/engine/network/orchestrator/PendingSlices.js +83 -0
  89. package/src/engine/network/orchestrator/ReliableFrames.d.ts +34 -0
  90. package/src/engine/network/orchestrator/ReliableFrames.d.ts.map +1 -0
  91. package/src/engine/network/orchestrator/ReliableFrames.js +96 -0
  92. package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts +77 -10
  93. package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts.map +1 -1
  94. package/src/engine/network/orchestrator/ServerAuthoritativeClient.js +236 -61
  95. package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts +59 -23
  96. package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts.map +1 -1
  97. package/src/engine/network/orchestrator/ServerAuthoritativeServer.js +213 -198
  98. package/src/engine/network/replication/Replicator.d.ts +15 -4
  99. package/src/engine/network/replication/Replicator.d.ts.map +1 -1
  100. package/src/engine/network/replication/Replicator.js +57 -17
  101. package/src/engine/network/sim/ActionLog.d.ts +32 -5
  102. package/src/engine/network/sim/ActionLog.d.ts.map +1 -1
  103. package/src/engine/network/sim/ActionLog.js +47 -5
  104. package/src/engine/network/sim/SimActionExecutor.d.ts +42 -2
  105. package/src/engine/network/sim/SimActionExecutor.d.ts.map +1 -1
  106. package/src/engine/network/sim/SimActionExecutor.js +100 -4
  107. package/src/engine/network/sim/Snapshotter.d.ts +12 -0
  108. package/src/engine/network/sim/Snapshotter.d.ts.map +1 -1
  109. package/src/engine/network/sim/Snapshotter.js +43 -0
  110. package/src/engine/network/state/Baseline.d.ts +1 -1
  111. package/src/engine/network/state/Baseline.js +1 -1
  112. package/src/engine/network/state/FrameBufferRing.d.ts +25 -6
  113. package/src/engine/network/state/FrameBufferRing.d.ts.map +1 -1
  114. package/src/engine/network/state/FrameBufferRing.js +51 -6
  115. package/src/engine/network/state/InputRing.d.ts +4 -0
  116. package/src/engine/network/state/InputRing.d.ts.map +1 -1
  117. package/src/engine/network/state/InputRing.js +7 -0
  118. package/src/engine/network/state/RecordArrivalRing.d.ts +57 -0
  119. package/src/engine/network/state/RecordArrivalRing.d.ts.map +1 -0
  120. package/src/engine/network/state/RecordArrivalRing.js +144 -0
  121. package/src/engine/network/transport/DeferredTransport.d.ts.map +1 -1
  122. package/src/engine/network/transport/DeferredTransport.js +1 -0
  123. package/src/engine/network/transport/LoopbackTransport.d.ts.map +1 -1
  124. package/src/engine/network/transport/LoopbackTransport.js +4 -2
  125. package/src/engine/network/transport/Transport.d.ts +7 -0
  126. package/src/engine/network/transport/Transport.d.ts.map +1 -1
  127. package/src/engine/network/transport/Transport.js +8 -0
  128. package/src/engine/network/transport/adapters/NodeUDPTransport.d.ts.map +1 -1
  129. package/src/engine/network/transport/adapters/NodeUDPTransport.js +20 -5
  130. package/src/engine/network/transport/adapters/WebRTCDataChannelTransport.d.ts.map +1 -1
  131. package/src/engine/network/transport/adapters/WebRTCDataChannelTransport.js +8 -0
  132. package/src/engine/network/transport/adapters/WebTransportTransport.d.ts.map +1 -1
  133. package/src/engine/network/transport/adapters/WebTransportTransport.js +6 -0
  134. package/src/engine/network/transport/connection/Connection.d.ts +191 -0
  135. package/src/engine/network/transport/connection/Connection.d.ts.map +1 -0
  136. package/src/engine/network/transport/connection/Connection.js +1262 -0
  137. package/src/engine/network/transport/connection/RangeSet.d.ts +94 -0
  138. package/src/engine/network/transport/connection/RangeSet.d.ts.map +1 -0
  139. package/src/engine/network/transport/connection/RangeSet.js +260 -0
  140. package/src/engine/network/transport/connection/RxStream.d.ts +48 -0
  141. package/src/engine/network/transport/connection/RxStream.d.ts.map +1 -0
  142. package/src/engine/network/transport/connection/RxStream.js +211 -0
  143. package/src/engine/network/transport/connection/TxStream.d.ts +90 -0
  144. package/src/engine/network/transport/connection/TxStream.d.ts.map +1 -0
  145. package/src/engine/network/transport/connection/TxStream.js +243 -0
  146. package/src/engine/network/transport/connection/bytes_copy.d.ts +17 -0
  147. package/src/engine/network/transport/connection/bytes_copy.d.ts.map +1 -0
  148. package/src/engine/network/transport/connection/bytes_copy.js +34 -0
  149. package/src/engine/network/transport/connection/varint.d.ts +46 -0
  150. package/src/engine/network/transport/connection/varint.d.ts.map +1 -0
  151. package/src/engine/network/transport/connection/varint.js +107 -0
  152. package/src/engine/physics/cloth/MEASUREMENTS.md +354 -0
  153. package/src/engine/physics/cloth/PLAN.md +85 -5
  154. package/src/engine/physics/cloth/ecs/ClothInstance.d.ts +0 -12
  155. package/src/engine/physics/cloth/ecs/ClothInstance.d.ts.map +1 -1
  156. package/src/engine/physics/cloth/ecs/ClothInstance.js +0 -13
  157. package/src/engine/physics/cloth/ecs/ClothSystem.d.ts +2 -1
  158. package/src/engine/physics/cloth/ecs/ClothSystem.d.ts.map +1 -1
  159. package/src/engine/physics/cloth/ecs/ClothSystem.js +7 -1
  160. package/src/engine/physics/cloth/ecs/ClothWorld.d.ts.map +1 -1
  161. package/src/engine/physics/cloth/ecs/ClothWorld.js +4 -15
  162. package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts +2 -1
  163. package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts.map +1 -1
  164. package/src/engine/physics/cloth/ecs/WorkerClothSystem.js +6 -1
  165. package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts.map +1 -1
  166. package/src/engine/physics/cloth/ecs/cloth_build_rows.js +20 -10
  167. package/src/engine/physics/cloth/playground/collide.html +5 -3
  168. package/src/engine/physics/cloth/playground/collide_main.js +14 -13
  169. package/src/engine/physics/cloth/solver/ClothState.d.ts +30 -2
  170. package/src/engine/physics/cloth/solver/ClothState.d.ts.map +1 -1
  171. package/src/engine/physics/cloth/solver/ClothState.js +62 -4
  172. package/src/engine/physics/cloth/solver/cloth_self_find.d.ts +11 -3
  173. package/src/engine/physics/cloth/solver/cloth_self_find.d.ts.map +1 -1
  174. package/src/engine/physics/cloth/solver/cloth_self_find.js +52 -11
  175. package/src/engine/physics/cloth/solver/cloth_self_radius.d.ts +42 -0
  176. package/src/engine/physics/cloth/solver/cloth_self_radius.d.ts.map +1 -0
  177. package/src/engine/physics/cloth/solver/cloth_self_radius.js +64 -0
  178. package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts +99 -24
  179. package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts.map +1 -1
  180. package/src/engine/physics/cloth/solver/cloth_solver_constants.js +102 -25
  181. package/src/engine/physics/cloth/solver/cloth_step.d.ts +5 -1
  182. package/src/engine/physics/cloth/solver/cloth_step.d.ts.map +1 -1
  183. package/src/engine/physics/cloth/solver/cloth_step.js +13 -3
  184. package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts +0 -1
  185. package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts.map +1 -1
  186. package/src/engine/physics/cloth/solver/cloth_step_instance.js +12 -14
  187. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts +23 -4
  188. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts.map +1 -1
  189. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.js +36 -8
  190. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts.map +1 -1
  191. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.js +4 -2
  192. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  193. package/src/engine/sound/ecs/audio/AudioEmitter.d.ts +38 -7
  194. package/src/engine/sound/ecs/audio/AudioEmitter.d.ts.map +1 -1
  195. package/src/engine/sound/ecs/audio/AudioEmitter.js +35 -7
  196. package/src/engine/sound/ecs/audio/AudioEmitterSerializationAdapter.d.ts.map +1 -1
  197. package/src/engine/sound/ecs/audio/AudioEmitterSerializationAdapter.js +5 -1
  198. package/src/engine/sound/ecs/audio/AudioEmitterSerializationUpgrader_0_1.d.ts +18 -0
  199. package/src/engine/sound/ecs/audio/AudioEmitterSerializationUpgrader_0_1.d.ts.map +1 -0
  200. package/src/engine/sound/ecs/audio/AudioEmitterSerializationUpgrader_0_1.js +48 -0
  201. package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts +12 -2
  202. package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts.map +1 -1
  203. package/src/engine/sound/ecs/audio/AudioEmitterSystem.js +173 -9
  204. package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts +9 -3
  205. package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts.map +1 -1
  206. package/src/engine/sound/ecs/audio/LiveEmitterSet.js +28 -8
  207. package/src/engine/sound/ecs/trigger/AudioEventTrigger.d.ts +8 -0
  208. package/src/engine/sound/ecs/trigger/AudioEventTrigger.d.ts.map +1 -1
  209. package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationAdapter.d.ts.map +1 -1
  210. package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationAdapter.js +5 -1
  211. package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationUpgrader_0_1.d.ts +18 -0
  212. package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationUpgrader_0_1.d.ts.map +1 -0
  213. package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationUpgrader_0_1.js +51 -0
  214. package/src/engine/sound/ecs/trigger/AudioEventTriggerSystem.d.ts.map +1 -1
  215. package/src/engine/sound/ecs/trigger/AudioEventTriggerSystem.js +15 -1
  216. package/src/engine/sound/sopra/README.md +768 -644
  217. package/src/engine/sound/sopra/SopraEngine.d.ts +104 -8
  218. package/src/engine/sound/sopra/SopraEngine.d.ts.map +1 -1
  219. package/src/engine/sound/sopra/SopraEngine.js +327 -12
  220. package/src/engine/sound/sopra/definition/EventDescription.d.ts +28 -2
  221. package/src/engine/sound/sopra/definition/EventDescription.d.ts.map +1 -1
  222. package/src/engine/sound/sopra/definition/EventDescription.js +55 -5
  223. package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts +10 -0
  224. package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts.map +1 -1
  225. package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.js +77 -55
  226. package/src/engine/sound/sopra/definition/EventDescriptionSerializationUpgrader_0_1.d.ts +31 -0
  227. package/src/engine/sound/sopra/definition/EventDescriptionSerializationUpgrader_0_1.d.ts.map +1 -0
  228. package/src/engine/sound/sopra/definition/EventDescriptionSerializationUpgrader_0_1.js +75 -0
  229. package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.d.ts +38 -9
  230. package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.d.ts.map +1 -1
  231. package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.js +34 -5
  232. package/src/engine/sound/sopra/definition/effect/CompressorEffect.d.ts +7 -2
  233. package/src/engine/sound/sopra/definition/effect/CompressorEffect.d.ts.map +1 -1
  234. package/src/engine/sound/sopra/definition/effect/CompressorEffect.js +137 -122
  235. package/src/engine/sound/sopra/definition/effect/EqEffect.d.ts +3 -1
  236. package/src/engine/sound/sopra/definition/effect/EqEffect.d.ts.map +1 -1
  237. package/src/engine/sound/sopra/definition/effect/EqEffect.js +146 -131
  238. package/src/engine/sound/sopra/definition/effect/ReverbEffect.d.ts +1 -0
  239. package/src/engine/sound/sopra/definition/effect/ReverbEffect.d.ts.map +1 -1
  240. package/src/engine/sound/sopra/definition/effect/ReverbEffect.js +6 -1
  241. package/src/engine/sound/sopra/runtime/BusGraph.d.ts +44 -2
  242. package/src/engine/sound/sopra/runtime/BusGraph.d.ts.map +1 -1
  243. package/src/engine/sound/sopra/runtime/BusGraph.js +83 -43
  244. package/src/engine/sound/sopra/runtime/EffectChain.d.ts +96 -0
  245. package/src/engine/sound/sopra/runtime/EffectChain.d.ts.map +1 -0
  246. package/src/engine/sound/sopra/runtime/EffectChain.js +286 -0
  247. package/src/engine/sound/sopra/runtime/EffectParamOverrides.d.ts +123 -0
  248. package/src/engine/sound/sopra/runtime/EffectParamOverrides.d.ts.map +1 -0
  249. package/src/engine/sound/sopra/runtime/EffectParamOverrides.js +320 -0
  250. package/src/engine/sound/sopra/runtime/EventInstance.d.ts +55 -5
  251. package/src/engine/sound/sopra/runtime/EventInstance.d.ts.map +1 -1
  252. package/src/engine/sound/sopra/runtime/EventInstance.js +201 -26
  253. package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.d.ts +2 -1
  254. package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.d.ts.map +1 -1
  255. package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.js +6 -1
  256. package/src/engine/sound/sopra/serialization/sopraSerializationHarness.d.ts +15 -0
  257. package/src/engine/sound/sopra/serialization/sopraSerializationHarness.d.ts.map +1 -1
  258. package/src/engine/sound/sopra/serialization/sopraSerializationHarness.js +32 -0
  259. package/src/engine/sound/sopra/util/MockAudioContext.d.ts.map +1 -1
  260. package/src/engine/sound/sopra/util/MockAudioContext.js +3 -0
  261. package/src/engine/sound/sopra/util/fadeOutAndStop.d.ts +13 -3
  262. package/src/engine/sound/sopra/util/fadeOutAndStop.d.ts.map +1 -1
  263. package/src/engine/sound/sopra/util/fadeOutAndStop.js +25 -13
  264. package/src/shade/RENDERER_CONTRACT.md +6 -3
  265. package/src/shade/device/SHADE_DEVICE_FLOOR.d.ts +24 -0
  266. package/src/shade/device/SHADE_DEVICE_FLOOR.d.ts.map +1 -0
  267. package/src/shade/device/SHADE_DEVICE_FLOOR.js +34 -0
  268. package/src/shade/device/ShadeDeviceFailure.d.ts +12 -5
  269. package/src/shade/device/ShadeDeviceFailure.d.ts.map +1 -1
  270. package/src/shade/device/ShadeDeviceFailure.js +17 -8
  271. package/src/shade/device/ShadeDeviceFailureReason.d.ts +1 -1
  272. package/src/shade/device/ShadeDeviceFailureReason.js +2 -2
  273. package/src/shade/device/mock/SoftwareGPUDevice.d.ts +15 -0
  274. package/src/shade/device/mock/SoftwareGPUDevice.d.ts.map +1 -1
  275. package/src/shade/device/mock/SoftwareGPUDevice.js +21 -0
  276. package/src/shade/device/pipeline/ComputePipelineManager.d.ts +20 -0
  277. package/src/shade/device/pipeline/ComputePipelineManager.d.ts.map +1 -1
  278. package/src/shade/device/pipeline/ComputePipelineManager.js +80 -6
  279. package/src/shade/device/pipeline/PipelineEnquiry.d.ts +52 -0
  280. package/src/shade/device/pipeline/PipelineEnquiry.d.ts.map +1 -0
  281. package/src/shade/device/pipeline/PipelineEnquiry.js +63 -0
  282. package/src/shade/device/pipeline/RenderPipelineManager.d.ts +21 -0
  283. package/src/shade/device/pipeline/RenderPipelineManager.d.ts.map +1 -1
  284. package/src/shade/device/pipeline/RenderPipelineManager.js +84 -4
  285. package/src/shade/device/shade_device_floor_unmet.d.ts +13 -0
  286. package/src/shade/device/shade_device_floor_unmet.d.ts.map +1 -0
  287. package/src/shade/device/shade_device_floor_unmet.js +32 -0
  288. package/src/shade/playground/contact_shadows/ContactShadowLab.d.ts +137 -0
  289. package/src/shade/playground/contact_shadows/ContactShadowLab.d.ts.map +1 -0
  290. package/src/shade/playground/contact_shadows/ContactShadowLab.js +654 -0
  291. package/src/shade/playground/contact_shadows/README.md +126 -0
  292. package/src/shade/playground/contact_shadows/index.html +191 -0
  293. package/src/shade/playground/contact_shadows/main.d.ts +2 -0
  294. package/src/shade/playground/contact_shadows/main.d.ts.map +1 -0
  295. package/src/shade/playground/contact_shadows/main.js +888 -0
  296. package/src/shade/playground/contact_shadows/scenes.d.ts +48 -0
  297. package/src/shade/playground/contact_shadows/scenes.d.ts.map +1 -0
  298. package/src/shade/playground/contact_shadows/scenes.js +620 -0
  299. package/src/shade/playground/contact_shadows/shader_contact_lab_composite.d.ts +36 -0
  300. package/src/shade/playground/contact_shadows/shader_contact_lab_composite.d.ts.map +1 -0
  301. package/src/shade/playground/contact_shadows/shader_contact_lab_composite.js +245 -0
  302. package/src/shade/playground/contact_shadows/shader_contact_lab_reference.d.ts +15 -0
  303. package/src/shade/playground/contact_shadows/shader_contact_lab_reference.d.ts.map +1 -0
  304. package/src/shade/playground/contact_shadows/shader_contact_lab_reference.js +120 -0
  305. package/src/shade/playground/contact_shadows/shader_contact_lab_stats.d.ts +55 -0
  306. package/src/shade/playground/contact_shadows/shader_contact_lab_stats.d.ts.map +1 -0
  307. package/src/shade/playground/contact_shadows/shader_contact_lab_stats.js +216 -0
  308. package/src/shade/playground/contact_shadows/shader_contact_lab_view.d.ts +20 -0
  309. package/src/shade/playground/contact_shadows/shader_contact_lab_view.d.ts.map +1 -0
  310. package/src/shade/playground/contact_shadows/shader_contact_lab_view.js +114 -0
  311. package/src/shade/playground/contact_shadows/shader_contact_shadow_march.d.ts +11 -0
  312. package/src/shade/playground/contact_shadows/shader_contact_shadow_march.d.ts.map +1 -0
  313. package/src/shade/playground/contact_shadows/shader_contact_shadow_march.js +90 -0
  314. package/src/shade/playground/contact_shadows/textures.d.ts +16 -0
  315. package/src/shade/playground/contact_shadows/textures.d.ts.map +1 -0
  316. package/src/shade/playground/contact_shadows/textures.js +123 -0
  317. package/src/shade/playground/particle_ecs/README.md +1 -1
  318. package/src/shade/playground/particle_ecs/effects/flame.json +1932 -1881
  319. package/src/shade/playground/particle_ecs/effects/smoke.json +99 -1
  320. package/src/shade/playground/particle_ecs/effects/soot.json +152 -145
  321. package/src/shade/playground/tonemap_sdr/README.md +90 -0
  322. package/src/shade/playground/tonemap_sdr/ToneMapCompare.d.ts +105 -0
  323. package/src/shade/playground/tonemap_sdr/ToneMapCompare.d.ts.map +1 -0
  324. package/src/shade/playground/tonemap_sdr/ToneMapCompare.js +380 -0
  325. package/src/shade/playground/tonemap_sdr/chunk_tonemap_gt7_sdr_reference.d.ts +32 -0
  326. package/src/shade/playground/tonemap_sdr/chunk_tonemap_gt7_sdr_reference.d.ts.map +1 -0
  327. package/src/shade/playground/tonemap_sdr/chunk_tonemap_gt7_sdr_reference.js +104 -0
  328. package/src/shade/playground/tonemap_sdr/index.html +90 -0
  329. package/src/shade/playground/tonemap_sdr/main.d.ts +2 -0
  330. package/src/shade/playground/tonemap_sdr/main.d.ts.map +1 -0
  331. package/src/shade/playground/tonemap_sdr/main.js +306 -0
  332. package/src/shade/playground/tonemap_sdr/scenes.d.ts +26 -0
  333. package/src/shade/playground/tonemap_sdr/scenes.d.ts.map +1 -0
  334. package/src/shade/playground/tonemap_sdr/scenes.js +404 -0
  335. package/src/shade/playground/volumetrics_froxel/main.d.ts.map +1 -1
  336. package/src/shade/playground/volumetrics_froxel/main.js +85 -4
  337. package/src/shade/playground/water_refraction/README.md +26 -18
  338. package/src/shade/playground/water_refraction/index.html +1 -1
  339. package/src/shade/renderer/Renderer.d.ts +37 -3
  340. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  341. package/src/shade/renderer/Renderer.js +237 -67
  342. package/src/shade/renderer/ShadeToneMappingMode.d.ts +14 -0
  343. package/src/shade/renderer/ShadeToneMappingMode.d.ts.map +1 -0
  344. package/src/shade/renderer/ShadeToneMappingMode.js +30 -0
  345. package/src/shade/renderer/animation/GPUAnimationManager.d.ts +9 -0
  346. package/src/shade/renderer/animation/GPUAnimationManager.d.ts.map +1 -1
  347. package/src/shade/renderer/animation/GPUAnimationManager.js +14 -0
  348. package/src/shade/renderer/animation/skinning/shader_meshlet_apply_skinning.d.ts.map +1 -1
  349. package/src/shade/renderer/animation/skinning/shader_meshlet_apply_skinning.js +5 -3
  350. package/src/shade/renderer/buffer/GPUBufferAllocator.d.ts.map +1 -1
  351. package/src/shade/renderer/buffer/GPUBufferAllocator.js +9 -0
  352. package/src/shade/renderer/buffer/buffer_pool_ops.d.ts +21 -12
  353. package/src/shade/renderer/buffer/buffer_pool_ops.d.ts.map +1 -1
  354. package/src/shade/renderer/buffer/buffer_pool_ops.js +18 -19
  355. package/src/shade/renderer/buffer/table/GPUDatabase.d.ts +7 -0
  356. package/src/shade/renderer/buffer/table/GPUDatabase.d.ts.map +1 -1
  357. package/src/shade/renderer/buffer/table/GPUDatabase.js +12 -0
  358. package/src/shade/renderer/buffer/table/single/GPUSingleTypeTable.d.ts +8 -0
  359. package/src/shade/renderer/buffer/table/single/GPUSingleTypeTable.d.ts.map +1 -1
  360. package/src/shade/renderer/buffer/table/single/GPUSingleTypeTable.js +12 -0
  361. package/src/shade/renderer/camera/GPUCameraContext.d.ts.map +1 -1
  362. package/src/shade/renderer/camera/GPUCameraContext.js +19 -8
  363. package/src/shade/renderer/deferred/chunk_read_gBuffer_material.d.ts.map +1 -1
  364. package/src/shade/renderer/deferred/chunk_read_gBuffer_material.js +4 -0
  365. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.d.ts.map +1 -1
  366. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.js +4 -0
  367. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct_restir.d.ts.map +1 -1
  368. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct_restir.js +4 -0
  369. package/src/shade/renderer/deferred/shader_deferred_main.d.ts.map +1 -1
  370. package/src/shade/renderer/deferred/shader_deferred_main.js +3 -0
  371. package/src/shade/renderer/deferred/shader_tonemap_HDR.d.ts +6 -0
  372. package/src/shade/renderer/deferred/shader_tonemap_HDR.d.ts.map +1 -1
  373. package/src/shade/renderer/deferred/shader_tonemap_HDR.js +13 -3
  374. package/src/shade/renderer/deferred/shader_tonemap_HDR_none.d.ts +9 -0
  375. package/src/shade/renderer/deferred/shader_tonemap_HDR_none.d.ts.map +1 -0
  376. package/src/shade/renderer/deferred/shader_tonemap_HDR_none.js +63 -0
  377. package/src/shade/renderer/deferred/shader_tonemap_HDR_pbr_neutral.d.ts +10 -0
  378. package/src/shade/renderer/deferred/shader_tonemap_HDR_pbr_neutral.d.ts.map +1 -0
  379. package/src/shade/renderer/deferred/shader_tonemap_HDR_pbr_neutral.js +87 -0
  380. package/src/shade/renderer/deferred/shader_tonemap_LDR.d.ts +6 -0
  381. package/src/shade/renderer/deferred/shader_tonemap_LDR.d.ts.map +1 -1
  382. package/src/shade/renderer/deferred/shader_tonemap_LDR.js +23 -5
  383. package/src/shade/renderer/deferred/shader_tonemap_LDR_none.d.ts +9 -0
  384. package/src/shade/renderer/deferred/shader_tonemap_LDR_none.d.ts.map +1 -0
  385. package/src/shade/renderer/deferred/shader_tonemap_LDR_none.js +68 -0
  386. package/src/shade/renderer/deferred/shader_tonemap_LDR_pbr_neutral.d.ts +10 -0
  387. package/src/shade/renderer/deferred/shader_tonemap_LDR_pbr_neutral.d.ts.map +1 -0
  388. package/src/shade/renderer/deferred/shader_tonemap_LDR_pbr_neutral.js +73 -0
  389. package/src/shade/renderer/geometry/meshlet/MeshletBatch.d.ts.map +1 -1
  390. package/src/shade/renderer/geometry/meshlet/MeshletBatch.js +58 -9
  391. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts +35 -25
  392. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts.map +1 -1
  393. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +97 -196
  394. package/src/shade/renderer/geometry/sdf/shader_build_sdf.d.ts.map +1 -1
  395. package/src/shade/renderer/geometry/sdf/shader_build_sdf.js +121 -129
  396. package/src/shade/renderer/global_illumination/brick4/gpu/bake/brick4_bake_basic.d.ts.map +1 -1
  397. package/src/shade/renderer/global_illumination/brick4/gpu/bake/brick4_bake_basic.js +3 -0
  398. package/src/shade/renderer/global_illumination/brick4/gpu/bake/shader_brick4_bake_probes.d.ts.map +1 -1
  399. package/src/shade/renderer/global_illumination/brick4/gpu/bake/shader_brick4_bake_probes.js +4 -0
  400. package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_indirect_lighting.d.ts.map +1 -1
  401. package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_indirect_lighting.js +4 -0
  402. package/src/shade/renderer/global_illumination/lpv/bake/GPULightProbeVolumeRenderer.d.ts.map +1 -1
  403. package/src/shade/renderer/global_illumination/lpv/bake/GPULightProbeVolumeRenderer.js +3 -0
  404. package/src/shade/renderer/global_illumination/lpv/deprecated/probe_trace_compute_shader_code.d.ts.map +1 -1
  405. package/src/shade/renderer/global_illumination/lpv/deprecated/probe_trace_compute_shader_code.js +4 -0
  406. package/src/shade/renderer/global_illumination/probe/octahedral/graph_sample_light_probes.d.ts.map +1 -1
  407. package/src/shade/renderer/global_illumination/probe/octahedral/graph_sample_light_probes.js +4 -0
  408. package/src/shade/renderer/global_illumination/shader_resolve_indirect_lighting.d.ts.map +1 -1
  409. package/src/shade/renderer/global_illumination/shader_resolve_indirect_lighting.js +4 -0
  410. package/src/shade/renderer/gpu_primitive/bvh/GPU_BVH_BUILD_PLAN.md +131 -1
  411. package/src/shade/renderer/gpu_primitive/bvh/chunk_bvh_delta.d.ts +7 -0
  412. package/src/shade/renderer/gpu_primitive/bvh/chunk_bvh_delta.d.ts.map +1 -1
  413. package/src/shade/renderer/gpu_primitive/bvh/chunk_bvh_delta.js +45 -38
  414. package/src/shade/renderer/gpu_primitive/bvh/chunk_bvh_determine_range.d.ts +2 -0
  415. package/src/shade/renderer/gpu_primitive/bvh/chunk_bvh_determine_range.d.ts.map +1 -1
  416. package/src/shade/renderer/gpu_primitive/bvh/chunk_bvh_determine_range.js +81 -79
  417. package/src/shade/renderer/gpu_primitive/bvh/chunk_bvh_find_split.d.ts +2 -0
  418. package/src/shade/renderer/gpu_primitive/bvh/chunk_bvh_find_split.d.ts.map +1 -1
  419. package/src/shade/renderer/gpu_primitive/bvh/chunk_bvh_find_split.js +5 -3
  420. package/src/shade/renderer/gpu_primitive/bvh/chunk_bvh_internal_children.d.ts +21 -0
  421. package/src/shade/renderer/gpu_primitive/bvh/chunk_bvh_internal_children.d.ts.map +1 -0
  422. package/src/shade/renderer/gpu_primitive/bvh/chunk_bvh_internal_children.js +42 -0
  423. package/src/shade/renderer/gpu_primitive/bvh/chunk_bvh_morton_code.d.ts +19 -0
  424. package/src/shade/renderer/gpu_primitive/bvh/chunk_bvh_morton_code.d.ts.map +1 -0
  425. package/src/shade/renderer/gpu_primitive/bvh/chunk_bvh_morton_code.js +44 -0
  426. package/src/shade/renderer/gpu_primitive/bvh/graph_bvh_build_lbvh.d.ts +23 -5
  427. package/src/shade/renderer/gpu_primitive/bvh/graph_bvh_build_lbvh.d.ts.map +1 -1
  428. package/src/shade/renderer/gpu_primitive/bvh/graph_bvh_build_lbvh.js +139 -23
  429. package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_build_single_workgroup.d.ts +25 -0
  430. package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_build_single_workgroup.d.ts.map +1 -0
  431. package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_build_single_workgroup.js +179 -0
  432. package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_emit_hierarchy.d.ts +2 -2
  433. package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_emit_hierarchy.d.ts.map +1 -1
  434. package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_emit_hierarchy.js +7 -16
  435. package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_morton.d.ts +3 -4
  436. package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_morton.d.ts.map +1 -1
  437. package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_morton.js +6 -23
  438. package/src/shade/renderer/gpu_primitive/indirect/IndirectComputeCommandBuildPass.d.ts +11 -0
  439. package/src/shade/renderer/gpu_primitive/indirect/IndirectComputeCommandBuildPass.d.ts.map +1 -1
  440. package/src/shade/renderer/gpu_primitive/indirect/IndirectComputeCommandBuildPass.js +14 -3
  441. package/src/shade/renderer/gpu_primitive/indirect/build_indirect_draw_command.d.ts +10 -0
  442. package/src/shade/renderer/gpu_primitive/indirect/build_indirect_draw_command.d.ts.map +1 -1
  443. package/src/shade/renderer/gpu_primitive/indirect/build_indirect_draw_command.js +13 -3
  444. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.d.ts +10 -0
  445. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.d.ts.map +1 -1
  446. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.js +14 -0
  447. package/src/shade/renderer/gpu_primitive/sort/chunk_sort_bitonic_comparator.d.ts +26 -0
  448. package/src/shade/renderer/gpu_primitive/sort/chunk_sort_bitonic_comparator.d.ts.map +1 -0
  449. package/src/shade/renderer/gpu_primitive/sort/chunk_sort_bitonic_comparator.js +52 -0
  450. package/src/shade/renderer/gpu_primitive/sort/chunk_sort_bitonic_workgroup.d.ts +32 -0
  451. package/src/shade/renderer/gpu_primitive/sort/chunk_sort_bitonic_workgroup.d.ts.map +1 -0
  452. package/src/shade/renderer/gpu_primitive/sort/chunk_sort_bitonic_workgroup.js +89 -0
  453. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts +10 -0
  454. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts.map +1 -1
  455. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.js +20 -1
  456. package/src/shade/renderer/gpu_primitive/test/gpu_test.d.ts.map +1 -1
  457. package/src/shade/renderer/gpu_primitive/test/gpu_test.js +8 -11
  458. package/src/shade/renderer/hiz/HierarchicalZBuffer.d.ts +10 -0
  459. package/src/shade/renderer/hiz/HierarchicalZBuffer.d.ts.map +1 -1
  460. package/src/shade/renderer/hiz/HierarchicalZBuffer.js +294 -281
  461. package/src/shade/renderer/light/GPULightCollection.d.ts +8 -0
  462. package/src/shade/renderer/light/GPULightCollection.d.ts.map +1 -1
  463. package/src/shade/renderer/light/GPULightCollection.js +18 -1
  464. package/src/shade/renderer/light/cluster/cull/graph_cull_lights.d.ts +8 -0
  465. package/src/shade/renderer/light/cluster/cull/graph_cull_lights.d.ts.map +1 -1
  466. package/src/shade/renderer/light/cluster/cull/graph_cull_lights.js +234 -218
  467. package/src/shade/renderer/light/cluster/graph_assign_clsuters.d.ts +7 -0
  468. package/src/shade/renderer/light/cluster/graph_assign_clsuters.d.ts.map +1 -1
  469. package/src/shade/renderer/light/cluster/graph_assign_clsuters.js +13 -0
  470. package/src/shade/renderer/light/cluster/graph_build_light_clusters.d.ts +7 -0
  471. package/src/shade/renderer/light/cluster/graph_build_light_clusters.d.ts.map +1 -1
  472. package/src/shade/renderer/light/cluster/graph_build_light_clusters.js +16 -2
  473. package/src/shade/renderer/light/environment/execute_filter_environment_map.d.ts +10 -0
  474. package/src/shade/renderer/light/environment/execute_filter_environment_map.d.ts.map +1 -1
  475. package/src/shade/renderer/light/environment/execute_filter_environment_map.js +13 -0
  476. package/src/shade/renderer/lightmap/GPULightMap.d.ts.map +1 -1
  477. package/src/shade/renderer/lightmap/GPULightMap.js +3 -0
  478. package/src/shade/renderer/lightmap/bake/shader_lightmap_viz_to_irradiance_flat.d.ts.map +1 -1
  479. package/src/shade/renderer/lightmap/bake/shader_lightmap_viz_to_irradiance_flat.js +4 -0
  480. package/src/shade/renderer/lightmap/bake/shader_lightmap_viz_to_sh.d.ts.map +1 -1
  481. package/src/shade/renderer/lightmap/bake/shader_lightmap_viz_to_sh.js +4 -0
  482. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  483. package/src/shade/renderer/material/GPUMaterialManager.d.ts +16 -4
  484. package/src/shade/renderer/material/GPUMaterialManager.d.ts.map +1 -1
  485. package/src/shade/renderer/material/GPUMaterialManager.js +38 -8
  486. package/src/shade/renderer/particles/DESIGN.md +49 -7
  487. package/src/shade/renderer/particles/ORIENTATION_PLAN_2026_10_15.md +453 -0
  488. package/src/shade/renderer/particles/data/PARTICLE_EMITTER_STRUCT.d.ts +5 -1
  489. package/src/shade/renderer/particles/data/PARTICLE_EMITTER_STRUCT.d.ts.map +1 -1
  490. package/src/shade/renderer/particles/data/PARTICLE_EMITTER_STRUCT.js +13 -5
  491. package/src/shade/renderer/particles/data/particle_emitter_record.js +2 -2
  492. package/src/shade/renderer/particles/graph/groups/particle_builtin_groups.d.ts.map +1 -1
  493. package/src/shade/renderer/particles/graph/groups/particle_builtin_groups.js +12 -0
  494. package/src/shade/renderer/particles/graph/groups/particle_groups_geometry.d.ts +60 -0
  495. package/src/shade/renderer/particles/graph/groups/particle_groups_geometry.d.ts.map +1 -1
  496. package/src/shade/renderer/particles/graph/groups/particle_groups_geometry.js +156 -0
  497. package/src/shade/renderer/particles/runtime/ParticleEmitter.d.ts +2 -2
  498. package/src/shade/renderer/particles/runtime/ParticleEmitter.d.ts.map +1 -1
  499. package/src/shade/renderer/particles/runtime/ParticleEmitter.js +8 -8
  500. package/src/shade/renderer/particles/shaders/chunk_particle_billboard_vertex.d.ts.map +1 -1
  501. package/src/shade/renderer/particles/shaders/chunk_particle_billboard_vertex.js +6 -4
  502. package/src/shade/renderer/particles/shaders/chunk_particle_render_math.d.ts +7 -6
  503. package/src/shade/renderer/particles/shaders/chunk_particle_render_math.d.ts.map +1 -1
  504. package/src/shade/renderer/particles/shaders/chunk_particle_render_math.js +91 -58
  505. package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.d.ts.map +1 -1
  506. package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.js +10 -0
  507. package/src/shade/renderer/path_tracer/accumulating/shader_accumulating_path_tracer.d.ts.map +1 -1
  508. package/src/shade/renderer/path_tracer/accumulating/shader_accumulating_path_tracer.js +5 -1
  509. package/src/shade/renderer/path_tracer/graph_path_trace_scene.d.ts.map +1 -1
  510. package/src/shade/renderer/path_tracer/graph_path_trace_scene.js +6 -0
  511. package/src/shade/renderer/pool/TransientResourcePool.d.ts +24 -0
  512. package/src/shade/renderer/pool/TransientResourcePool.d.ts.map +1 -1
  513. package/src/shade/renderer/pool/TransientResourcePool.js +41 -10
  514. package/src/shade/renderer/postprocess/bloom/graph_postprocess_bloom.d.ts +7 -0
  515. package/src/shade/renderer/postprocess/bloom/graph_postprocess_bloom.d.ts.map +1 -1
  516. package/src/shade/renderer/postprocess/bloom/graph_postprocess_bloom.js +18 -0
  517. package/src/shade/renderer/postprocess/denoise/LigmaDenoiser.d.ts.map +1 -1
  518. package/src/shade/renderer/postprocess/denoise/LigmaDenoiser.js +1 -0
  519. package/src/shade/renderer/postprocess/denoise/shader_temporal_reprojection_luma.d.ts.map +1 -1
  520. package/src/shade/renderer/postprocess/denoise/shader_temporal_reprojection_luma.js +6 -4
  521. package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.d.ts +11 -0
  522. package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.d.ts.map +1 -1
  523. package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.js +16 -0
  524. package/src/shade/renderer/postprocess/gtao/GTAO.d.ts +10 -0
  525. package/src/shade/renderer/postprocess/gtao/GTAO.d.ts.map +1 -1
  526. package/src/shade/renderer/postprocess/gtao/GTAO.js +16 -0
  527. package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao.d.ts.map +1 -1
  528. package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao.js +32 -10
  529. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  530. package/src/shade/renderer/postprocess/ssr/reproject/chunk_ssr_temporal_accumulate.d.ts.map +1 -1
  531. package/src/shade/renderer/postprocess/ssr/reproject/chunk_ssr_temporal_accumulate.js +3 -0
  532. package/src/shade/renderer/postprocess/ssr/resolve/build_ssr_resolve_shader.d.ts.map +1 -1
  533. package/src/shade/renderer/postprocess/ssr/resolve/build_ssr_resolve_shader.js +6 -3
  534. package/src/shade/renderer/postprocess/taa/TAA.d.ts +12 -0
  535. package/src/shade/renderer/postprocess/taa/TAA.d.ts.map +1 -1
  536. package/src/shade/renderer/postprocess/taa/TAA.js +15 -0
  537. package/src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.d.ts +7 -0
  538. package/src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.d.ts.map +1 -1
  539. package/src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.js +13 -0
  540. package/src/shade/renderer/rasterize/TemplatePassDescriptor.d.ts +31 -3
  541. package/src/shade/renderer/rasterize/TemplatePassDescriptor.d.ts.map +1 -1
  542. package/src/shade/renderer/rasterize/TemplatePassDescriptor.js +79 -4
  543. package/src/shade/renderer/rasterize/bucket/graph_meshlets_rasterize_by_bucket.d.ts +17 -0
  544. package/src/shade/renderer/rasterize/bucket/graph_meshlets_rasterize_by_bucket.d.ts.map +1 -1
  545. package/src/shade/renderer/rasterize/bucket/graph_meshlets_rasterize_by_bucket.js +35 -4
  546. package/src/shade/renderer/rasterize/compute/graph_mesh_frustum_cull.d.ts +7 -0
  547. package/src/shade/renderer/rasterize/compute/graph_mesh_frustum_cull.d.ts.map +1 -1
  548. package/src/shade/renderer/rasterize/compute/graph_mesh_frustum_cull.js +182 -169
  549. package/src/shade/renderer/rasterize/expand/bucket/mesh/graph_meshes_classify_buckets.d.ts +10 -0
  550. package/src/shade/renderer/rasterize/expand/bucket/mesh/graph_meshes_classify_buckets.d.ts.map +1 -1
  551. package/src/shade/renderer/rasterize/expand/bucket/mesh/graph_meshes_classify_buckets.js +20 -1
  552. package/src/shade/renderer/rasterize/expand/bucket/meshlet/graph_extract_meshlets_from_bucket.d.ts +10 -0
  553. package/src/shade/renderer/rasterize/expand/bucket/meshlet/graph_extract_meshlets_from_bucket.d.ts.map +1 -1
  554. package/src/shade/renderer/rasterize/expand/bucket/meshlet/graph_extract_meshlets_from_bucket.js +18 -1
  555. package/src/shade/renderer/rasterize/expand/bucket/meshlet/graph_sort_meshlets_by_bucket_id.d.ts +10 -0
  556. package/src/shade/renderer/rasterize/expand/bucket/meshlet/graph_sort_meshlets_by_bucket_id.d.ts.map +1 -1
  557. package/src/shade/renderer/rasterize/expand/bucket/meshlet/graph_sort_meshlets_by_bucket_id.js +20 -1
  558. package/src/shade/renderer/rasterize/expand/graph_mesh_filter_one_way.d.ts +7 -0
  559. package/src/shade/renderer/rasterize/expand/graph_mesh_filter_one_way.d.ts.map +1 -1
  560. package/src/shade/renderer/rasterize/expand/graph_mesh_filter_one_way.js +187 -170
  561. package/src/shade/renderer/rasterize/expand/graph_meshlets_filter_one_way.d.ts +10 -0
  562. package/src/shade/renderer/rasterize/expand/graph_meshlets_filter_one_way.d.ts.map +1 -1
  563. package/src/shade/renderer/rasterize/expand/graph_meshlets_filter_one_way.js +19 -1
  564. package/src/shade/renderer/rasterize/expand/graph_meshlets_rasterize.d.ts +13 -0
  565. package/src/shade/renderer/rasterize/expand/graph_meshlets_rasterize.d.ts.map +1 -1
  566. package/src/shade/renderer/rasterize/expand/graph_meshlets_rasterize.js +25 -1
  567. package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.d.ts +10 -0
  568. package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.d.ts.map +1 -1
  569. package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.js +20 -0
  570. package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment_brick4.d.ts.map +1 -1
  571. package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment_brick4.js +6 -0
  572. package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment_ibl.d.ts.map +1 -1
  573. package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment_ibl.js +6 -0
  574. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts +3 -2
  575. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts.map +1 -1
  576. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.js +3 -2
  577. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts +7 -2
  578. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts.map +1 -1
  579. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.js +12 -4
  580. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_draw_brick4.d.ts.map +1 -1
  581. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_draw_brick4.js +4 -3
  582. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_draw_ibl.d.ts.map +1 -1
  583. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_draw_ibl.js +4 -3
  584. package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.d.ts +2 -1
  585. package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.d.ts.map +1 -1
  586. package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.js +11 -3
  587. package/src/shade/renderer/rasterize/native/oit/shader_oit_resolve_moments.d.ts.map +1 -1
  588. package/src/shade/renderer/rasterize/native/oit/shader_oit_resolve_moments.js +4 -3
  589. package/src/shade/renderer/rasterize/native/oit/shader_oit_resolve_moments_ibl.d.ts.map +1 -1
  590. package/src/shade/renderer/rasterize/native/oit/shader_oit_resolve_moments_ibl.js +4 -3
  591. package/src/shade/renderer/rasterize/standard/graph_rasterize_partial_opaque.d.ts +15 -0
  592. package/src/shade/renderer/rasterize/standard/graph_rasterize_partial_opaque.d.ts.map +1 -1
  593. package/src/shade/renderer/rasterize/standard/graph_rasterize_partial_opaque.js +35 -2
  594. package/src/shade/renderer/rasterize/standard/graph_rasterize_remaining_opaque.d.ts +14 -0
  595. package/src/shade/renderer/rasterize/standard/graph_rasterize_remaining_opaque.d.ts.map +1 -1
  596. package/src/shade/renderer/rasterize/standard/graph_rasterize_remaining_opaque.js +32 -4
  597. package/src/shade/renderer/rasterize/standard/graph_rasterize_scene.d.ts +17 -0
  598. package/src/shade/renderer/rasterize/standard/graph_rasterize_scene.d.ts.map +1 -1
  599. package/src/shade/renderer/rasterize/standard/graph_rasterize_scene.js +34 -4
  600. package/src/shade/renderer/restir/di/chunk_restir_resolve.d.ts +5 -3
  601. package/src/shade/renderer/restir/di/chunk_restir_resolve.d.ts.map +1 -1
  602. package/src/shade/renderer/restir/di/chunk_restir_resolve.js +8 -3
  603. package/src/shade/renderer/restir/di/graph_restir_di.d.ts.map +1 -1
  604. package/src/shade/renderer/restir/di/graph_restir_di.js +1 -0
  605. package/src/shade/renderer/restir/di/shader_restir_di_resolve.d.ts.map +1 -1
  606. package/src/shade/renderer/restir/di/shader_restir_di_resolve.js +5 -1
  607. package/src/shade/renderer/restir/reservoir/shader.d.ts.map +1 -1
  608. package/src/shade/renderer/restir/reservoir/shader.js +7 -4
  609. package/src/shade/renderer/scene/GPUInstancesAccelerationStructure.d.ts +7 -0
  610. package/src/shade/renderer/scene/GPUInstancesAccelerationStructure.d.ts.map +1 -1
  611. package/src/shade/renderer/scene/GPUInstancesAccelerationStructure.js +13 -1
  612. package/src/shade/renderer/scene/GPUSceneContext.d.ts +10 -0
  613. package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
  614. package/src/shade/renderer/scene/GPUSceneContext.js +19 -0
  615. package/src/shade/renderer/scene/SceneManager.d.ts +9 -0
  616. package/src/shade/renderer/scene/SceneManager.d.ts.map +1 -1
  617. package/src/shade/renderer/scene/SceneManager.js +11 -0
  618. package/src/shade/renderer/scene/hierarchy/graph_nodes_update_transform_hierarchy.d.ts +11 -0
  619. package/src/shade/renderer/scene/hierarchy/graph_nodes_update_transform_hierarchy.d.ts.map +1 -1
  620. package/src/shade/renderer/scene/hierarchy/graph_nodes_update_transform_hierarchy.js +17 -0
  621. package/src/shade/renderer/scene/hierarchy/graph_scene_update_transform_hierarchy.d.ts +11 -0
  622. package/src/shade/renderer/scene/hierarchy/graph_scene_update_transform_hierarchy.d.ts.map +1 -1
  623. package/src/shade/renderer/scene/hierarchy/graph_scene_update_transform_hierarchy.js +18 -1
  624. package/src/shade/renderer/shader/ComputeShader.d.ts +12 -0
  625. package/src/shade/renderer/shader/ComputeShader.d.ts.map +1 -1
  626. package/src/shade/renderer/shader/ComputeShader.js +71 -2
  627. package/src/shade/renderer/shader/ImageShader.d.ts +27 -8
  628. package/src/shade/renderer/shader/ImageShader.d.ts.map +1 -1
  629. package/src/shade/renderer/shader/ImageShader.js +299 -218
  630. package/src/shade/renderer/shader/ShaderDescriptor.d.ts +21 -0
  631. package/src/shade/renderer/shader/ShaderDescriptor.d.ts.map +1 -1
  632. package/src/shade/renderer/shader/ShaderDescriptor.js +71 -1
  633. package/src/shade/renderer/shader/chunk/camera/chunk_project_view_position_from_depth.d.ts +17 -0
  634. package/src/shade/renderer/shader/chunk/camera/chunk_project_view_position_from_depth.d.ts.map +1 -0
  635. package/src/shade/renderer/shader/chunk/camera/chunk_project_view_position_from_depth.js +45 -0
  636. package/src/shade/renderer/shader/chunk/camera/chunk_screen_coordinate_to_view.js +3 -3
  637. package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_eotf_st2084.d.ts +1 -1
  638. package/src/shade/renderer/shader/chunk/color/iCtCp/chunk_eotf_st2084.js +62 -62
  639. package/src/shade/renderer/shader/chunk/color/tonemap/HDR_TONE_MAPPING_FORMS_BRIEF_2026_10_16.md +318 -0
  640. package/src/shade/renderer/shader/chunk/color/tonemap/SDR_TONE_MAPPING_BRIEF_2026_10_16.md +237 -0
  641. package/src/shade/renderer/shader/chunk/color/tonemap/chunk_PAPER_WHITE_NITS.d.ts +17 -0
  642. package/src/shade/renderer/shader/chunk/color/tonemap/chunk_PAPER_WHITE_NITS.d.ts.map +1 -0
  643. package/src/shade/renderer/shader/chunk/color/tonemap/chunk_PAPER_WHITE_NITS.js +22 -0
  644. package/src/shade/renderer/shader/chunk/color/tonemap/chunk_tonemap_khronos_pbr.d.ts +14 -1
  645. package/src/shade/renderer/shader/chunk/color/tonemap/chunk_tonemap_khronos_pbr.d.ts.map +1 -1
  646. package/src/shade/renderer/shader/chunk/color/tonemap/chunk_tonemap_khronos_pbr.js +28 -15
  647. package/src/shade/renderer/shader/chunk/color/tonemap/gt7/chunk_tonemap_gt7.d.ts +12 -0
  648. package/src/shade/renderer/shader/chunk/color/tonemap/gt7/chunk_tonemap_gt7.d.ts.map +1 -1
  649. package/src/shade/renderer/shader/chunk/color/tonemap/gt7/chunk_tonemap_gt7.js +128 -110
  650. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_offset_ray_from_depth.d.ts +20 -0
  651. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_offset_ray_from_depth.d.ts.map +1 -0
  652. package/src/shade/renderer/shader/chunk/geometry/ray/chunk_offset_ray_from_depth.js +33 -0
  653. package/src/shade/renderer/shader/chunk/light/chunk_compute_multiscattering_specular.d.ts +4 -0
  654. package/src/shade/renderer/shader/chunk/light/chunk_compute_multiscattering_specular.d.ts.map +1 -1
  655. package/src/shade/renderer/shader/chunk/light/chunk_compute_multiscattering_specular.js +12 -1
  656. package/src/shade/renderer/shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.d.ts.map +1 -1
  657. package/src/shade/renderer/shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.js +7 -0
  658. package/src/shade/renderer/shader/chunk/material/MULTISCATTER.md +108 -0
  659. package/src/shade/renderer/shader/chunk/material/chunk_compute_indirect_specular.d.ts.map +1 -1
  660. package/src/shade/renderer/shader/chunk/material/chunk_compute_indirect_specular.js +23 -4
  661. package/src/shade/renderer/shader/chunk/material/chunk_re_direct_multiscatter.d.ts +18 -0
  662. package/src/shade/renderer/shader/chunk/material/chunk_re_direct_multiscatter.d.ts.map +1 -0
  663. package/src/shade/renderer/shader/chunk/material/chunk_re_direct_multiscatter.js +56 -0
  664. package/src/shade/renderer/shader/chunk/material/chunk_re_indirect_specular_physical.d.ts.map +1 -1
  665. package/src/shade/renderer/shader/chunk/material/chunk_re_indirect_specular_physical.js +2 -0
  666. package/src/shade/renderer/shader/chunk/screen_space/chunk_screen_space_linear_ray.d.ts +43 -0
  667. package/src/shade/renderer/shader/chunk/screen_space/chunk_screen_space_linear_ray.d.ts.map +1 -0
  668. package/src/shade/renderer/shader/chunk/screen_space/chunk_screen_space_linear_ray.js +319 -0
  669. package/src/shade/renderer/shader/compiler/CodeChunk.d.ts +33 -0
  670. package/src/shade/renderer/shader/compiler/CodeChunk.d.ts.map +1 -1
  671. package/src/shade/renderer/shader/compiler/CodeChunk.js +140 -0
  672. package/src/shade/renderer/shader/compiler/CodeChunkChoice.d.ts +74 -0
  673. package/src/shade/renderer/shader/compiler/CodeChunkChoice.d.ts.map +1 -0
  674. package/src/shade/renderer/shader/compiler/CodeChunkChoice.js +166 -0
  675. package/src/shade/renderer/shader/compiler/SHADER_SWITCH_PROPOSAL_2026_10_16.md +680 -0
  676. package/src/shade/renderer/shader/compiler/ShaderSwitch.d.ts +86 -0
  677. package/src/shade/renderer/shader/compiler/ShaderSwitch.d.ts.map +1 -0
  678. package/src/shade/renderer/shader/compiler/ShaderSwitch.js +178 -0
  679. package/src/shade/renderer/shader/compiler/ShaderSwitchSet.d.ts +67 -0
  680. package/src/shade/renderer/shader/compiler/ShaderSwitchSet.d.ts.map +1 -0
  681. package/src/shade/renderer/shader/compiler/ShaderSwitchSet.js +205 -0
  682. package/src/shade/renderer/shadow/contact/CONTACT_SHADOW_WAVE_SIZE.d.ts +14 -0
  683. package/src/shade/renderer/shadow/contact/CONTACT_SHADOW_WAVE_SIZE.d.ts.map +1 -0
  684. package/src/shade/renderer/shadow/contact/CONTACT_SHADOW_WAVE_SIZE.js +13 -0
  685. package/src/shade/renderer/shadow/contact/ContactShadowDispatchList.d.ts +65 -0
  686. package/src/shade/renderer/shadow/contact/ContactShadowDispatchList.d.ts.map +1 -0
  687. package/src/shade/renderer/shadow/contact/ContactShadowDispatchList.js +252 -0
  688. package/src/shade/renderer/shadow/contact/FINDINGS.md +413 -0
  689. package/src/shade/renderer/shadow/contact/chunk_contact_shadow_wavefront_extents.d.ts +29 -0
  690. package/src/shade/renderer/shadow/contact/chunk_contact_shadow_wavefront_extents.d.ts.map +1 -0
  691. package/src/shade/renderer/shadow/contact/chunk_contact_shadow_wavefront_extents.js +105 -0
  692. package/src/shade/renderer/shadow/contact/graph_contact_shadow_linear.d.ts +29 -0
  693. package/src/shade/renderer/shadow/contact/graph_contact_shadow_linear.d.ts.map +1 -0
  694. package/src/shade/renderer/shadow/contact/graph_contact_shadow_linear.js +39 -0
  695. package/src/shade/renderer/shadow/contact/graph_contact_shadow_wavefront.d.ts +29 -0
  696. package/src/shade/renderer/shadow/contact/graph_contact_shadow_wavefront.d.ts.map +1 -0
  697. package/src/shade/renderer/shadow/contact/graph_contact_shadow_wavefront.js +92 -0
  698. package/src/shade/renderer/shadow/contact/shader_contact_shadow_linear.d.ts +29 -0
  699. package/src/shade/renderer/shadow/contact/shader_contact_shadow_linear.d.ts.map +1 -0
  700. package/src/shade/renderer/shadow/contact/shader_contact_shadow_linear.js +128 -0
  701. package/src/shade/renderer/shadow/contact/shader_contact_shadow_wavefront.d.ts +52 -0
  702. package/src/shade/renderer/shadow/contact/shader_contact_shadow_wavefront.d.ts.map +1 -0
  703. package/src/shade/renderer/shadow/contact/shader_contact_shadow_wavefront.js +358 -0
  704. package/src/shade/renderer/shadow/map/ShadowDirectionalTechnique.d.ts +10 -0
  705. package/src/shade/renderer/shadow/map/ShadowDirectionalTechnique.d.ts.map +1 -0
  706. package/src/shade/renderer/shadow/map/ShadowDirectionalTechnique.js +12 -0
  707. package/src/shade/renderer/shadow/map/shader/SHADOW_DIRECTIONAL_TECHNIQUE.d.ts +13 -0
  708. package/src/shade/renderer/shadow/map/shader/SHADOW_DIRECTIONAL_TECHNIQUE.d.ts.map +1 -0
  709. package/src/shade/renderer/shadow/map/shader/SHADOW_DIRECTIONAL_TECHNIQUE.js +14 -0
  710. package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_sample_directional.d.ts +14 -8
  711. package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_sample_directional.d.ts.map +1 -1
  712. package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_sample_directional.js +20 -86
  713. package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_sample_directional_cascades.d.ts +14 -0
  714. package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_sample_directional_cascades.d.ts.map +1 -0
  715. package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_sample_directional_cascades.js +79 -0
  716. package/src/shade/renderer/shadow/ray/shader_ray_shadow_code.d.ts.map +1 -1
  717. package/src/shade/renderer/shadow/ray/shader_ray_shadow_code.js +12 -12
  718. package/src/shade/renderer/shadow/ray/staged/gen/shader_generate_rays.d.ts.map +1 -1
  719. package/src/shade/renderer/shadow/ray/staged/gen/shader_generate_rays.js +153 -151
  720. package/src/shade/renderer/shadow/vsm/shader/chunk_shadowmap_sample_directional_virtual.d.ts +13 -0
  721. package/src/shade/renderer/shadow/vsm/shader/chunk_shadowmap_sample_directional_virtual.d.ts.map +1 -0
  722. package/src/shade/renderer/shadow/vsm/shader/chunk_shadowmap_sample_directional_virtual.js +48 -0
  723. package/src/shade/renderer/texture/GPUTextureContext.d.ts +10 -0
  724. package/src/shade/renderer/texture/GPUTextureContext.d.ts.map +1 -1
  725. package/src/shade/renderer/texture/GPUTextureContext.js +24 -0
  726. package/src/shade/renderer/texture/atlas/GPUTileAtlas3D.d.ts +219 -0
  727. package/src/shade/renderer/texture/atlas/GPUTileAtlas3D.d.ts.map +1 -0
  728. package/src/shade/renderer/texture/atlas/GPUTileAtlas3D.js +671 -0
  729. package/src/shade/renderer/volumetrics/GPUSceneVolumetrics.d.ts +26 -2
  730. package/src/shade/renderer/volumetrics/GPUSceneVolumetrics.d.ts.map +1 -1
  731. package/src/shade/renderer/volumetrics/GPUSceneVolumetrics.js +108 -4
  732. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts +5 -1
  733. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts.map +1 -1
  734. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.js +6 -0
  735. package/src/shade/renderer/volumetrics/NOTES.md +50 -0
  736. package/src/shade/renderer/volumetrics/PARTICIPATING_MEDIA_VOLUME_STRUCT.d.ts.map +1 -1
  737. package/src/shade/renderer/volumetrics/PARTICIPATING_MEDIA_VOLUME_STRUCT.js +30 -1
  738. package/src/shade/renderer/volumetrics/ParticipatingMediaVolume.d.ts +51 -13
  739. package/src/shade/renderer/volumetrics/ParticipatingMediaVolume.d.ts.map +1 -1
  740. package/src/shade/renderer/volumetrics/ParticipatingMediaVolume.js +98 -13
  741. package/src/shade/renderer/volumetrics/SceneVolumetrics.d.ts +9 -0
  742. package/src/shade/renderer/volumetrics/SceneVolumetrics.d.ts.map +1 -1
  743. package/src/shade/renderer/volumetrics/SceneVolumetrics.js +78 -68
  744. package/src/shade/renderer/volumetrics/VOLUMETRIC_NOISE_PLAN_2026_10_15.md +326 -0
  745. package/src/shade/renderer/volumetrics/chunk_participating_media_volume_sample.d.ts +7 -4
  746. package/src/shade/renderer/volumetrics/chunk_participating_media_volume_sample.d.ts.map +1 -1
  747. package/src/shade/renderer/volumetrics/chunk_participating_media_volume_sample.js +21 -9
  748. package/src/shade/renderer/volumetrics/chunk_volumetrics_froxel_uvw_from_clip.d.ts +19 -0
  749. package/src/shade/renderer/volumetrics/chunk_volumetrics_froxel_uvw_from_clip.d.ts.map +1 -0
  750. package/src/shade/renderer/volumetrics/chunk_volumetrics_froxel_uvw_from_clip.js +53 -0
  751. package/src/shade/renderer/volumetrics/chunk_volumetrics_sample_froxel_extinction.d.ts +12 -3
  752. package/src/shade/renderer/volumetrics/chunk_volumetrics_sample_froxel_extinction.d.ts.map +1 -1
  753. package/src/shade/renderer/volumetrics/chunk_volumetrics_sample_froxel_extinction.js +85 -48
  754. package/src/shade/renderer/volumetrics/graph_build_froxel_irradiance.d.ts +4 -1
  755. package/src/shade/renderer/volumetrics/graph_build_froxel_irradiance.d.ts.map +1 -1
  756. package/src/shade/renderer/volumetrics/graph_build_froxel_irradiance.js +4 -1
  757. package/src/shade/renderer/volumetrics/graph_build_volumetrics.d.ts +4 -1
  758. package/src/shade/renderer/volumetrics/graph_build_volumetrics.d.ts.map +1 -1
  759. package/src/shade/renderer/volumetrics/graph_build_volumetrics.js +21 -1
  760. package/src/shade/renderer/volumetrics/noise/PARTICIPATING_MEDIA_NOISE.d.ts +98 -0
  761. package/src/shade/renderer/volumetrics/noise/PARTICIPATING_MEDIA_NOISE.d.ts.map +1 -0
  762. package/src/shade/renderer/volumetrics/noise/PARTICIPATING_MEDIA_NOISE.js +115 -0
  763. package/src/shade/renderer/volumetrics/noise/VOLUMETRICS_NOISE_TILE_BAKE_SETTINGS_STRUCT.d.ts +9 -0
  764. package/src/shade/renderer/volumetrics/noise/VOLUMETRICS_NOISE_TILE_BAKE_SETTINGS_STRUCT.d.ts.map +1 -0
  765. package/src/shade/renderer/volumetrics/noise/VOLUMETRICS_NOISE_TILE_BAKE_SETTINGS_STRUCT.js +24 -0
  766. package/src/shade/renderer/volumetrics/noise/bake_volumetrics_noise_tile.d.ts +27 -0
  767. package/src/shade/renderer/volumetrics/noise/bake_volumetrics_noise_tile.d.ts.map +1 -0
  768. package/src/shade/renderer/volumetrics/noise/bake_volumetrics_noise_tile.js +91 -0
  769. package/src/shade/renderer/volumetrics/noise/chunk_participating_media_noise.d.ts +35 -0
  770. package/src/shade/renderer/volumetrics/noise/chunk_participating_media_noise.d.ts.map +1 -0
  771. package/src/shade/renderer/volumetrics/noise/chunk_participating_media_noise.js +92 -0
  772. package/src/shade/renderer/volumetrics/noise/shader_volumetrics_noise_tile_bake.d.ts +10 -0
  773. package/src/shade/renderer/volumetrics/noise/shader_volumetrics_noise_tile_bake.d.ts.map +1 -0
  774. package/src/shade/renderer/volumetrics/noise/shader_volumetrics_noise_tile_bake.js +121 -0
  775. package/src/shade/renderer/volumetrics/shader_volumetrics_build_participating_media.d.ts.map +1 -1
  776. package/src/shade/renderer/volumetrics/shader_volumetrics_build_participating_media.js +38 -3
  777. package/src/shade/renderer/volumetrics/shader_volumetrics_build_sun_shadow_volume.d.ts.map +1 -1
  778. package/src/shade/renderer/volumetrics/shader_volumetrics_build_sun_shadow_volume.js +311 -290
  779. package/src/shade/renderer/volumetrics/volumetrics_position_world_to_froxel_uvw.d.ts.map +1 -1
  780. package/src/shade/renderer/volumetrics/volumetrics_position_world_to_froxel_uvw.js +28 -49
  781. package/src/shade/renderer/water/GPUWaterRenderer.d.ts +3 -1
  782. package/src/shade/renderer/water/GPUWaterRenderer.d.ts.map +1 -1
  783. package/src/shade/renderer/water/GPUWaterRenderer.js +24 -18
  784. package/src/shade/renderer/water/chunk_water_transport.d.ts +0 -1
  785. package/src/shade/renderer/water/chunk_water_transport.d.ts.map +1 -1
  786. package/src/shade/renderer/water/chunk_water_transport.js +0 -17
  787. package/src/shade/renderer/water/shader_water.d.ts +4 -2
  788. package/src/shade/renderer/water/shader_water.d.ts.map +1 -1
  789. package/src/shade/renderer/water/shader_water.js +27 -16
  790. package/src/shade/renderer/water/shader_water_avboit.d.ts +0 -4
  791. package/src/shade/renderer/water/shader_water_avboit.d.ts.map +1 -1
  792. package/src/shade/renderer/water/shader_water_avboit.js +0 -63
  793. package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.d.ts.map +1 -1
  794. package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.js +43 -9
  795. package/src/view/graphics/GraphicsContextFailureView.d.ts +1 -2
  796. package/src/view/graphics/GraphicsContextFailureView.d.ts.map +1 -1
  797. package/src/view/graphics/GraphicsContextFailureView.js +1 -2
  798. package/src/engine/network/transport/Channel.d.ts +0 -85
  799. package/src/engine/network/transport/Channel.d.ts.map +0 -1
  800. package/src/engine/network/transport/Channel.js +0 -336
  801. package/src/engine/network/transport/ReliableCommandPipeline.d.ts +0 -155
  802. package/src/engine/network/transport/ReliableCommandPipeline.d.ts.map +0 -1
  803. package/src/engine/network/transport/ReliableCommandPipeline.js +0 -335
  804. package/src/engine/network/transport/fragments/FragmentAssembler.d.ts +0 -105
  805. package/src/engine/network/transport/fragments/FragmentAssembler.d.ts.map +0 -1
  806. package/src/engine/network/transport/fragments/FragmentAssembler.js +0 -350
  807. package/src/engine/network/transport/fragments/FragmentRetention.d.ts +0 -103
  808. package/src/engine/network/transport/fragments/FragmentRetention.d.ts.map +0 -1
  809. package/src/engine/network/transport/fragments/FragmentRetention.js +0 -191
  810. package/src/engine/network/transport/fragments/fragment_send.d.ts +0 -61
  811. package/src/engine/network/transport/fragments/fragment_send.d.ts.map +0 -1
  812. package/src/engine/network/transport/fragments/fragment_send.js +0 -157
  813. package/src/engine/network/transport/fragments/packet_size.d.ts +0 -99
  814. package/src/engine/network/transport/fragments/packet_size.d.ts.map +0 -1
  815. package/src/engine/network/transport/fragments/packet_size.js +0 -107
  816. package/src/shade/renderer/shader/chunk/color/sRGB/chunk_RRTAndODTFit.d.ts +0 -6
  817. package/src/shade/renderer/shader/chunk/color/sRGB/chunk_RRTAndODTFit.d.ts.map +0 -1
  818. package/src/shade/renderer/shader/chunk/color/sRGB/chunk_RRTAndODTFit.js +0 -16
  819. package/src/shade/renderer/shader/chunk/color/tonemap/chunk_tonemap_aces.d.ts +0 -7
  820. package/src/shade/renderer/shader/chunk/color/tonemap/chunk_tonemap_aces.d.ts.map +0 -1
  821. package/src/shade/renderer/shader/chunk/color/tonemap/chunk_tonemap_aces.js +0 -46
  822. package/src/shade/renderer/shader/chunk/color/tonemap/chunk_tonemap_agx.d.ts +0 -10
  823. package/src/shade/renderer/shader/chunk/color/tonemap/chunk_tonemap_agx.d.ts.map +0 -1
  824. package/src/shade/renderer/shader/chunk/color/tonemap/chunk_tonemap_agx.js +0 -127
  825. package/src/shade/renderer/shader/chunk/color/tonemap/chunk_tonemap_pbr_neutral.d.ts +0 -7
  826. package/src/shade/renderer/shader/chunk/color/tonemap/chunk_tonemap_pbr_neutral.d.ts.map +0 -1
  827. package/src/shade/renderer/shader/chunk/color/tonemap/chunk_tonemap_pbr_neutral.js +0 -39
@@ -7,14 +7,48 @@ server-authoritative rollback orchestrator, layered over a pluggable transport.
7
7
 
8
8
  | Layer | Pieces | Responsibility |
9
9
  | --- | --- | --- |
10
- | Transport | `transport/adapters/*` (`WebRTCDataChannel`, `WebTransport`, `WebSocket`, `NodeUDP`, `Simulated`, `Loopback`) | Move opaque byte buffers. UDP-style unless `reliable`/`ordered` say otherwise. |
11
- | Channel | `transport/Channel.js` | Seq + ack-bitfield header; surfaces `onPacketAcked` / `onPacketLost` / `onPayload`. No retransmit. |
12
- | Reliability / fragmentation | `transport/ReliableCommandPipeline.js`, `transport/fragments/*` | At-least-once commands; MTU fragmentation + NACK retransmit. |
10
+ | Transport | `transport/adapters/*` (`WebRTCDataChannel`, `WebTransport`, `WebSocket`, `NodeUDP`, `Simulated`, `Loopback`) | Move opaque datagrams of at most `max_datagram_bytes`. UDP-style unless `reliable` says otherwise. |
11
+ | Connection | `transport/connection/*` (`Connection`, `TxStream`, `RxStream`, `RangeSet`) | Numbered packets acknowledged by ranges, loss detection and probe timeout after QUIC; unreliable messages of up to a datagram with a delivery notice; reliable lanes for messages of any size up to `max_message_bytes`, paced. Everything for a peer leaves in as few datagrams as fit, once a tick. Design: [`MESSAGE_TRANSPORT.md`](./MESSAGE_TRANSPORT.md). |
13
12
  | Sim core | `sim/*` (`ActionLog`, `SimAction`, `SimActionExecutor`, `RewindEngine`, `Snapshotter`, registries) | Record/apply/rewind replicated state mutations. |
14
13
  | Replication | `replication/Replicator.js`, `replication/ScopeFilter.js` | Pack/unpack action records per peer, scope-filtered. |
15
14
  | Orchestrator | `orchestrator/NetworkPeer.js`, `orchestrator/ServerAuthoritative{Server,Client}.js` | Per-tick send/recv, rollback (server), predict-reconcile (client). |
16
15
  | Facade | `NetworkSession.js` | One config + lifecycle surface; wires everything below. |
17
16
 
17
+ ## What the session assumes, and what a tick costs
18
+
19
+ The stack is built for fully networked worlds of millions of objects. A tick's cost is in what
20
+ changed and what is owned — never in how many networked entities there are — and that holds only on
21
+ these terms, which the game has to keep:
22
+
23
+ - **Every replicated change goes through the host's action executor.** An action — `send`, a
24
+ client's input — carries its own change. A system that writes a replicated component directly
25
+ (physics moving its bodies, a controller) reports each write:
26
+ `dataset.sendEvent(entity, "net_mutate_component", { component_type })`. The host records the
27
+ component as it stands, at full precision — the wire's quantised image is never written back into
28
+ the host's state. **A write nobody reports stays on the host**: the session never looks for
29
+ changes by itself. (Until 2026-10-15 it compared every replicated component of every networked
30
+ entity at the end of each host step: 7–8 ms a tick for 20,000 entities with nothing changing.)
31
+ - **Ownership is set when a `NetworkIdentity` attaches, or by the join** — never by writing
32
+ `owner_peer_id` or `network_id` afterwards. Each peer's owned entities are indexed when ownership
33
+ is set; what a tick does per owned entity (AUTH_STATE to its owner, the client's record of what it
34
+ predicted) walks that index.
35
+
36
+ Measured (one-component trees, one client, 30 Hz, Node 22, ms per tick):
37
+
38
+ | | ms |
39
+ | --- | --- |
40
+ | Host, 20,000 entities, nothing changing, client synced | 0.01–0.02 (was 14–15) |
41
+ | Client, 20,000 entities, nothing changing | 0.02 (was 0.7) |
42
+ | Host, 100 / 1,000 actions a tick, building them included | 0.4 / 3.8 |
43
+ | Client, applying 100 / 1,000 actions a tick | 1.3 / 4.2 |
44
+
45
+ What does scale with the world, by design:
46
+
47
+ - **A join** sends every networked entity once per joining peer, paged and paced; host memory per
48
+ joiner is the lane's window and 12 bytes an entity (`MESSAGE_TRANSPORT.md` §3.7).
49
+ - **Interpolation**: every networked entity gets an `Interpolated`, and the `InterpolationSystem`
50
+ records and blends each one every frame (below). Not measured at this scale.
51
+
18
52
  ## Smooth by default
19
53
 
20
54
  A game that wires a `NetworkSession` the obvious way renders smoothly at any display rate, with
@@ -47,10 +81,9 @@ nothing else to set up. What that takes, and where it lives:
47
81
  `Interpolated.snap` for a teleport (`PhysicsSystem.setPose` sets it), or
48
82
  `InterpolationSystem.restore()` / `session.normalize_if_dirty()` before writing the truth. A write
49
83
  over a blend without either is a write to a drawn pose, and the next step puts the truth back.
50
- - **The host publishes what changed.** Replicated components the host's simulation wrote directly
51
- (physics, controllers) are published at the end of each step, recorded without being written
52
- back — the host keeps full precision — and nothing an action already carried is sent twice.
53
- `publish_changes: false` to publish by hand.
84
+ - **What travels is what goes through the executor** (see "What the session assumes" above):
85
+ actions, and direct writes reported with `net_mutate_component`, which the host records without
86
+ writing them back — the host keeps full precision.
54
87
  - **Clients reconcile by comparison** (`reconcile: 'correct'`, the default): the host's state for
55
88
  frame S is compared with what the client predicted for S, and a component that differs is
56
89
  carried into the present by its `Correction` (`network/correction`) — the session knows no
@@ -62,7 +95,13 @@ nothing else to set up. What that takes, and where it lives:
62
95
  the action-log rewind + replay, exact for simulations made only of deterministic actions.
63
96
  - **Late input is applied, not rolled back** (`late_input: 'apply'`, host default). Input
64
97
  buffering (`simulation_delay_ticks`) and time dilation keep input on time; the client's per-tick
65
- `FRAME_MARKER` keeps the dilation honest when it sends no input.
98
+ `FRAME_MARKER` keeps the dilation honest when it sends no input. Input older than the host's
99
+ window (`frame_capacity`) is dropped and reported (`onPendingActionDropped`, `'window'`).
100
+ - **A record is known by its frame and its place in it, never by its bytes.** The action stream
101
+ re-sends every unconfirmed frame each tick; the host tells the copies from new input by
102
+ `(sender, frame, ordinal)`, the ordinal being the record's index in the sender's frame, carried
103
+ on the wire. Two inputs alike in every byte — a held key, frame after frame, or two identical
104
+ actions in one frame — are two inputs, late and folded into one host frame or not.
66
105
 
67
106
  Things the session cannot fix for the game:
68
107
 
@@ -94,34 +133,71 @@ connection:
94
133
  is ever sent, on this connection or a later one that resumes it: that input was predicted on a
95
134
  world that is gone. The client's input starts at the frame the snapshot sets its counter to.
96
135
 
97
- The first answer is the answer. The host sends each `INITIAL_SYNC` more than once, against loss,
98
- and a host that has finished with a client's old session readmits its new connection as a fresh
99
- peer before it reads the `RESUME_HELLO` on it — so a `RESUME_REJECT` can arrive after the snapshot it
100
- announces. A client acts on neither once the connection has its answer: the copies would put what it
101
- owns back behind input it has already sent, and the reject would throw away the token the snapshot
102
- issued.
136
+ The first answer is the answer. A host that has finished with a client's old session readmits its
137
+ new connection as a fresh peer before it reads the `RESUME_HELLO` on it — so a `RESUME_REJECT` can
138
+ arrive after the snapshot it announces. The snapshot's first page is the answer: a client acts on no
139
+ later accept or reject on that connection, and the reconnect ladder stops there, so a join that takes
140
+ a while is not torn down and restarted by the next attempt.
103
141
 
104
142
  The host keeps to the same rule from its side, because what a peer can make it do has to be bounded
105
143
  by what the host decided, not by how often the peer asks. It answers a connection's `RESUME_HELLO`
106
- once and ignores any later one on that connection, and it sends a connection its `INITIAL_SYNC` —
107
- the copies against loss included — once, when it takes the connection for a fresh peer: as it binds
108
- it, or after refusing the connection's claim to resume. Each is the whole world, serialized; no
109
- number of claims buys another. A connection here is a transport the host binds with `connect()`, so
144
+ once and ignores any later one on that connection, and it gives a connection one join, when it takes
145
+ the connection for a fresh peer: as it binds it, or after refusing the connection's claim to resume.
146
+ A join is the whole world, once, and then what changed while it was going out, for at most eight
147
+ rounds; no number of claims buys another. A peer that drops before its join finished is never
148
+ resumed: it holds part of a world. A connection here is a transport the host binds with `connect()`, so
110
149
  a reconnect has to reach the host as a new one — the fresh transport a `transport_factory` returns,
111
150
  bound once the host has seen the old one end. One that lands on a connection the host still holds
112
151
  is a second claim on that connection, and is not sent the world again.
113
152
 
114
- A chunk of a fragmented message that goes missing — of an `INITIAL_SYNC`, typically — is re-sent when
115
- the receiver asks with a `NACK_FRAGMENT`, and that repair is bounded the same way. A NACK re-sends
116
- each chunk of the message at most once however many times it names it, and nothing for an index the
117
- message does not have; the host answers three NACKs per message. So repair adds at most three copies
118
- of any message the host chose to send.
153
+ ### Joining a world of any size
154
+
155
+ A join is pages of whole entities on the connection's paced BULK lane, each built when it is sent;
156
+ what is lost is re-sent by the lane. The host holds the joining peer's action stream and AUTH_STATE
157
+ meanwhile. A round that goes out within one tick is built at one frame D and is the last: the FINAL
158
+ page follows it, and the action stream is released from D + 1. The first round — the whole world —
159
+ gets one tick's budget (256 KiB); a larger world goes out over as many ticks as the lane's window
160
+ takes, and when it has all arrived, every entity changed since its page — by an action the host's
161
+ executor ran — or created since, is the next round, which may fill the lane. The client holds the
162
+ action stream and AUTH_STATE from `connect()` until its world is whole, applies each page as it
163
+ lands, and on FINAL seeks its frame counter to the host's newest frame, forgets what it predicted on
164
+ the partial world, applies what it held, releases its own input and fires `onSynced`. Host memory
165
+ per joining peer is the lane's window and 12 bytes per entity; client memory is a page and what it
166
+ holds, at most `max_queued_bytes`.
167
+
168
+ ### A client that stalls
169
+
170
+ A client in a background tab takes no steps (`Ticker` suspends, and discards the gap when the tab
171
+ returns), and neither does one under a debugger or with the lid shut; the host runs on, and what it
172
+ sent is waiting in the client's held transport. Two things happen on the first steps back, keyed on
173
+ what the session sees and never on the page's visibility:
174
+
175
+ - **More than the host's input window behind** (`frame_capacity`, 32 frames), the client re-takes the
176
+ host's time — the host names its frame in every TIME_DILATION packet — exactly as a snapshot sets
177
+ it: the counter moves to the host's frame plus the lead, what was predicted on the old numbering is
178
+ dropped, and input starts again from there. `stall_count` counts these. Inside the window the time
179
+ dilation closes the gap on its own, at 5% of a frame per frame, with the input applied late
180
+ meanwhile. Measured before the rule: 20 × the stall to recover, and every input trimmed until the
181
+ gap was inside the window.
182
+ - **Silent past `connection_timeout_ms`**, the client has been reaped into the host's grace window and
183
+ its transport closed, so the close is waiting behind the held packets: the reconnect ladder runs on
184
+ the first step back, and the host, whose log no longer reaches the client's last ack, sends its
185
+ world again. A transport with no close of its own (`NodeUDP`) leaves the client to find out through
186
+ its own silence budget, which runs on frame time and so starts again when the client does.
187
+
188
+ ### A connection that breaks
189
+
190
+ A connection does not authenticate datagrams; its transport delivers only the peer's (DTLS, TLS, and
191
+ `NodeUDP` by source address). When a connection stops being whole — a peer past its limits, or an
192
+ acknowledgement of a packet never sent, the mark of a datagram that was not the peer's — the session
193
+ handles it as a dropped transport and closes the transport: the host puts the peer in its grace
194
+ window and the client resumes on a new connection. See [`MESSAGE_TRANSPORT.md`](./MESSAGE_TRANSPORT.md) §3.9.
119
195
 
120
196
  ## Wired automatically by `NetworkSession`
121
197
 
122
- `NetworkPeer` (and through it `Channel`, `Replicator`, `ActionLog`,
123
- `SimActionExecutor`, the registries, `ReplicationSlotTable`, `Baseline`,
124
- the fragment layer, and `ReliableCommandPipeline`), the two orchestrators
198
+ `NetworkPeer` (and through it a `Connection` per peer, `Replicator`, `ActionLog`,
199
+ `SimActionExecutor`, the registries, `ReplicationSlotTable`, `Baseline`, and the
200
+ host's `HostJoin`s), the two orchestrators
125
201
  (and through them `RewindEngine` and `InputRing`), plus `TimeDilation`,
126
202
  `AdaptiveRenderDelay`, `RenderPlayout`, `InterpolationLog`, `NetworkSystem`,
127
203
  `NetworkIdentity`, `Snapshotter`, `SmoothingState` (through the
@@ -149,7 +225,7 @@ If you wire one of these into the facade, move its row up to the section above.
149
225
 
150
226
  ## Deferred / known gaps
151
227
 
152
- - **Congestion control / send pacing** — there is none on the meep-owned send
153
- path. Masked on the browser transports (DTLS/SCTP, TLS/TCP do it underneath);
228
+ - **Congestion control** — the send rate is a fixed token bucket
229
+ (`send_rate_bytes_per_second`); nothing adapts it to the link. Masked on the browser transports (DTLS/SCTP, TLS/TCP do it underneath);
154
230
  only matters for raw `NodeUDP` / `Simulated` on constrained links. Design and
155
231
  rationale for the deferral are in [`CONGESTION_CONTROL.md`](./CONGESTION_CONTROL.md).
@@ -92,7 +92,15 @@ avoided is corrected again by the next AUTH_STATE).
92
92
  The action-log rewind + replay path stays, as an opt-in (`reconcile: 'replay'`), for games whose
93
93
  predicted state is entirely produced by deterministic `SimAction`s and that want exactness.
94
94
 
95
- **The host publishes what changed.** At the end of every host step, each replicated component of
95
+ **Superseded 2026-10-15: the host no longer looks for changes.** What follows describes the
96
+ end-of-step comparison as built. It cost every host tick a pass over every networked entity — 7–8 ms
97
+ for 20,000 entities with nothing changing — and the stack is for worlds of millions. It is gone: what
98
+ travels is what goes through the executor, actions and direct writes reported with
99
+ `net_mutate_component`, which the host records (`executor.record`, no write-back, D9's second half
100
+ kept fixed). A direct write nobody reports stays on the host — D9's first half is the contract now,
101
+ stated in the README's "What the session assumes".
102
+
103
+ **The host publishes what changed** (as built, superseded above). At the end of every host step, each replicated component of
96
104
  each networked entity is encoded with its replication adapter and compared with what was last
97
105
  published; changed ones go out as `ReplaceComponentAction` records. They are recorded without
98
106
  applying (the host's live state is not overwritten with its quantised wire image — D9) and
@@ -171,9 +179,9 @@ path stays for `ServerAuthoritativeServer` users and for `reconcile: 'replay'` s
171
179
  no component type, and no physics. `POSE_CORRECTION` (Transform64, through physics for a body,
172
180
  hidden by `InterpolationSystem.correct`), `VELOCITY_CORRECTION` and `HOST_VALUE_CORRECTION` are
173
181
  given. `reconcile: 'correct' | 'replay'`, default `'correct'`.
174
- - Host: publishes changed replicated state at the end of each step, against a baseline of what the
175
- peers hold that every executed action also updates; `late_input: 'apply' | 'rollback'`, default
176
- `'apply'`.
182
+ - Host: ~~publishes changed replicated state at the end of each step~~ (removed 2026-10-15: what
183
+ travels is what goes through the executor; a reported direct write is recorded, not executed);
184
+ `late_input: 'apply' | 'rollback'`, default `'apply'`.
177
185
 
178
186
  ### Orchestrators
179
187
  - `ServerAuthoritativeServer`: `begin_tick(frame)` / `end_tick()` split, so the EM's systems run
@@ -204,7 +212,7 @@ path stays for `ServerAuthoritativeServer` users and for `reconcile: 'replay'` s
204
212
  the next step. This was the rule for interpolated physics bodies already; it now holds for every
205
213
  `Interpolated` entity. **Behaviour change** for code that relied on the old absence of any restore
206
214
  for non-physics entities.
207
- - Peer ids are `[0, 252]`; 253 is `SENDER_RECORDED`.
215
+ - Peer ids are `[0, 251]`; 252 is `SENDER_CORRECTED`, 253 is `SENDER_RECORDED`.
208
216
  - `PhysicsSystem.interpolationLog` is deprecated (ignored, warns once).
209
217
  - Wire format: a new `FRAME_MARKER` packet; nothing else.
210
218
  - `scene-editor`'s `RemotePresence` (the only in-repo `registerSource` user) needed one change: a
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Aggregates `getStats()` snapshots from one or more named sources (typically
3
- * a `Transport`, `Channel`, or `NetworkPeer.channel_for(peer)`) and reports
3
+ * a `Transport`, or `NetworkPeer.connection_for(peer)`) and reports
4
4
  * recent throughput rates.
5
5
  *
6
6
  * Per-source stats are queried via the source's `getStats()` method. A "sample"
@@ -2,7 +2,7 @@ import { assert } from "../../../core/assert.js";
2
2
 
3
3
  /**
4
4
  * Aggregates `getStats()` snapshots from one or more named sources (typically
5
- * a `Transport`, `Channel`, or `NetworkPeer.channel_for(peer)`) and reports
5
+ * a `Transport`, or `NetworkPeer.connection_for(peer)`) and reports
6
6
  * recent throughput rates.
7
7
  *
8
8
  * Per-source stats are queried via the source's `getStats()` method. A "sample"
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Bytes of entity records a page is filled to. A page is a BULK message, so this is also how much
3
+ * the receiver holds of a join at a time. An entity larger than this is a page by itself.
4
+ */
5
+ export const JOIN_PAGE_BYTES: number;
6
+ /**
7
+ * Bytes of pages the first round — the whole world — may queue in one tick to finish there. A
8
+ * round that finishes in one tick is the join's last: every entity it carries is at the same
9
+ * frame, and every entity it leaves out is unchanged since its state went out, so the receiver
10
+ * holds the whole world at that frame. A world larger than this goes out over several ticks, paced
11
+ * by the lane's window, and a catch-up round follows.
12
+ *
13
+ * A catch-up round always tries to finish in its tick, with what the BULK lane may still hold as
14
+ * its budget: what changed while a world went out is a fraction of it, and a round that may only
15
+ * page would never shrink for a world that changes faster than a tick's budget.
16
+ */
17
+ export const JOIN_FINAL_ROUND_BYTES: number;
18
+ /**
19
+ * Catch-up rounds a join may take before it is given up. A catch-up round finishes in its tick
20
+ * unless what changed outgrows what the BULK lane may hold, so a join that needs more than one or
21
+ * two is a world changing faster than a peer can be sent it.
22
+ */
23
+ export const JOIN_MAX_ROUNDS: 8;
24
+ /**
25
+ * What a join has to say after {@link HostJoinadvance }.
26
+ */
27
+ export type JoinProgress = number;
28
+ /**
29
+ * What a join has to say after {@link HostJoin#advance}.
30
+ * @readonly
31
+ * @enum {number}
32
+ */
33
+ export const JoinProgress: Readonly<{
34
+ /** Pages are going out, or the host is waiting to hear they arrived. */
35
+ Sending: 0;
36
+ /**
37
+ * The FINAL page has arrived: the peer holds the whole world. (Its action stream was released
38
+ * when FINAL was queued.)
39
+ */
40
+ Done: 1;
41
+ /** The world changed faster than it could be sent, round after round: drop the peer. */
42
+ DidNotConverge: 2;
43
+ }>;
44
+ /**
45
+ * The host's side of one peer joining: the world, sent as pages built when they go out, then what
46
+ * changed meanwhile, until the peer holds every entity's state at one frame. See
47
+ * `network/MESSAGE_TRANSPORT.md`, "Joining a world of any size".
48
+ *
49
+ * 1. The peer's action stream is held from the start (the caller holds it).
50
+ * 2. A round starts with a list of entities. If its pages fit {@link JOIN_FINAL_ROUND_BYTES}, they
51
+ * all go in the tick the round starts, at that frame D; the FINAL page follows them, and the
52
+ * peer's action stream is released from D + 1. The join is over. (The stream's datagrams can
53
+ * overtake the last pages; the peer holds the stream until FINAL — `NetworkPeer.hold_inbound`.)
54
+ * 3. Otherwise the round's pages go out over as many ticks as it takes, each built at the frame it
55
+ * is sent, while the BULK lane has less than {@link window_bytes} unacknowledged. Each entity's
56
+ * network id is noted with the frame its state was sent at. Host memory: the window, and 8
57
+ * bytes per entity.
58
+ * 4. When every page of such a round has arrived, every networked entity is checked: one changed
59
+ * since its state was sent (`NetworkPeer.last_changed_frame`), or created since, is the next
60
+ * round's list. An empty list ends the join with the FINAL page alone.
61
+ *
62
+ * The first round is the world. For a world that fits one tick's budget, the join is one tick.
63
+ *
64
+ * Built per join; allocates its id list and send-frame table once and grows them, nothing per tick.
65
+ *
66
+ * @author Alex Goldring
67
+ * @copyright Company Named Limited (c) 2026
68
+ */
69
+ export class HostJoin {
70
+ /**
71
+ * @param {{
72
+ * peer: import("./NetworkPeer.js").NetworkPeer,
73
+ * peer_id: number,
74
+ * session_token: Uint8Array,
75
+ * world: import("../../ecs/EntityComponentDataset.js").EntityComponentDataset,
76
+ * for_each_entity: function(function(number): void): void,
77
+ * page_buffer: BinaryBuffer,
78
+ * window_bytes: number,
79
+ * }} options
80
+ * `for_each_entity(cb)` visits every networked entity id. `page_buffer` is scratch the caller
81
+ * may share between joins. `window_bytes` is how far ahead of the peer's acknowledgements
82
+ * pages are built.
83
+ */
84
+ constructor({ peer, peer_id, session_token, world, for_each_entity, page_buffer, window_bytes }: {
85
+ peer: import("./NetworkPeer.js").NetworkPeer;
86
+ peer_id: number;
87
+ session_token: Uint8Array;
88
+ world: import("../../ecs/EntityComponentDataset.js").EntityComponentDataset;
89
+ for_each_entity: (arg0: (arg0: number) => void) => void;
90
+ page_buffer: BinaryBuffer;
91
+ window_bytes: number;
92
+ });
93
+ peer: import("./NetworkPeer.js").NetworkPeer;
94
+ peer_id: number;
95
+ session_token: Uint8Array;
96
+ world: import("../../ecs/EntityComponentDataset.js").EntityComponentDataset;
97
+ for_each_entity: (arg0: (arg0: number) => void) => void;
98
+ page_buffer: BinaryBuffer;
99
+ window_bytes: number;
100
+ /** Catch-up rounds taken so far. */
101
+ get round(): number;
102
+ /**
103
+ * One tick of the join, at `frame` — the frame just simulated and published.
104
+ * @param {number} frame
105
+ * @returns {JoinProgress}
106
+ */
107
+ advance(frame: number): JoinProgress;
108
+ #private;
109
+ }
110
+ import { BinaryBuffer } from "../../../core/binary/BinaryBuffer.js";
111
+ //# sourceMappingURL=HostJoin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HostJoin.d.ts","sourceRoot":"","sources":["../../../../../src/engine/network/orchestrator/HostJoin.js"],"names":[],"mappings":"AAKA;;;GAGG;AACH,qCAAyC;AAEzC;;;;;;;;;;GAUG;AACH,4CAAiD;AAEjD;;;;GAIG;AACH,gCAAiC;;;;2BAKvB,MAAM;AAHhB;;;;GAIG;AACH;IACI,wEAAwE;;IAExE;;;OAGG;;IAEH,wFAAwF;;GAEzF;AAOH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH;IAcI;;;;;;;;;;;;;OAaG;IACH,iGAbW;QACV,IAAQ,EAAE,OAAO,kBAAkB,EAAE,WAAW,CAAC;QACjD,OAAW,EAAE,MAAM,CAAC;QACpB,aAAiB,EAAE,UAAU,CAAC;QAC9B,KAAS,EAAE,OAAO,qCAAqC,EAAE,sBAAsB,CAAC;QAChF,eAAmB,gBAAoB,MAAM,KAAG,IAAI,KAAG,IAAI,CAAC;QAC5D,WAAe,EAAE,YAAY,CAAC;QAC9B,YAAgB,EAAE,MAAM,CAAC;KACtB,EAgBH;IAVG,6CAAgB;IAChB,gBAAsB;IACtB,0BAAkC;IAClC,4EAAkB;IAClB,+BAboC,MAAM,KAAG,IAAI,KAAG,IAAI,CAalB;IACtC,0BAA8B;IAC9B,qBAAgC;IAMpC,oCAAoC;IACpC,oBAEC;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,YAAY,CA6DxB;;CAkFJ;6BA9Q4B,sCAAsC"}
@@ -0,0 +1,271 @@
1
+ import { BinaryBuffer } from "../../../core/binary/BinaryBuffer.js";
2
+ import { snapshotter_write_entity } from "../sim/Snapshotter.js";
3
+ import { Lane } from "../transport/connection/Connection.js";
4
+ import { InitialSyncPage } from "./NetworkPeer.js";
5
+
6
+ /**
7
+ * Bytes of entity records a page is filled to. A page is a BULK message, so this is also how much
8
+ * the receiver holds of a join at a time. An entity larger than this is a page by itself.
9
+ */
10
+ export const JOIN_PAGE_BYTES = 16 * 1024;
11
+
12
+ /**
13
+ * Bytes of pages the first round — the whole world — may queue in one tick to finish there. A
14
+ * round that finishes in one tick is the join's last: every entity it carries is at the same
15
+ * frame, and every entity it leaves out is unchanged since its state went out, so the receiver
16
+ * holds the whole world at that frame. A world larger than this goes out over several ticks, paced
17
+ * by the lane's window, and a catch-up round follows.
18
+ *
19
+ * A catch-up round always tries to finish in its tick, with what the BULK lane may still hold as
20
+ * its budget: what changed while a world went out is a fraction of it, and a round that may only
21
+ * page would never shrink for a world that changes faster than a tick's budget.
22
+ */
23
+ export const JOIN_FINAL_ROUND_BYTES = 256 * 1024;
24
+
25
+ /**
26
+ * Catch-up rounds a join may take before it is given up. A catch-up round finishes in its tick
27
+ * unless what changed outgrows what the BULK lane may hold, so a join that needs more than one or
28
+ * two is a world changing faster than a peer can be sent it.
29
+ */
30
+ export const JOIN_MAX_ROUNDS = 8;
31
+
32
+ /**
33
+ * What a join has to say after {@link HostJoin#advance}.
34
+ * @readonly
35
+ * @enum {number}
36
+ */
37
+ export const JoinProgress = Object.freeze({
38
+ /** Pages are going out, or the host is waiting to hear they arrived. */
39
+ Sending: 0,
40
+ /**
41
+ * The FINAL page has arrived: the peer holds the whole world. (Its action stream was released
42
+ * when FINAL was queued.)
43
+ */
44
+ Done: 1,
45
+ /** The world changed faster than it could be sent, round after round: drop the peer. */
46
+ DidNotConverge: 2,
47
+ });
48
+
49
+ const PHASE_PAGING = 0;
50
+ const PHASE_AWAITING = 1;
51
+ /** FINAL is queued and the stream released; the join is over once FINAL has arrived */
52
+ const PHASE_FINAL_SENT = 2;
53
+
54
+ /**
55
+ * The host's side of one peer joining: the world, sent as pages built when they go out, then what
56
+ * changed meanwhile, until the peer holds every entity's state at one frame. See
57
+ * `network/MESSAGE_TRANSPORT.md`, "Joining a world of any size".
58
+ *
59
+ * 1. The peer's action stream is held from the start (the caller holds it).
60
+ * 2. A round starts with a list of entities. If its pages fit {@link JOIN_FINAL_ROUND_BYTES}, they
61
+ * all go in the tick the round starts, at that frame D; the FINAL page follows them, and the
62
+ * peer's action stream is released from D + 1. The join is over. (The stream's datagrams can
63
+ * overtake the last pages; the peer holds the stream until FINAL — `NetworkPeer.hold_inbound`.)
64
+ * 3. Otherwise the round's pages go out over as many ticks as it takes, each built at the frame it
65
+ * is sent, while the BULK lane has less than {@link window_bytes} unacknowledged. Each entity's
66
+ * network id is noted with the frame its state was sent at. Host memory: the window, and 8
67
+ * bytes per entity.
68
+ * 4. When every page of such a round has arrived, every networked entity is checked: one changed
69
+ * since its state was sent (`NetworkPeer.last_changed_frame`), or created since, is the next
70
+ * round's list. An empty list ends the join with the FINAL page alone.
71
+ *
72
+ * The first round is the world. For a world that fits one tick's budget, the join is one tick.
73
+ *
74
+ * Built per join; allocates its id list and send-frame table once and grows them, nothing per tick.
75
+ *
76
+ * @author Alex Goldring
77
+ * @copyright Company Named Limited (c) 2026
78
+ */
79
+ export class HostJoin {
80
+ /** entity ids still to send this round */
81
+ #entities;
82
+ #count = 0;
83
+ #cursor = 0;
84
+ /** network id → frame its state was last sent at, -1 for never */
85
+ #sent_frame = new Float64Array(256).fill(-1);
86
+ #round = 0;
87
+ #phase = PHASE_PAGING;
88
+ #mark = -1;
89
+ #first_sent = false;
90
+ /** the first round's list is the world as it is when the join first advances */
91
+ #started = false;
92
+
93
+ /**
94
+ * @param {{
95
+ * peer: import("./NetworkPeer.js").NetworkPeer,
96
+ * peer_id: number,
97
+ * session_token: Uint8Array,
98
+ * world: import("../../ecs/EntityComponentDataset.js").EntityComponentDataset,
99
+ * for_each_entity: function(function(number): void): void,
100
+ * page_buffer: BinaryBuffer,
101
+ * window_bytes: number,
102
+ * }} options
103
+ * `for_each_entity(cb)` visits every networked entity id. `page_buffer` is scratch the caller
104
+ * may share between joins. `window_bytes` is how far ahead of the peer's acknowledgements
105
+ * pages are built.
106
+ */
107
+ constructor({ peer, peer_id, session_token, world, for_each_entity, page_buffer, window_bytes }) {
108
+ this.peer = peer;
109
+ this.peer_id = peer_id;
110
+ this.session_token = session_token;
111
+ this.world = world;
112
+ this.for_each_entity = for_each_entity;
113
+ this.page_buffer = page_buffer;
114
+ this.window_bytes = window_bytes;
115
+
116
+ this.#entities = new Int32Array(64);
117
+ this.#count = 0;
118
+ }
119
+
120
+ /** Catch-up rounds taken so far. */
121
+ get round() {
122
+ return this.#round;
123
+ }
124
+
125
+ /**
126
+ * One tick of the join, at `frame` — the frame just simulated and published.
127
+ * @param {number} frame
128
+ * @returns {JoinProgress}
129
+ */
130
+ advance(frame) {
131
+ const connection = this.peer.connection_for(this.peer_id);
132
+ if (connection === undefined) return JoinProgress.Sending;
133
+
134
+ if (!this.#started) {
135
+ // the world at the first frame the join runs on, not at connect: what is built between
136
+ // the two is part of it
137
+ this.#started = true;
138
+ this.for_each_entity(this.#push_entity);
139
+ }
140
+
141
+ if (this.#phase === PHASE_FINAL_SENT) {
142
+ // Over only once FINAL has arrived: until then the peer holds part of a world, and a
143
+ // peer that drops now must not be resumed into it.
144
+ return connection.is_delivered(Lane.BULK, this.#mark) ? JoinProgress.Done : JoinProgress.Sending;
145
+ }
146
+
147
+ for (; ;) {
148
+ if (this.#phase === PHASE_PAGING) {
149
+ if (this.#cursor === 0) {
150
+ // A round starting now: if it all goes in this tick, it is the last. The world
151
+ // is held to one tick's budget; a catch-up round may fill the lane, leaving
152
+ // room for one more page of the largest a message may be.
153
+ const lane_room = connection.max_queued_bytes - connection.unacked_bytes(Lane.BULK)
154
+ - connection.max_message_bytes;
155
+ const budget = this.#round === 0 ? Math.min(JOIN_FINAL_ROUND_BYTES, lane_room) : lane_room;
156
+ let queued = 0;
157
+ while (this.#cursor < this.#count && queued < budget) {
158
+ queued += this.#send_page(frame, 0);
159
+ }
160
+ if (this.#cursor >= this.#count) {
161
+ this.#send_page(frame, InitialSyncPage.FINAL);
162
+ this.peer.release_outbound(this.peer_id, frame + 1);
163
+ this.#phase = PHASE_FINAL_SENT;
164
+ return JoinProgress.Sending;
165
+ }
166
+ }
167
+ while (this.#cursor < this.#count && connection.unacked_bytes(Lane.BULK) < this.window_bytes) {
168
+ this.#send_page(frame, 0);
169
+ }
170
+ if (this.#cursor < this.#count) return JoinProgress.Sending;
171
+ this.#phase = PHASE_AWAITING;
172
+ }
173
+
174
+ // every page of the round has been queued: has it all arrived?
175
+ if (!connection.is_delivered(Lane.BULK, this.#mark)) return JoinProgress.Sending;
176
+
177
+ this.#collect_changed();
178
+ if (this.#count === 0) {
179
+ this.#send_page(frame, InitialSyncPage.FINAL);
180
+ this.peer.release_outbound(this.peer_id, frame + 1);
181
+ this.#phase = PHASE_FINAL_SENT;
182
+ return JoinProgress.Sending;
183
+ }
184
+ this.#round++;
185
+ if (this.#round > JOIN_MAX_ROUNDS) return JoinProgress.DidNotConverge;
186
+ this.#cursor = 0;
187
+ this.#phase = PHASE_PAGING;
188
+ }
189
+ }
190
+
191
+ /**
192
+ * Fill and queue the next page from the cursor, or an empty one when `flags` asks for FINAL.
193
+ * @param {number} frame
194
+ * @param {number} flags
195
+ * @returns {number} bytes of entity records queued
196
+ */
197
+ #send_page(frame, flags) {
198
+ const buffer = this.page_buffer;
199
+ const slot_table = this.peer.slot_table;
200
+ buffer.position = 0;
201
+ buffer.writeUint32(0); // entity count, written at the end
202
+
203
+ let written = 0;
204
+ if ((flags & InitialSyncPage.FINAL) === 0) {
205
+ while (this.#cursor < this.#count) {
206
+ const entity_id = this.#entities[this.#cursor];
207
+ const network_id = slot_table.network_for(entity_id);
208
+ if (network_id < 0) {
209
+ // gone since the round began
210
+ this.#cursor++;
211
+ continue;
212
+ }
213
+ if (written > 0 && buffer.position >= JOIN_PAGE_BYTES) break;
214
+ snapshotter_write_entity(buffer, this.world, slot_table, this.peer.component_registry, entity_id);
215
+ this.#set_sent(network_id, frame);
216
+ written++;
217
+ this.#cursor++;
218
+ }
219
+ }
220
+
221
+ const end = buffer.position;
222
+ buffer.position = 0;
223
+ buffer.writeUint32(written);
224
+ buffer.position = end;
225
+
226
+ if (!this.#first_sent) {
227
+ flags |= InitialSyncPage.FIRST;
228
+ this.#first_sent = true;
229
+ }
230
+ this.#mark = this.peer.send_sync_page(this.peer_id, this.session_token, frame, flags, buffer.raw_bytes, end);
231
+ return end;
232
+ }
233
+
234
+ /**
235
+ * The next round's list: networked entities changed since their state was sent, or never sent.
236
+ */
237
+ #collect_changed() {
238
+ this.#count = 0;
239
+ this.for_each_entity(this.#push_if_changed);
240
+ }
241
+
242
+ /** @type {function(number): void} */
243
+ #push_entity = (entity_id) => {
244
+ if (this.#count === this.#entities.length) {
245
+ const next = new Int32Array(this.#entities.length * 2);
246
+ next.set(this.#entities);
247
+ this.#entities = next;
248
+ }
249
+ this.#entities[this.#count++] = entity_id;
250
+ };
251
+
252
+ /** @type {function(number): void} */
253
+ #push_if_changed = (entity_id) => {
254
+ const network_id = this.peer.slot_table.network_for(entity_id);
255
+ if (network_id < 0) return;
256
+ const sent = network_id < this.#sent_frame.length ? this.#sent_frame[network_id] : -1;
257
+ if (sent >= 0 && this.peer.last_changed_frame(network_id) <= sent) return;
258
+ this.#push_entity(entity_id);
259
+ };
260
+
261
+ #set_sent(network_id, frame) {
262
+ if (network_id >= this.#sent_frame.length) {
263
+ let size = this.#sent_frame.length * 2;
264
+ while (size <= network_id) size *= 2;
265
+ const next = new Float64Array(size).fill(-1);
266
+ next.set(this.#sent_frame);
267
+ this.#sent_frame = next;
268
+ }
269
+ this.#sent_frame[network_id] = frame;
270
+ }
271
+ }