@driftengine/core 4.4.2 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (339) hide show
  1. package/CHANGELOG.json +97 -0
  2. package/README.md +1 -1
  3. package/dist/geometry/boxCsg.d.ts +28 -0
  4. package/dist/geometry/boxCsg.js +139 -0
  5. package/dist/geometry/csg.d.ts +36 -0
  6. package/dist/geometry/csg.js +329 -0
  7. package/dist/geometry/meshBuilder.js +13 -0
  8. package/dist/geometry/meshConcat.js +1 -0
  9. package/dist/geometry/pixelFont.js +2 -0
  10. package/dist/geometry/solid.d.ts +61 -0
  11. package/dist/geometry/solid.js +152 -0
  12. package/dist/geometry/solidFlat.d.ts +35 -0
  13. package/dist/geometry/solidFlat.js +428 -0
  14. package/dist/geometry/solidHarness.d.ts +19 -0
  15. package/dist/geometry/solidHarness.js +66 -0
  16. package/dist/geometry/solidNormals.d.ts +17 -0
  17. package/dist/geometry/solidNormals.js +86 -0
  18. package/dist/geometry/solidRound.d.ts +41 -0
  19. package/dist/geometry/solidRound.js +323 -0
  20. package/dist/geometry/solidWriter.d.ts +16 -0
  21. package/dist/geometry/solidWriter.js +42 -0
  22. package/dist/index.d.ts +28 -3
  23. package/dist/index.js +20 -1
  24. package/dist/render/backend/api.d.ts +34 -14
  25. package/dist/render/backend/drawFog.d.ts +26 -0
  26. package/dist/render/backend/drawFog.js +30 -0
  27. package/dist/render/backend/materialChanges.d.ts +2 -1
  28. package/dist/render/backend/materialChanges.js +6 -1
  29. package/dist/render/backend/webgl2/glassTintPrograms.d.ts +13 -0
  30. package/dist/render/backend/webgl2/glassTintPrograms.js +38 -0
  31. package/dist/render/backend/webgl2/instanced.d.ts +24 -5
  32. package/dist/render/backend/webgl2/instanced.js +72 -15
  33. package/dist/render/backend/webgl2/renderer.d.ts +201 -16
  34. package/dist/render/backend/webgl2/renderer.js +596 -224
  35. package/dist/render/backend/webgpu/buffers.d.ts +29 -1
  36. package/dist/render/backend/webgpu/buffers.js +61 -4
  37. package/dist/render/backend/webgpu/depthPass.d.ts +1 -1
  38. package/dist/render/backend/webgpu/depthPass.js +7 -2
  39. package/dist/render/backend/webgpu/drawCommand.d.ts +5 -0
  40. package/dist/render/backend/webgpu/drawCommand.js +1 -0
  41. package/dist/render/backend/webgpu/flatPass.d.ts +6 -1
  42. package/dist/render/backend/webgpu/flatPass.js +57 -9
  43. package/dist/render/backend/webgpu/glassTintPass.d.ts +28 -0
  44. package/dist/render/backend/webgpu/glassTintPass.js +206 -0
  45. package/dist/render/backend/webgpu/gpuDrivenPass.d.ts +60 -1
  46. package/dist/render/backend/webgpu/gpuDrivenPass.js +305 -5
  47. package/dist/render/backend/webgpu/instanceCullPass.d.ts +34 -0
  48. package/dist/render/backend/webgpu/instanceCullPass.js +144 -0
  49. package/dist/render/backend/webgpu/instanced.d.ts +23 -2
  50. package/dist/render/backend/webgpu/instanced.js +41 -4
  51. package/dist/render/backend/webgpu/latePass.d.ts +30 -0
  52. package/dist/render/backend/webgpu/latePass.js +140 -0
  53. package/dist/render/backend/webgpu/lightVolumePass.js +5 -1
  54. package/dist/render/backend/webgpu/motionPass.d.ts +95 -0
  55. package/dist/render/backend/webgpu/motionPass.js +491 -0
  56. package/dist/render/backend/webgpu/pipelineCache.d.ts +10 -1
  57. package/dist/render/backend/webgpu/pipelineCache.js +11 -1
  58. package/dist/render/backend/webgpu/pointGlassTintPass.d.ts +32 -0
  59. package/dist/render/backend/webgpu/pointGlassTintPass.js +193 -0
  60. package/dist/render/backend/webgpu/pointShadowPass.d.ts +35 -6
  61. package/dist/render/backend/webgpu/pointShadowPass.js +105 -20
  62. package/dist/render/backend/webgpu/postPass.d.ts +3 -13
  63. package/dist/render/backend/webgpu/renderer.d.ts +271 -64
  64. package/dist/render/backend/webgpu/renderer.js +1395 -580
  65. package/dist/render/backend/webgpu/scatterPass.js +2 -1
  66. package/dist/render/backend/webgpu/sdfTextPass.js +6 -1
  67. package/dist/render/backend/webgpu/shaders/instanceCull.wgsl.d.ts +18 -0
  68. package/dist/render/backend/webgpu/shaders/instanceCull.wgsl.js +59 -0
  69. package/dist/render/backend/webgpu/skinPaletteRing.d.ts +4 -0
  70. package/dist/render/backend/webgpu/skinPaletteRing.js +4 -0
  71. package/dist/render/backend/webgpu/snapshotMips.d.ts +29 -0
  72. package/dist/render/backend/webgpu/snapshotMips.js +52 -0
  73. package/dist/render/backend/webgpu/surfaceTexturePass.d.ts +22 -3
  74. package/dist/render/backend/webgpu/surfaceTexturePass.js +78 -39
  75. package/dist/render/driftLight/bake.d.ts +7 -0
  76. package/dist/render/driftLight/bake.js +61 -56
  77. package/dist/render/driftLight/denseField.d.ts +46 -0
  78. package/dist/render/driftLight/denseField.js +109 -0
  79. package/dist/render/driftLight/lightField.d.ts +10 -5
  80. package/dist/render/driftLight/lightField.js +25 -19
  81. package/dist/render/driftLight/presence.d.ts +50 -0
  82. package/dist/render/driftLight/presence.js +43 -0
  83. package/dist/render/driftLight/uniforms.d.ts +3 -3
  84. package/dist/render/driftLight/uniforms.js +5 -6
  85. package/dist/render/driftLight/worldLightField.d.ts +41 -0
  86. package/dist/render/driftLight/worldLightField.js +66 -0
  87. package/dist/render/fixtureAtlas.d.ts +20 -0
  88. package/dist/render/fixtureAtlas.js +49 -0
  89. package/dist/render/glass.d.ts +45 -0
  90. package/dist/render/glass.js +39 -0
  91. package/dist/render/glassCasters.d.ts +40 -0
  92. package/dist/render/glassCasters.js +84 -0
  93. package/dist/render/glassShadow.d.ts +78 -0
  94. package/dist/render/glassShadow.js +125 -0
  95. package/dist/render/globalMediumPass.d.ts +2 -3
  96. package/dist/render/globalMediumPass.js +2 -8
  97. package/dist/render/gpudriven/lit.d.ts +12 -0
  98. package/dist/render/gpudriven/lit.js +23 -0
  99. package/dist/render/gpudriven/materialTable.d.ts +15 -5
  100. package/dist/render/gpudriven/materialTable.js +26 -6
  101. package/dist/render/gpudriven/pipeline.d.ts +1 -1
  102. package/dist/render/gpudriven/pipeline.js +4 -3
  103. package/dist/render/gpudriven/sunGlass.d.ts +35 -0
  104. package/dist/render/gpudriven/sunGlass.js +89 -0
  105. package/dist/render/instanceCull.d.ts +63 -0
  106. package/dist/render/instanceCull.js +160 -0
  107. package/dist/render/instances.d.ts +15 -0
  108. package/dist/render/lightBudget.d.ts +36 -35
  109. package/dist/render/lightBudget.js +38 -37
  110. package/dist/render/lightGrid.d.ts +42 -0
  111. package/dist/render/lightGrid.js +87 -0
  112. package/dist/render/mesh.d.ts +18 -24
  113. package/dist/render/mesh.js +51 -68
  114. package/dist/render/occlusion.d.ts +10 -0
  115. package/dist/render/occlusion.js +36 -7
  116. package/dist/render/pointGlassTint.d.ts +59 -0
  117. package/dist/render/pointGlassTint.js +198 -0
  118. package/dist/render/pointLightSelection.d.ts +7 -0
  119. package/dist/render/pointLightSelection.js +29 -4
  120. package/dist/render/pointShadowArray.d.ts +56 -3
  121. package/dist/render/pointShadowArray.js +127 -16
  122. package/dist/render/pointShadowMap.d.ts +23 -1
  123. package/dist/render/pointShadowMap.js +27 -1
  124. package/dist/render/rainField.d.ts +13 -0
  125. package/dist/render/rainField.js +27 -5
  126. package/dist/render/recon/changeFrames.d.ts +15 -0
  127. package/dist/render/recon/changeFrames.js +21 -0
  128. package/dist/render/recon/lateDepth.d.ts +11 -0
  129. package/dist/render/recon/lateDepth.js +70 -0
  130. package/dist/render/recon/lateRouting.d.ts +14 -0
  131. package/dist/render/recon/lateRouting.js +18 -0
  132. package/dist/render/recon/mover.d.ts +57 -0
  133. package/dist/render/recon/mover.js +86 -0
  134. package/dist/render/recon/resolve.d.ts +34 -4
  135. package/dist/render/recon/resolve.js +161 -20
  136. package/dist/render/renderQuality.d.ts +35 -0
  137. package/dist/render/renderQuality.js +7 -0
  138. package/dist/render/rendererHarness.js +16 -0
  139. package/dist/render/sceneTarget.d.ts +9 -1
  140. package/dist/render/sceneTarget.js +60 -12
  141. package/dist/render/shaders/depth.d.ts +16 -1
  142. package/dist/render/shaders/depth.js +94 -15
  143. package/dist/render/shaders/flat/directionalShadow.js +91 -6
  144. package/dist/render/shaders/flat/driftLight.d.ts +1 -1
  145. package/dist/render/shaders/flat/driftLight.js +32 -7
  146. package/dist/render/shaders/flat/glassTint.d.ts +6 -0
  147. package/dist/render/shaders/flat/glassTint.js +25 -0
  148. package/dist/render/shaders/flat/index.d.ts +13 -0
  149. package/dist/render/shaders/flat/index.js +9 -3
  150. package/dist/render/shaders/flat/lampGlass.d.ts +1 -0
  151. package/dist/render/shaders/flat/lampGlass.js +183 -0
  152. package/dist/render/shaders/flat/main.d.ts +1 -1
  153. package/dist/render/shaders/flat/main.js +190 -38
  154. package/dist/render/shaders/flat/pointShadow.d.ts +1 -1
  155. package/dist/render/shaders/flat/pointShadow.js +2 -0
  156. package/dist/render/shaders/flat/preamble.js +96 -26
  157. package/dist/render/shaders/flat/surfaceEffects.d.ts +29 -0
  158. package/dist/render/shaders/flat/surfaceEffects.js +152 -0
  159. package/dist/render/shaders/generated/depth.wgsl.d.ts +230 -7
  160. package/dist/render/shaders/generated/depth.wgsl.js +230 -7
  161. package/dist/render/shaders/generated/flat.wgsl.d.ts +1644 -1596
  162. package/dist/render/shaders/generated/flat.wgsl.js +1683 -1621
  163. package/dist/render/shaders/generated/globalMedium.wgsl.d.ts +3 -13
  164. package/dist/render/shaders/generated/globalMedium.wgsl.js +3 -13
  165. package/dist/render/shaders/generated/lightVolume.wgsl.d.ts +3 -13
  166. package/dist/render/shaders/generated/lightVolume.wgsl.js +21 -17
  167. package/dist/render/shaders/generated/octahedralResolve.wgsl.d.ts +29 -0
  168. package/dist/render/shaders/generated/octahedralResolve.wgsl.js +29 -0
  169. package/dist/render/shaders/generated/rush.wgsl.d.ts +21 -16
  170. package/dist/render/shaders/generated/rush.wgsl.js +21 -16
  171. package/dist/render/shaders/generated/sdfText.wgsl.d.ts +2 -2
  172. package/dist/render/shaders/generated/sdfText.wgsl.js +2 -2
  173. package/dist/render/shaders/generated/text.wgsl.d.ts +1 -1
  174. package/dist/render/shaders/generated/text.wgsl.js +1 -1
  175. package/dist/render/shaders/gi/driftLight.wgsl.d.ts +1 -1
  176. package/dist/render/shaders/gi/driftLight.wgsl.js +27 -4
  177. package/dist/render/shaders/globalMedium.js +6 -6
  178. package/dist/render/shaders/gpudriven/blendRaster.wgsl.d.ts +7 -0
  179. package/dist/render/shaders/gpudriven/blendRaster.wgsl.js +86 -1
  180. package/dist/render/shaders/gpudriven/cull.wgsl.d.ts +1 -1
  181. package/dist/render/shaders/gpudriven/cull.wgsl.js +11 -2
  182. package/dist/render/shaders/gpudriven/materialTable.wgsl.d.ts +1 -1
  183. package/dist/render/shaders/gpudriven/materialTable.wgsl.js +3 -1
  184. package/dist/render/shaders/gpudriven/shade.wgsl.js +50 -1
  185. package/dist/render/shaders/gpudriven/sunGlass.wgsl.d.ts +9 -0
  186. package/dist/render/shaders/gpudriven/sunGlass.wgsl.js +133 -0
  187. package/dist/render/shaders/lightVolume.js +6 -6
  188. package/dist/render/shaders/octahedralResolve.d.ts +8 -0
  189. package/dist/render/shaders/octahedralResolve.js +48 -17
  190. package/dist/render/shaders/recon/lateDepth.wgsl.d.ts +1 -0
  191. package/dist/render/shaders/recon/lateDepth.wgsl.js +69 -0
  192. package/dist/render/shaders/recon/motion.wgsl.d.ts +1 -1
  193. package/dist/render/shaders/recon/motion.wgsl.js +84 -0
  194. package/dist/render/shaders/recon/resolve.wgsl.d.ts +8 -7
  195. package/dist/render/shaders/recon/resolve.wgsl.js +161 -27
  196. package/dist/render/shaders/rush.js +11 -1
  197. package/dist/render/shaders/sdfText.d.ts +1 -1
  198. package/dist/render/shaders/sdfText.js +3 -2
  199. package/dist/render/shaders/text.d.ts +1 -1
  200. package/dist/render/shaders/text.js +18 -9
  201. package/dist/render/shadowCasters.d.ts +20 -1
  202. package/dist/render/shadowCasters.js +15 -1
  203. package/dist/render/shadowMap.d.ts +54 -5
  204. package/dist/render/shadowMap.js +190 -36
  205. package/dist/render/sunGlassTint.d.ts +25 -0
  206. package/dist/render/sunGlassTint.js +79 -0
  207. package/dist/render/surfaceEffects.d.ts +83 -0
  208. package/dist/render/surfaceEffects.js +75 -0
  209. package/dist/render/surfaceScene.d.ts +8 -0
  210. package/dist/render/surfaceScene.js +8 -0
  211. package/dist/render/surfaceTexture.d.ts +18 -2
  212. package/dist/render/surfaceTexture.js +68 -15
  213. package/dist/render/temporalAa.d.ts +25 -6
  214. package/dist/render/temporalAa.js +45 -15
  215. package/dist/render/textureSource.d.ts +30 -0
  216. package/dist/render/textureSource.js +53 -0
  217. package/dist/render/translucentQueue.d.ts +6 -0
  218. package/dist/render/translucentQueue.js +15 -1
  219. package/dist/render/vertexDefaults.js +2 -0
  220. package/dist/world/hlod.d.ts +104 -0
  221. package/dist/world/hlod.js +214 -0
  222. package/package.json +6 -6
  223. package/src/geometry/boxCsg.ts +186 -0
  224. package/src/geometry/csg.ts +384 -0
  225. package/src/geometry/meshBuilder.ts +15 -0
  226. package/src/geometry/meshConcat.ts +1 -0
  227. package/src/geometry/pixelFont.ts +2 -0
  228. package/src/geometry/solid.ts +189 -0
  229. package/src/geometry/solidFlat.ts +522 -0
  230. package/src/geometry/solidHarness.ts +83 -0
  231. package/src/geometry/solidNormals.ts +103 -0
  232. package/src/geometry/solidRound.ts +443 -0
  233. package/src/geometry/solidWriter.ts +58 -0
  234. package/src/index.ts +61 -1
  235. package/src/render/backend/api.ts +36 -11
  236. package/src/render/backend/drawFog.ts +31 -0
  237. package/src/render/backend/materialChanges.ts +9 -2
  238. package/src/render/backend/webgl2/glassTintPrograms.ts +58 -0
  239. package/src/render/backend/webgl2/instanced.ts +80 -14
  240. package/src/render/backend/webgl2/renderer.ts +700 -250
  241. package/src/render/backend/webgpu/buffers.ts +92 -5
  242. package/src/render/backend/webgpu/depthPass.ts +7 -2
  243. package/src/render/backend/webgpu/drawCommand.ts +6 -0
  244. package/src/render/backend/webgpu/flatPass.ts +62 -11
  245. package/src/render/backend/webgpu/glassTintPass.ts +245 -0
  246. package/src/render/backend/webgpu/gpuDrivenPass.ts +349 -5
  247. package/src/render/backend/webgpu/instanceCullPass.ts +165 -0
  248. package/src/render/backend/webgpu/instanced.ts +42 -4
  249. package/src/render/backend/webgpu/latePass.ts +161 -0
  250. package/src/render/backend/webgpu/lightVolumePass.ts +5 -1
  251. package/src/render/backend/webgpu/motionPass.ts +535 -0
  252. package/src/render/backend/webgpu/pipelineCache.ts +12 -1
  253. package/src/render/backend/webgpu/pointGlassTintPass.ts +233 -0
  254. package/src/render/backend/webgpu/pointShadowPass.ts +158 -26
  255. package/src/render/backend/webgpu/renderer.ts +1671 -670
  256. package/src/render/backend/webgpu/scatterPass.ts +2 -1
  257. package/src/render/backend/webgpu/sdfTextPass.ts +6 -1
  258. package/src/render/backend/webgpu/shaders/instanceCull.wgsl.ts +61 -0
  259. package/src/render/backend/webgpu/skinPaletteRing.ts +4 -0
  260. package/src/render/backend/webgpu/snapshotMips.ts +80 -0
  261. package/src/render/backend/webgpu/surfaceTexturePass.ts +91 -51
  262. package/src/render/driftLight/bake.ts +85 -62
  263. package/src/render/driftLight/denseField.ts +149 -0
  264. package/src/render/driftLight/lightField.ts +33 -18
  265. package/src/render/driftLight/presence.ts +69 -0
  266. package/src/render/driftLight/uniforms.ts +8 -9
  267. package/src/render/driftLight/worldLightField.ts +83 -0
  268. package/src/render/fixtureAtlas.ts +63 -0
  269. package/src/render/glass.ts +74 -0
  270. package/src/render/glassCasters.ts +164 -0
  271. package/src/render/glassShadow.ts +153 -0
  272. package/src/render/globalMediumPass.ts +4 -11
  273. package/src/render/gpudriven/lit.ts +31 -0
  274. package/src/render/gpudriven/materialTable.ts +28 -6
  275. package/src/render/gpudriven/pipeline.ts +4 -3
  276. package/src/render/gpudriven/sunGlass.ts +117 -0
  277. package/src/render/instanceCull.ts +205 -0
  278. package/src/render/instances.ts +16 -0
  279. package/src/render/lightBudget.ts +41 -38
  280. package/src/render/lightGrid.ts +130 -0
  281. package/src/render/mesh.ts +59 -72
  282. package/src/render/occlusion.ts +51 -7
  283. package/src/render/pointGlassTint.ts +250 -0
  284. package/src/render/pointLightSelection.ts +72 -4
  285. package/src/render/pointShadowArray.ts +188 -22
  286. package/src/render/pointShadowMap.ts +41 -0
  287. package/src/render/rainField.ts +39 -5
  288. package/src/render/recon/changeFrames.ts +24 -0
  289. package/src/render/recon/lateDepth.ts +83 -0
  290. package/src/render/recon/lateRouting.ts +29 -0
  291. package/src/render/recon/mover.ts +118 -0
  292. package/src/render/recon/resolve.ts +206 -20
  293. package/src/render/renderQuality.ts +47 -0
  294. package/src/render/rendererHarness.ts +16 -0
  295. package/src/render/sceneTarget.ts +62 -11
  296. package/src/render/shaders/depth.ts +118 -15
  297. package/src/render/shaders/flat/directionalShadow.ts +97 -6
  298. package/src/render/shaders/flat/driftLight.ts +32 -7
  299. package/src/render/shaders/flat/glassTint.ts +25 -0
  300. package/src/render/shaders/flat/index.ts +22 -3
  301. package/src/render/shaders/flat/lampGlass.ts +185 -0
  302. package/src/render/shaders/flat/main.ts +190 -38
  303. package/src/render/shaders/flat/pointShadow.ts +2 -0
  304. package/src/render/shaders/flat/preamble.ts +96 -26
  305. package/src/render/shaders/flat/surfaceEffects.ts +152 -0
  306. package/src/render/shaders/generated/depth.wgsl.ts +237 -7
  307. package/src/render/shaders/generated/flat.wgsl.ts +1685 -1621
  308. package/src/render/shaders/generated/globalMedium.wgsl.ts +3 -13
  309. package/src/render/shaders/generated/lightVolume.wgsl.ts +23 -17
  310. package/src/render/shaders/generated/octahedralResolve.wgsl.ts +30 -0
  311. package/src/render/shaders/generated/rush.wgsl.ts +21 -16
  312. package/src/render/shaders/generated/sdfText.wgsl.ts +2 -2
  313. package/src/render/shaders/generated/text.wgsl.ts +1 -1
  314. package/src/render/shaders/gi/driftLight.wgsl.ts +27 -4
  315. package/src/render/shaders/globalMedium.ts +6 -6
  316. package/src/render/shaders/gpudriven/blendRaster.wgsl.ts +88 -1
  317. package/src/render/shaders/gpudriven/cull.wgsl.ts +11 -2
  318. package/src/render/shaders/gpudriven/materialTable.wgsl.ts +3 -1
  319. package/src/render/shaders/gpudriven/shade.wgsl.ts +50 -1
  320. package/src/render/shaders/gpudriven/sunGlass.wgsl.ts +139 -0
  321. package/src/render/shaders/lightVolume.ts +6 -6
  322. package/src/render/shaders/octahedralResolve.ts +50 -17
  323. package/src/render/shaders/recon/lateDepth.wgsl.ts +72 -0
  324. package/src/render/shaders/recon/motion.wgsl.ts +84 -0
  325. package/src/render/shaders/recon/resolve.wgsl.ts +161 -27
  326. package/src/render/shaders/rush.ts +11 -1
  327. package/src/render/shaders/sdfText.ts +3 -2
  328. package/src/render/shaders/text.ts +18 -9
  329. package/src/render/shadowCasters.ts +28 -1
  330. package/src/render/shadowMap.ts +231 -37
  331. package/src/render/sunGlassTint.ts +86 -0
  332. package/src/render/surfaceEffects.ts +132 -0
  333. package/src/render/surfaceScene.ts +16 -0
  334. package/src/render/surfaceTexture.ts +110 -19
  335. package/src/render/temporalAa.ts +78 -14
  336. package/src/render/textureSource.ts +72 -0
  337. package/src/render/translucentQueue.ts +20 -1
  338. package/src/render/vertexDefaults.ts +2 -0
  339. package/src/world/hlod.ts +290 -0
@@ -1,5 +1,6 @@
1
1
  import type { ProbeBakeOptions } from '../../reflectionProbe.ts';
2
2
  import type { ReadonlyMat4 } from 'gl-matrix';
3
+ import type { Mover } from '../../recon/mover.ts';
3
4
  import type { Vec3 } from '../../../math/color.ts';
4
5
  import { Camera } from '../../camera.ts';
5
6
  import type { PickHit, PickableSource } from '../../pickable.ts';
@@ -54,9 +55,12 @@ import type { Bounds } from '../../../math/bounds.ts';
54
55
  import { type ComputeDefinition, type ComputeHandle } from '../../compute.ts';
55
56
  import type { PassDefinition, PassHandle } from '../../pass.ts';
56
57
  import { GpuInstancedBatch } from './instanced.ts';
57
- import type { MeshInstances } from '../../instances.ts';
58
+ import type { InstancedOptions, MeshInstances } from '../../instances.ts';
58
59
  import { LightField } from '../../driftLight/lightField.ts';
59
60
  import type { LightFieldOptions, LightFieldSource } from '../../driftLight/lightField.ts';
61
+ import type { DenseLightVolume } from '../../driftLight/denseField.ts';
62
+ import { WorldLightField } from '../../driftLight/worldLightField.ts';
63
+ import type { WorldLightFieldOptions } from '../../driftLight/worldLightField.ts';
60
64
  /** Which directional shadow map a pass is filling, matching `renderer.ts`. */
61
65
  type ShadowLayer = 'static' | 'static-peel' | 'dynamic';
62
66
  export declare class WebGPURenderer implements RendererApi {
@@ -156,6 +160,8 @@ export declare class WebGPURenderer implements RendererApi {
156
160
  * caller who passed null gets — rather than reading a slot this frame has already re-let.
157
161
  */
158
162
  private skinPaletteSlot;
163
+ /** The palette `skinPaletteSlot` was uploaded from, for a skinned mover to copy. See `Mover`. */
164
+ private skinPaletteData;
159
165
  private readonly surface;
160
166
  /** The encoder for the frame in flight, or null between frames. */
161
167
  private encoder;
@@ -163,6 +169,27 @@ export declare class WebGPURenderer implements RendererApi {
163
169
  private readonly meshPresent;
164
170
  private pass;
165
171
  private readonly pipelines;
172
+ /**
173
+ * The pipelines a reconstructing frame's blended draws are built for: the reconstructed picture's
174
+ * format at one sample, which is where `LatePass` draws them. Aliased to `pipelines` when the
175
+ * world already lands on exactly that, as `overlayPipelines` is.
176
+ */
177
+ private readonly latePipelines;
178
+ /** The blended draws of a reconstructing frame, drawn after the upscale. See `LatePass`. */
179
+ private latePass;
180
+ /** A late draw asked to refract: `runLate` copies the reconstructed picture before replaying. */
181
+ private lateRefractWanted;
182
+ /** The refraction copy's mip chain, recorded after each copy: what frosted glass reads. */
183
+ private refractMips;
184
+ /**
185
+ * The refraction copy's sampler: filtering, and **between levels as well**, so a frosted pane's
186
+ * level falls smoothly between two blurs rather than stepping from one to the next.
187
+ */
188
+ private refractSampler;
189
+ /** One glass resolution reused by every draw, so a pane allocates nothing. See `glass.ts`. */
190
+ private readonly glassScratch;
191
+ /** `issueCommand` bound once, so the late replay allocates no closure per frame. */
192
+ private readonly issueBound;
166
193
  /**
167
194
  * The same pipelines again, built for the canvas, for anything drawn after `endFrame`.
168
195
  *
@@ -489,6 +516,12 @@ export declare class WebGPURenderer implements RendererApi {
489
516
  * what the layout already declares.
490
517
  */
491
518
  private bloomGroups;
519
+ /**
520
+ * The picture the bloom reads, and its size: the scene target, or while reconstructing the
521
+ * resolved picture at the drawing buffer's size. See `rebuildBloomGroups`.
522
+ */
523
+ private bloomSourceWidth;
524
+ private bloomSourceHeight;
492
525
  private frameWidth;
493
526
  private frameHeight;
494
527
  /**
@@ -640,13 +673,25 @@ export declare class WebGPURenderer implements RendererApi {
640
673
  * the *unsharpened* result — sharpening into the history would sharpen a sharpened picture every
641
674
  * frame, which is the halo the reference's own clamp exists to prevent, compounded.
642
675
  *
643
- * The motion target is render size and carries a drawn object's own motion where something wrote
644
- * one. **Nothing writes it yet**, so it is cleared every frame and every pixel takes the camera's
645
- * motion, which the resolve derives from the depth and the reprojection. Static geometry is
646
- * exact that way and a moving object ghosts until the motion pass lands.
676
+ * The motion target is render size and carries a drawn object's own motion where the motion pass
677
+ * wrote one — a draw that named its mover, or passed last frame's matrix. Every other texel is
678
+ * cleared, and the resolve takes the camera's motion there, derived from the depth and the
679
+ * reprojection: exact for anything that did not move. See `MotionPass`.
647
680
  */
648
681
  private reconHistories;
649
682
  private reconHistoryViews;
683
+ /**
684
+ * Each output pixel's flicker record, a pair swapped with the histories: the temporal resolve's
685
+ * anti-flicker, over the reconstruction's own period (`recon/resolve.ts`).
686
+ */
687
+ private reconFlickers;
688
+ private reconFlickerViews;
689
+ /** Each output pixel's held depth swing, a pair of its own: see `recon/resolve.ts`. */
690
+ private reconSwings;
691
+ private reconSwingViews;
692
+ /** The anti-flicker's rule for the period last asked for, kept so a frame makes none. */
693
+ private reconFlickerPhases;
694
+ private reconFlickerRule;
650
695
  private reconWrite;
651
696
  private reconHasHistory;
652
697
  private reconShown;
@@ -665,40 +710,24 @@ export declare class WebGPURenderer implements RendererApi {
665
710
  private reconGroups;
666
711
  private reconSharpenGroups;
667
712
  private reconRushGroup;
668
- /**
669
- * What the motion pass will draw, recorded by `drawMesh` and spent once a frame.
670
- *
671
- * A parallel array of meshes and one flat matrix buffer rather than an array of objects, because
672
- * this is written on the frame's hot path and the house rule about allocating there binds it: the
673
- * matrices are copied into a buffer that only ever grows, and the count is what resets.
674
- */
675
- private readonly motionMeshes;
676
- private motionMatrices;
677
- private motionCount;
678
- private motionLayout;
679
- /**
680
- * One pipeline per vertex stride, because a stride is a property of the *mesh*.
681
- *
682
- * Which optional attributes a mesh supplied decides how far apart its positions are, and this
683
- * pass reads nothing but positions — so two meshes drawn by the same shader still need two
684
- * vertex layouts. A map rather than a cache key on the pipeline cache: there is one shader here
685
- * and a handful of strides in any scene.
686
- */
687
- private readonly motionPipelines;
688
- private motionModule;
689
- private motionPipelineLayout;
690
- private motionFrameBuffer;
691
- private motionDrawBuffer;
692
- private motionDrawCapacity;
693
- private motionGroup;
694
- private readonly motionFrameStaging;
695
- private motionDrawStaging;
713
+ /** The motion pass, made with the reconstruction's targets. See `MotionPass`. */
714
+ private motionPass;
715
+ /** This renderer's identity to a `Mover`. See `claimRendererId`. */
716
+ private readonly moverRenderer;
717
+ /** Frames begun, so a mover can tell last frame from any other. Advanced in `beginFrame`. */
718
+ private moverFrame;
719
+ /** Between `beginFrame` and `endFrame`. A change outside it is the next frame's. */
720
+ private inFrame;
721
+ private warnedMoverTwice;
696
722
  /** The scene's own clip transform with the generated shaders' y negation folded in. */
697
723
  private readonly motionRaster;
698
724
  private reconSizeKey;
699
725
  /** Last frame's raw view-projection and its inverse, and the two eyes. */
700
726
  private readonly reconPreviousRawViewProj;
701
727
  private readonly reconInverseViewProj;
728
+ /** The inverse and the reprojection, multiplied in double precision. See `runReconstruction`. */
729
+ private readonly reconInverse64;
730
+ private readonly reconReprojection64;
702
731
  private readonly reconPreviousInverseViewProj;
703
732
  private readonly reconEye;
704
733
  private readonly reconPreviousEye;
@@ -826,6 +855,8 @@ export declare class WebGPURenderer implements RendererApi {
826
855
  /** Said once for the whole renderer. See `refuseOitMultisampled`. */
827
856
  private oitMultisampleRefused;
828
857
  private oitReplaying;
858
+ /** `uSurfaceScene`, resolved once a pass. See `surfaceScene.ts`. */
859
+ private readonly surfaceScene;
829
860
  /** Which buffer the replay is filling, which the pipeline key must carry. */
830
861
  private oitMode;
831
862
  /**
@@ -1056,6 +1087,8 @@ export declare class WebGPURenderer implements RendererApi {
1056
1087
  /** Whether the bound material is seen from both faces. See `SurfaceMaterial.doubleSided`. */
1057
1088
  private materialDoubleSided;
1058
1089
  createSurfaceTexture(source: TexImageSource, options?: SurfaceTextureOptions): GpuSurfaceTexture;
1090
+ /** Several images of one size as an array's layers. See `RendererApi.createSurfaceTextureArray`. */
1091
+ createSurfaceTextureArray(sources: readonly TexImageSource[], options?: SurfaceTextureOptions): GpuSurfaceTexture;
1059
1092
  /**
1060
1093
  * GPU textures an `updateSurfaceTexture` replaced, destroyed when the next frame begins.
1061
1094
  *
@@ -1134,6 +1167,13 @@ export declare class WebGPURenderer implements RendererApi {
1134
1167
  /** How bright the environment the surfaces drawn next reflect is. See `renderer.ts`. */
1135
1168
  setEnvironmentGain(gain: number): void;
1136
1169
  setSurfaceGrain(amount: number): void;
1170
+ /**
1171
+ * How much of the surfaces drawn next survives a screen-door dither. See `renderer.ts`.
1172
+ *
1173
+ * Written straight into the scratch block rather than through `material()`'s callback, because
1174
+ * this one is called per crossfading region per frame and a closure per call is an allocation.
1175
+ */
1176
+ setDitherFade(amount: number): void;
1137
1177
  /**
1138
1178
  * How strong the microscopic relief on the surfaces drawn next is, and how coarse.
1139
1179
  *
@@ -1474,6 +1514,8 @@ export declare class WebGPURenderer implements RendererApi {
1474
1514
  private readonly waterLayout;
1475
1515
  /** The one-pixel stand-in, kept so the water bind group can be rebuilt without one. */
1476
1516
  private readonly blankView;
1517
+ /** The blank texel as a one-layer array: the stand-in every surface-texture binding takes. */
1518
+ private readonly blankSurfaceView;
1477
1519
  private readonly blankSampler;
1478
1520
  /**
1479
1521
  * A slot per body, not one buffer rewritten before each draw.
@@ -1597,8 +1639,39 @@ export declare class WebGPURenderer implements RendererApi {
1597
1639
  private readonly sdfTextVerts;
1598
1640
  private readonly sdfTextFrags;
1599
1641
  private readonly sdfTextBindGroups;
1600
- private readonly shadowMap;
1601
- private readonly shadowView;
1642
+ /**
1643
+ * The sun's static, moving and peeled maps, as layers of one texture (`shadowMap.ts`). The three
1644
+ * views below are single layers, what each pass attaches; the two here are what is sampled.
1645
+ */
1646
+ private sunShadowTexture;
1647
+ /** Every layer, for the lit pass, the light volumes and the medium. */
1648
+ private sunArrayView;
1649
+ /**
1650
+ * The static layer alone, as an array, for the peel: it draws into another layer of the same
1651
+ * texture, and a view covering that layer too would put it in two usages in one pass.
1652
+ */
1653
+ private sunStaticArrayView;
1654
+ /** How many layers the sun's texture holds: its maps, and the two glass layers once glass casts. */
1655
+ private sunLayerCount;
1656
+ /** The glass depth layers, static then moving, once glass has cast. See `growSunForGlass`. */
1657
+ private sunGlassViews;
1658
+ /** The texture a growth replaced, destroyed once the encoder that copied out of it is submitted. */
1659
+ private retiredSunTexture;
1660
+ /** What the sun's light keeps through glass: two `rgba8unorm` layers, made when glass first casts. */
1661
+ private sunTint;
1662
+ /** The tint pass's layouts, per-draw block, groups and pipelines, made when glass first casts. */
1663
+ private glassTint;
1664
+ /** The tint pass open while the glass list is replayed into it. */
1665
+ private tintPass;
1666
+ /** True while the glass list is replayed into a glass depth layer through `casterSink`. */
1667
+ private drawingGlassDepth;
1668
+ /** Whether the open sun pass is the movers' layer, whose glass goes to the moving glass layer. */
1669
+ private shadowLayerIsDynamic;
1670
+ /** The glass tints' sampler: filtering, and between levels, for frost's coarser reads. */
1671
+ private readonly tintSampler;
1672
+ /** The light a tint pass is drawn for: xyz a direction (w 0) or a position (w 1). */
1673
+ private readonly glassLight;
1674
+ private shadowView;
1602
1675
  private readonly shadowLayout;
1603
1676
  /** The same layout plus the joint palette. See `createDepthBindGroupLayout`. */
1604
1677
  private readonly shadowSkinnedLayout;
@@ -1624,8 +1697,7 @@ export declare class WebGPURenderer implements RendererApi {
1624
1697
  * read twice — so a profile that switches peeling off gets no map and no pass on either
1625
1698
  * backend rather than a map nothing writes.
1626
1699
  */
1627
- private readonly peelMap;
1628
- private readonly peelView;
1700
+ private peelView;
1629
1701
  /**
1630
1702
  * The movers' own layer: the character, the rope it swings on, and anything else that walks.
1631
1703
  *
@@ -1646,10 +1718,9 @@ export declare class WebGPURenderer implements RendererApi {
1646
1718
  * and therefore as lit — so nothing looked broken, only empty, which is why it survived the
1647
1719
  * port and every gate in it.
1648
1720
  */
1649
- private readonly dynamicMap;
1650
- private readonly dynamicView;
1721
+ private dynamicView;
1651
1722
  /** The peel's own bind groups: `uPeelShadowLayer` at 1, and the static map to peel against. */
1652
- private readonly shadowPeelBindGroup;
1723
+ private shadowPeelBindGroup;
1653
1724
  /**
1654
1725
  * The cutout casters' layout, and a bind group per cutout map for each layer, built the first
1655
1726
  * time a map casts and kept: a `createBindGroup` per draw is the allocation the house rules forbid.
@@ -1661,7 +1732,7 @@ export declare class WebGPURenderer implements RendererApi {
1661
1732
  private readonly cutoutPeelGroups;
1662
1733
  private shadowPeelPassUniforms;
1663
1734
  private shadowPeelSampler;
1664
- private readonly scatterDepthPeelBindGroup;
1735
+ private scatterDepthPeelBindGroup;
1665
1736
  /** Which layer the open pass is writing, so the sink picks the bindings that match it. */
1666
1737
  private shadowLayerIsPeel;
1667
1738
  /**
@@ -1732,6 +1803,10 @@ export declare class WebGPURenderer implements RendererApi {
1732
1803
  * Built once and held, rather than made per call: it closes over `this` and a fresh one
1733
1804
  * every frame would be an allocation in a per-frame path.
1734
1805
  */
1806
+ /** The glass the open shadow pass was offered, kept for its own passes: `glassCasters.ts`. */
1807
+ private readonly glassCasters;
1808
+ /** One resolution every glass caster is read through, so recording one allocates nothing. */
1809
+ private readonly glassCasterScratch;
1735
1810
  private readonly casterSink;
1736
1811
  /** Said once rather than every frame, because a full ring is a flood otherwise. */
1737
1812
  private warnedFull;
@@ -2016,7 +2091,7 @@ export declare class WebGPURenderer implements RendererApi {
2016
2091
  */
2017
2092
  drawMesh(mesh: GpuMesh, model: ArrayLike<number>, depthLayer?: number, tint?: Vec3 | null,
2018
2093
  /** Where it was last frame. See `RendererApi.drawMesh`, and `runMotion` for what reads it. */
2019
- previousModel?: ArrayLike<number> | null): void;
2094
+ previousModel?: ArrayLike<number> | Mover | null): void;
2020
2095
  /**
2021
2096
  * Draw a mesh that lets the world through, at `opacity`.
2022
2097
  *
@@ -2104,9 +2179,11 @@ export declare class WebGPURenderer implements RendererApi {
2104
2179
  * anyway, because WebGL2 *cannot* and a capability one backend has and the other does not is
2105
2180
  * the shape this repository spent a week removing.
2106
2181
  */
2107
- createInstanced(mesh: GpuMesh, capacity: number): GpuInstancedBatch;
2108
- /** Which meshes already carry a batch, so a second is refused rather than silently shared. */
2109
- private readonly instanced;
2182
+ createInstanced(mesh: GpuMesh, capacity: number, options?: InstancedOptions): GpuInstancedBatch;
2183
+ /** The device instance culls, built on the first culling draw. See `InstanceCullPass`. */
2184
+ private instanceCulls;
2185
+ /** Counts frames, so a batch knows when its cull slots were last taken. */
2186
+ private cullFrame;
2110
2187
  /** Push placement and colour. Only the live prefix; see `GpuInstancedBatch.upload`. */
2111
2188
  uploadInstanced(batch: GpuInstancedBatch, data: MeshInstances): void;
2112
2189
  /** Draw every live instance, opaque. */
@@ -2115,6 +2192,18 @@ export declare class WebGPURenderer implements RendererApi {
2115
2192
  drawTranslucentInstanced(batch: GpuInstancedBatch, data: MeshInstances, opacity: number, options?: TranslucentMeshOptions): void;
2116
2193
  /** Release the placement. The mesh is the caller's and is not released. */
2117
2194
  disposeInstanced(batch: GpuInstancedBatch): void;
2195
+ /**
2196
+ * Write what a translucent draw shows through it into the material scratch: refraction's bend and
2197
+ * absorption, and glass. Returns whether the frame's copy is there to read, and so whether
2198
+ * `releaseSeeThrough` owes the scratch back.
2199
+ *
2200
+ * **A glass draw takes the copy even when it does not bend**, since a pane shows what is behind it
2201
+ * either way. A copy that cannot be taken — a mirror, a probe bake — leaves both off, so the pane
2202
+ * shades as ordinary translucency rather than sampling a stand-in. See `glass.ts`.
2203
+ */
2204
+ private bindSeeThrough;
2205
+ /** Put the scratch back after `bindSeeThrough`: refraction and glass off. */
2206
+ private releaseSeeThrough;
2118
2207
  /**
2119
2208
  * One draw, one material slot, one uniform slot, however many instances.
2120
2209
  *
@@ -2127,6 +2216,12 @@ export declare class WebGPURenderer implements RendererApi {
2127
2216
  * **What it gives up** against `drawMesh` is skinning and morphing, refused where the variant
2128
2217
  * is built, and a per-instance opacity: `opacity` here dims the whole batch.
2129
2218
  */
2219
+ /**
2220
+ * The next of a batch's cull slots this frame, with its cull queued against the current view; null
2221
+ * when the batch has drawn from `MAX_CULL_SLOTS` views already or the frame's job ring is full,
2222
+ * and the draw then takes every instance.
2223
+ */
2224
+ private takeCullSlot;
2130
2225
  private submitInstanced;
2131
2226
  /** Upload a base mesh and size its per-instance buffers. See `createGpuScatter`. */
2132
2227
  createScatter(base: MeshData, data: InstanceData): GpuScatter;
@@ -2207,6 +2302,34 @@ export declare class WebGPURenderer implements RendererApi {
2207
2302
  drawSceneCasters(casters: ShadowCasters): void;
2208
2303
  drawShadowCasters(casters: ShadowCasters): void;
2209
2304
  /** Close the shadow pass and submit it, so the frame can sample what it wrote. */
2305
+ /**
2306
+ * Add the sun's two glass layers, once, carrying every layer it holds across on `encoder`.
2307
+ *
2308
+ * **Copied rather than re-baked**, for the reason `SunShadowArray.growForGlass` gives: the static
2309
+ * map is the consumer's to bake and may be baked once, and the glass that grows the texture
2310
+ * arrives in the very pass that drew it. Every view of the old texture is stale afterwards, so
2311
+ * every group holding one is rebuilt here — the lit pass's, the volumes', the medium's and the
2312
+ * peel's — and the old texture is destroyed only once this encoder is submitted.
2313
+ */
2314
+ private growSunForGlass;
2315
+ /** Every group that holds a view of the sun's texture, rebuilt after it has been replaced. */
2316
+ private rebuildSunGroups;
2317
+ /** The sun's tint target, made the first time glass casts and born clear on `encoder`. */
2318
+ private ensureSunTint;
2319
+ /**
2320
+ * Draw the pass's glass twice: where the nearest pane is, and what the panes let through.
2321
+ *
2322
+ * After the opaque casters, on the pass's own encoder. A layer that has held glass is redrawn
2323
+ * even when this pass offered none, so glass that has gone takes its colour with it.
2324
+ */
2325
+ private flushSunGlass;
2326
+ /** The glass list into a glass depth layer: `casterSink` itself, with glass let through. */
2327
+ private readonly glassDepthSink;
2328
+ /**
2329
+ * The glass list into a tint layer, through the tint pipelines, **culling nothing**: every pane on
2330
+ * a ray counts, whichever way it faces. See the other backend's `glassTintSink`.
2331
+ */
2332
+ private readonly glassTintSink;
2210
2333
  endShadowPass(): void;
2211
2334
  /**
2212
2335
  * The pool, or null where the profile switched cube shadows off.
@@ -2227,6 +2350,8 @@ export declare class WebGPURenderer implements RendererApi {
2227
2350
  private preparedPointLightCount;
2228
2351
  /** See `renderer.ts`: built when a world reports its lights, and rebuilt only to grow. */
2229
2352
  private pointShadowArray;
2353
+ /** The array glass replaced, destroyed once the round that copied out of it is submitted. */
2354
+ private retiredPointTexture;
2230
2355
  private readonly bakeScratch;
2231
2356
  /** Said once per renderer; see `updatePointShadows`. */
2232
2357
  private warnedNoPointShadowArray;
@@ -2461,28 +2586,51 @@ export declare class WebGPURenderer implements RendererApi {
2461
2586
  * called whenever any of them is replaced.
2462
2587
  */
2463
2588
  private rebuildReconGroups;
2589
+ /** This frame's jitter and temporal frame, decided where its scene camera is bound. See `bindMeshPass`. */
2590
+ private jitterFrame;
2464
2591
  /**
2465
- * Remember that this mesh moved, so the motion pass can draw where it was.
2592
+ * Whether a blended draw recorded now lands after the upscale. See `lateRouting.ts`.
2466
2593
  *
2467
- * Silent unless a reconstruction is running: a scene that always states its previous transforms
2468
- * — which is the right thing for a scene to do, the alternative being to know what the renderer
2469
- * is configured as — must cost nothing at all when nobody is going to read them.
2594
+ * Not during the order-independent replay, which owns its pass and issues into it directly.
2595
+ */
2596
+ private drawsLate;
2597
+ /**
2598
+ * The command a blended draw records into: the late pool while reconstructing, the frame graph
2599
+ * otherwise. **Late draws record whatever `quality.frameGraph` says**, since the late replay is
2600
+ * the only moment they can land; everything else keeps the path it has.
2601
+ */
2602
+ private recordBlended;
2603
+ /** The pipelines a blended draw is built for: the reconstructed picture's while late. */
2604
+ private blendedPipelines;
2605
+ /**
2606
+ * The blended draws of a reconstructing frame, over the reconstructed picture at the output size
2607
+ * and unjittered, against the render's depth taken up to that size. Before occlusion, bloom and
2608
+ * the grade, so they are graded exactly as they were when they were drawn into the scene.
2470
2609
  */
2471
- private recordMotion;
2610
+ private runLate;
2611
+ /** Whether this draw lands in the reconstructed picture. See `lateRouting.ts`. */
2612
+ private tracksMotionNow;
2472
2613
  /**
2473
- * The pipeline the motion pass draws with, built once.
2614
+ * What this draw's motion is, recorded for the motion pass.
2474
2615
  *
2475
- * **The position buffer alone**, because that is all the shader reads and a mesh keeps one buffer
2476
- * an attribute — so this binds buffer zero and nothing else, whatever else the mesh carries.
2616
+ * A mesh rewritten this frame carries its vertex motion whatever else the draw says — under last
2617
+ * frame's model where a mover or a matrix knows it, under this frame's where nothing does. A
2618
+ * mover otherwise carries a rigid draw's last model or a skinned draw's last pose; a matrix
2619
+ * carries a rigid draw's. A draw that says nothing and moved no vertex takes the camera's motion.
2477
2620
  */
2478
- private buildMotionPipeline;
2479
- /** The pipeline for one vertex stride, built on first sight of it. */
2480
- private motionPipelineFor;
2621
+ private recordDrawMotion;
2481
2622
  /**
2482
- * Where every mover was last frame, into the motion target.
2623
+ * A skinned mover's motion: this frame's palette is the draw's own slot, and last frame's takes a
2624
+ * slot of its own, like any palette a draw binds — so it is uploaded once and nothing overwrites
2625
+ * it before the motion pass reads it. See `SkinPaletteRing`.
2626
+ */
2627
+ private recordSkinnedMotion;
2628
+ private warnMoverTwice;
2629
+ /**
2630
+ * Where every mover was last frame, into the motion target. See `MotionPass`.
2483
2631
  *
2484
2632
  * **After everything that draws and before the resolve reads it.** The frame's depth has to be
2485
- * finished for the equality test to mean anything, and the resolve is what consumes the result.
2633
+ * finished for the pass's equality test to mean anything, and the resolve is what consumes it.
2486
2634
  */
2487
2635
  private runMotion;
2488
2636
  /**
@@ -2742,6 +2890,8 @@ export declare class WebGPURenderer implements RendererApi {
2742
2890
  private recordDraw;
2743
2891
  /** Replay one recorded draw into an open pass. */
2744
2892
  private replayNode;
2893
+ /** One recorded draw, issued into an open pass. Shared by the graph's replay and `runLate`. */
2894
+ private issueCommand;
2745
2895
  private ensurePass;
2746
2896
  /**
2747
2897
  * The pass a verb will draw into, without flushing what is already recorded.
@@ -2953,6 +3103,8 @@ export declare class WebGPURenderer implements RendererApi {
2953
3103
  * declares nothing behaves exactly as it did before. Read it beside `visible`, which answers the
2954
3104
  * other half of the same question.
2955
3105
  */
3106
+ /** Whether a world-space box is wholly behind the declared occluders. See `Renderer.occludedBox`. */
3107
+ occludedBox(min: ArrayLike<number>, max: ArrayLike<number>): boolean;
2956
3108
  occluded(bounds: Bounds, model: ReadonlyMat4): boolean;
2957
3109
  private readonly passes;
2958
3110
  /** Each registered pass's declared reads, as a mask, resolved once at registration. */
@@ -3137,6 +3289,13 @@ export declare class WebGPURenderer implements RendererApi {
3137
3289
  beginInset(rect: InsetRect, clearColor: Vec3 | null): number;
3138
3290
  /** Give the whole canvas back. Safe to call without a matching `beginInset`. */
3139
3291
  endInset(): void;
3292
+ /**
3293
+ * The size of the attachment the open pass draws into: the swap image — the drawing buffer —
3294
+ * in the overlay after the present, the scene's render size in the frame's own pass. A tuple
3295
+ * held once rather than a new array a call.
3296
+ */
3297
+ private passSize;
3298
+ private readonly passSizeOut;
3140
3299
  /**
3141
3300
  * Copy a rectangle of the frame into a 2D canvas, pixel for pixel.
3142
3301
  *
@@ -3243,6 +3402,10 @@ export declare class WebGPURenderer implements RendererApi {
3243
3402
  *
3244
3403
  * What it gives up is one frame of history: the frame after a cut has no blur and no temporal
3245
3404
  * blend, as the first frame of a session has none. Nothing else is reset.
3405
+ *
3406
+ * **A reconstructing renderer depends on it**: its history is the last shot's, and without this
3407
+ * call a cut blends that shot into the first frames of the next. Nothing detects a cut on the
3408
+ * caller's behalf, deliberately — a fast pan and a cut look alike from here.
3246
3409
  */
3247
3410
  cameraCut(): void;
3248
3411
  /**
@@ -3369,8 +3532,12 @@ export declare class WebGPURenderer implements RendererApi {
3369
3532
  private probeView;
3370
3533
  private readonly probeSize;
3371
3534
  private readonly probeMipLayout;
3372
- /** The photometric atlas, allocated on first use. See `setIesProfiles`. */
3373
- private iesTexture;
3535
+ /** The fixture atlas — cookies over profiles — built on first use. See `fixtureAtlas.ts`. */
3536
+ private fixtureTexture;
3537
+ private fixtureView;
3538
+ /** The profiles as packed and the cookie images, kept so either can rebuild the atlas. */
3539
+ private iesAtlas;
3540
+ private cookieImages;
3374
3541
  /** The scene's DriftLight field, and its two volumes once it is whole. See `createLightField`. */
3375
3542
  private lightField;
3376
3543
  private driftIndex;
@@ -3384,10 +3551,7 @@ export declare class WebGPURenderer implements RendererApi {
3384
3551
  /** The frame's exact lights packed for the traced bake. See `gi/bounceLights.ts`. */
3385
3552
  private readonly bounceLights;
3386
3553
  private readonly bakeLamps;
3387
- private iesView;
3388
- private cookieTexture;
3389
- private cookieView;
3390
- /** Tiles in the cookie atlas. 0 is the white placeholder and the whole off path. */
3554
+ /** Cookie tiles in the atlas. 0 is none, and the whole off path. */
3391
3555
  private cookieTiles;
3392
3556
  /** Rows in that atlas. One until a consumer loads a profile, which is the row of ones. */
3393
3557
  private iesRows;
@@ -3537,11 +3701,30 @@ export declare class WebGPURenderer implements RendererApi {
3537
3701
  * call a tile fills the row without a canvas in between.
3538
3702
  */
3539
3703
  setSpotCookies(images: readonly TexImageSource[]): void;
3704
+ /** Let the atlas go, to be built again from what is in hand the next time it is bound. */
3705
+ private forgetFixtureAtlas;
3706
+ /**
3707
+ * The fixture atlas's view, built from the profiles and cookies in hand if it is not already: the
3708
+ * profiles' rows at the bottom, the cookies' tiles on top. See `renderer.ts` and `fixtureAtlas.ts`.
3709
+ *
3710
+ * **`rgba16float`, not `rgba32float`**: a 32-bit float texture is not filterable in core WebGPU,
3711
+ * and binding one to a filtering sampler takes the whole bind group with it. Both tables want
3712
+ * linear filtering. `RENDER_ATTACHMENT` because `copyExternalImageToTexture` writes through one.
3713
+ */
3714
+ private fixtureAtlasView;
3540
3715
  /**
3541
3716
  * Sum a scene's many fixed lights into a DriftLight field. The same contract as
3542
3717
  * `Renderer.createLightField`; see `driftLight/lightField.ts`.
3543
3718
  */
3544
3719
  createLightField(lights: readonly LightFieldSource[], options?: Omit<LightFieldOptions, 'falloff'>): LightField;
3720
+ /**
3721
+ * Hand a world's DriftLight volume to the renderer: every fixed light of a city, summed offline by
3722
+ * `bakeDenseField`, standing in past the frame's exact choice. Replaces any field made before, of
3723
+ * either kind; the scene calls `field.follow(buffer.complete, ...)` each frame as it would for
3724
+ * `createLightField`, and marks the lights the volume summed `inLightField` so none is counted
3725
+ * twice. See `driftLight/worldLightField.ts`.
3726
+ */
3727
+ createWorldLightField(volume: DenseLightVolume, options?: WorldLightFieldOptions): WorldLightField;
3545
3728
  /** Let go of the field and its volumes; the scene's lights are all exact again. */
3546
3729
  disposeLightField(): void;
3547
3730
  private forgetLightFieldVolumes;
@@ -3576,7 +3759,31 @@ export declare class WebGPURenderer implements RendererApi {
3576
3759
  * The occlusion and bloom targets are half size. Both are blurs read back at full size, so a
3577
3760
  * full-resolution intermediate buys nothing a bilinear fetch does not already give.
3578
3761
  */
3762
+ /**
3763
+ * The medium's march group, holding the shadow views it reads — built with the composite, and
3764
+ * again when the sun's texture grows its glass layers and every view of the old one is stale.
3765
+ *
3766
+ * **The stand-in has to read as unoccluded and not as absent**, which is `emptyTexture.ts`'s
3767
+ * point and `createLightVolumeBindGroup`'s: `occlusion()` calls any stored depth below the
3768
+ * receiver's a blocker — so a black stand-in would put the whole medium in shadow, which is a
3769
+ * picture rather than an error. `volumeBlank` is the white one-texel texture built for this.
3770
+ */
3771
+ private buildMediumBindGroup;
3579
3772
  private ensureComposite;
3773
+ /**
3774
+ * One group per source the bloom chain reads, in the order `runBloom` indexes them: the picture
3775
+ * first, then every level. The prefilter reads the picture; the downsample into level `i` reads
3776
+ * level `i - 1`, which is group `i`; the upsample into level `i - 1` reads level `i`, which is
3777
+ * group `i + 1`.
3778
+ *
3779
+ * **While reconstructing the picture is the resolved one**, which `ensureReconstruction` makes
3780
+ * after this runs and rebuilds these over. The scene target is the jittered render then: a bright
3781
+ * thing smaller than a render texel is caught in some phases and missed in others, and its halo,
3782
+ * wide and over everything round it, flashed with it — a night street's panels breathing a few
3783
+ * levels of luma frame to frame. Built at the drawing buffer's size, which `ensureComposite`
3784
+ * already sized the pyramid for.
3785
+ */
3786
+ private rebuildBloomGroups;
3580
3787
  /**
3581
3788
  * Every bloom stage's uniform block, written once per size rather than once per frame.
3582
3789
  *