@woosh/meep-engine 3.58.0 → 3.59.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 (609) hide show
  1. package/editor/particles/effect/ParticleEffectDocument.d.ts +162 -43
  2. package/editor/particles/effect/ParticleEffectDocument.d.ts.map +1 -1
  3. package/editor/particles/effect/ParticleEffectDocument.js +450 -43
  4. package/editor/particles/effect/ParticleReferenceSimulation.d.ts +12 -3
  5. package/editor/particles/effect/ParticleReferenceSimulation.d.ts.map +1 -1
  6. package/editor/particles/effect/ParticleReferenceSimulation.js +78 -23
  7. package/editor/particles/effect/make_starter_particle_effect.js +17 -17
  8. package/editor/view/particles/effect/ParticleEmitterInspectorView.d.ts +3 -3
  9. package/editor/view/particles/effect/ParticleEmitterInspectorView.d.ts.map +1 -1
  10. package/editor/view/particles/effect/ParticleEmitterInspectorView.js +224 -67
  11. package/editor/view/particles/effect/ParticleGraphEditorView.d.ts.map +1 -1
  12. package/editor/view/particles/effect/ParticleGraphEditorView.js +44 -11
  13. package/editor/view/particles/effect/ParticleNodeParametersView.d.ts +2 -1
  14. package/editor/view/particles/effect/ParticleNodeParametersView.d.ts.map +1 -1
  15. package/editor/view/particles/effect/ParticleNodeParametersView.js +46 -16
  16. package/editor/view/particles/effect/ParticlePreviewView.js +2 -2
  17. package/editor/view/particles/effect/particle-editor.css +77 -68
  18. package/package.json +1 -1
  19. package/src/engine/Engine.d.ts.map +1 -1
  20. package/src/engine/Engine.js +2 -2
  21. package/src/engine/ecs/EntityManager.d.ts +29 -5
  22. package/src/engine/ecs/EntityManager.d.ts.map +1 -1
  23. package/src/engine/ecs/EntityManager.js +37 -1
  24. package/src/engine/ecs/storage/populateEngineSerializationRegistry.d.ts.map +1 -1
  25. package/src/engine/ecs/storage/populateEngineSerializationRegistry.js +4 -0
  26. package/src/engine/graphics/ecs/particles/ParticleEffect.d.ts +74 -17
  27. package/src/engine/graphics/ecs/particles/ParticleEffect.d.ts.map +1 -1
  28. package/src/engine/graphics/ecs/particles/ParticleEffect.js +156 -25
  29. package/src/engine/graphics/ecs/particles/ParticleEffectSerializationAdapter.d.ts +13 -3
  30. package/src/engine/graphics/ecs/particles/ParticleEffectSerializationAdapter.d.ts.map +1 -1
  31. package/src/engine/graphics/ecs/particles/ParticleEffectSerializationAdapter.js +59 -13
  32. package/src/engine/graphics/ecs/particles/ParticleEffectSerializationUpgrader_1_2.d.ts +3 -3
  33. package/src/engine/graphics/ecs/particles/ParticleEffectSerializationUpgrader_1_2.js +9 -9
  34. package/src/engine/graphics/ecs/particles/ParticleEffectSerializationUpgrader_2_3.d.ts +15 -0
  35. package/src/engine/graphics/ecs/particles/ParticleEffectSerializationUpgrader_2_3.d.ts.map +1 -0
  36. package/src/engine/graphics/ecs/particles/ParticleEffectSerializationUpgrader_2_3.js +78 -0
  37. package/src/engine/graphics/ecs/trail3d/Trail3D.d.ts +2 -0
  38. package/src/engine/graphics/ecs/trail3d/Trail3D.d.ts.map +1 -1
  39. package/src/engine/graphics/ecs/trail3d/Trail3D.js +2 -0
  40. package/src/engine/graphics/ecs/trail3d/seed_trail_stroke.js +1 -1
  41. package/src/engine/graphics/ecs/trail3d/seed_trail_tube.js +1 -1
  42. package/src/engine/graphics/trail/tube/TubeX.d.ts +5 -3
  43. package/src/engine/graphics/trail/tube/TubeX.d.ts.map +1 -1
  44. package/src/engine/graphics/trail/tube/TubeX.js +5 -3
  45. package/src/engine/graphics/trail/tube/tube_attributes_spec.d.ts +3 -2
  46. package/src/engine/graphics/trail/tube/tube_attributes_spec.d.ts.map +1 -1
  47. package/src/engine/graphics/trail/tube/tube_attributes_spec.js +9 -8
  48. package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts +65 -4
  49. package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts.map +1 -1
  50. package/src/engine/graphics3/GPUParticleEmitterSystem.js +1351 -904
  51. package/src/engine/graphics3/trail/trail_tube_write_geometry.d.ts +1 -1
  52. package/src/engine/graphics3/trail/trail_tube_write_geometry.js +13 -13
  53. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  54. package/src/generation/foliage/FOLIAGE_DESIGN.md +26 -5
  55. package/src/generation/foliage/LOD_REWORK_BRIEF_2026_10_27.md +35 -0
  56. package/src/generation/foliage/SELF_ORGANIZING_FRAMEWORK_BRIEF_2026_10_26.md +2 -1
  57. package/src/generation/foliage/TWO_FRONT_ENDS_BRIEF_2026_10_28.md +552 -0
  58. package/src/generation/foliage/analysis/tree_crown_opacity.d.ts.map +1 -1
  59. package/src/generation/foliage/analysis/tree_crown_opacity.js +2 -1
  60. package/src/generation/foliage/analysis/tree_render_cost.d.ts +5 -3
  61. package/src/generation/foliage/analysis/tree_render_cost.d.ts.map +1 -1
  62. package/src/generation/foliage/analysis/tree_render_cost.js +8 -7
  63. package/src/generation/foliage/asset/TreeAsset.d.ts +17 -0
  64. package/src/generation/foliage/asset/TreeAsset.d.ts.map +1 -1
  65. package/src/generation/foliage/asset/TreeAsset.js +20 -0
  66. package/src/generation/foliage/asset/TreeSpeciesCache.d.ts +69 -0
  67. package/src/generation/foliage/asset/TreeSpeciesCache.d.ts.map +1 -0
  68. package/src/generation/foliage/asset/TreeSpeciesCache.js +147 -0
  69. package/src/generation/foliage/asset/generate_tree.d.ts +10 -0
  70. package/src/generation/foliage/asset/generate_tree.d.ts.map +1 -1
  71. package/src/generation/foliage/asset/generate_tree.js +57 -29
  72. package/src/generation/foliage/asset/place_tree.d.ts +2 -1
  73. package/src/generation/foliage/asset/place_tree.d.ts.map +1 -1
  74. package/src/generation/foliage/asset/place_tree.js +2 -1
  75. package/src/generation/foliage/asset/tree_lod_plan.d.ts +4 -2
  76. package/src/generation/foliage/asset/tree_lod_plan.d.ts.map +1 -1
  77. package/src/generation/foliage/asset/tree_lod_plan.js +12 -14
  78. package/src/generation/foliage/asset/tree_shoot_instances.d.ts +119 -0
  79. package/src/generation/foliage/asset/tree_shoot_instances.d.ts.map +1 -0
  80. package/src/generation/foliage/asset/tree_shoot_instances.js +410 -0
  81. package/src/generation/foliage/asset/tree_shoot_prototypes.d.ts +155 -0
  82. package/src/generation/foliage/asset/tree_shoot_prototypes.d.ts.map +1 -0
  83. package/src/generation/foliage/asset/tree_shoot_prototypes.js +251 -0
  84. package/src/generation/foliage/config/TreeGrowth.d.ts +10 -0
  85. package/src/generation/foliage/config/TreeGrowth.d.ts.map +1 -0
  86. package/src/generation/foliage/config/TreeGrowth.js +18 -0
  87. package/src/generation/foliage/config/TreeLODConfig.d.ts +6 -0
  88. package/src/generation/foliage/config/TreeLODConfig.d.ts.map +1 -1
  89. package/src/generation/foliage/config/TreeLODConfig.js +7 -0
  90. package/src/generation/foliage/index.d.ts +3 -0
  91. package/src/generation/foliage/index.js +3 -0
  92. package/src/generation/foliage/material/foliage_tile.d.ts +6 -6
  93. package/src/generation/foliage/material/foliage_tile.js +3 -3
  94. package/src/generation/foliage/material/tree_cluster_atlas.d.ts +44 -0
  95. package/src/generation/foliage/material/tree_cluster_atlas.d.ts.map +1 -0
  96. package/src/generation/foliage/material/tree_cluster_atlas.js +37 -0
  97. package/src/generation/foliage/mesh/foliage_collect_attachments.js +2 -2
  98. package/src/generation/foliage/mesh/foliage_scale_spread.d.ts +14 -0
  99. package/src/generation/foliage/mesh/foliage_scale_spread.d.ts.map +1 -0
  100. package/src/generation/foliage/mesh/foliage_scale_spread.js +15 -0
  101. package/src/generation/foliage/mesh/tree_cluster_representatives.d.ts +8 -7
  102. package/src/generation/foliage/mesh/tree_cluster_representatives.d.ts.map +1 -1
  103. package/src/generation/foliage/mesh/tree_cluster_representatives.js +85 -40
  104. package/src/generation/foliage/mesh/tree_clusters.d.ts +26 -5
  105. package/src/generation/foliage/mesh/tree_clusters.d.ts.map +1 -1
  106. package/src/generation/foliage/mesh/tree_clusters.js +52 -39
  107. package/src/generation/foliage/mesh/tree_mesh_build_bark.d.ts.map +1 -1
  108. package/src/generation/foliage/mesh/tree_mesh_build_bark.js +32 -54
  109. package/src/generation/foliage/presets/make_tree_species_preset.d.ts +6 -1
  110. package/src/generation/foliage/presets/make_tree_species_preset.d.ts.map +1 -1
  111. package/src/generation/foliage/presets/make_tree_species_preset.js +157 -3
  112. package/src/generation/foliage/skeleton/TreeSkeleton.d.ts +19 -0
  113. package/src/generation/foliage/skeleton/TreeSkeleton.d.ts.map +1 -1
  114. package/src/generation/foliage/skeleton/TreeSkeleton.js +41 -0
  115. package/src/generation/foliage/skeleton/tree_skeleton_compute_joint_mechanics.d.ts +5 -0
  116. package/src/generation/foliage/skeleton/tree_skeleton_compute_joint_mechanics.d.ts.map +1 -1
  117. package/src/generation/foliage/skeleton/tree_skeleton_compute_joint_mechanics.js +8 -1
  118. package/src/generation/foliage/skeleton/tree_skeleton_copy_branches.d.ts +70 -0
  119. package/src/generation/foliage/skeleton/tree_skeleton_copy_branches.d.ts.map +1 -0
  120. package/src/generation/foliage/skeleton/tree_skeleton_copy_branches.js +171 -0
  121. package/src/generation/foliage/skeleton/tree_skeleton_extend_branch.d.ts +17 -0
  122. package/src/generation/foliage/skeleton/tree_skeleton_extend_branch.d.ts.map +1 -0
  123. package/src/generation/foliage/skeleton/tree_skeleton_extend_branch.js +79 -0
  124. package/src/generation/foliage/skeleton/tree_skeleton_fit_crown_frame.d.ts +12 -0
  125. package/src/generation/foliage/skeleton/tree_skeleton_fit_crown_frame.d.ts.map +1 -0
  126. package/src/generation/foliage/skeleton/tree_skeleton_fit_crown_frame.js +56 -0
  127. package/src/generation/foliage/skeleton/tree_skeleton_floor_girth.d.ts +11 -0
  128. package/src/generation/foliage/skeleton/tree_skeleton_floor_girth.d.ts.map +1 -0
  129. package/src/generation/foliage/skeleton/tree_skeleton_floor_girth.js +38 -0
  130. package/src/generation/foliage/skeleton/tree_skeleton_grow.d.ts +4 -11
  131. package/src/generation/foliage/skeleton/tree_skeleton_grow.d.ts.map +1 -1
  132. package/src/generation/foliage/skeleton/tree_skeleton_grow.js +8 -2034
  133. package/src/generation/foliage/skeleton/tree_skeleton_grow_framework.d.ts +22 -0
  134. package/src/generation/foliage/skeleton/tree_skeleton_grow_framework.d.ts.map +1 -0
  135. package/src/generation/foliage/skeleton/tree_skeleton_grow_framework.js +2050 -0
  136. package/src/generation/foliage/skeleton/tree_skeleton_grow_shoots.d.ts +10 -0
  137. package/src/generation/foliage/skeleton/tree_skeleton_grow_shoots.d.ts.map +1 -1
  138. package/src/generation/foliage/skeleton/tree_skeleton_grow_shoots.js +27 -56
  139. package/src/shade/descriptor/pipeline/render/DepthStencilState.d.ts +4 -0
  140. package/src/shade/descriptor/pipeline/render/DepthStencilState.d.ts.map +1 -1
  141. package/src/shade/descriptor/pipeline/render/DepthStencilState.js +170 -144
  142. package/src/shade/descriptor/pipeline/render/MultisampleState.d.ts +4 -0
  143. package/src/shade/descriptor/pipeline/render/MultisampleState.d.ts.map +1 -1
  144. package/src/shade/descriptor/pipeline/render/MultisampleState.js +78 -65
  145. package/src/shade/descriptor/pipeline/render/RenderPipelineDescriptor.d.ts.map +1 -1
  146. package/src/shade/descriptor/pipeline/render/RenderPipelineDescriptor.js +176 -172
  147. package/src/shade/descriptor/pipeline/render/StencilFaceState.d.ts +4 -0
  148. package/src/shade/descriptor/pipeline/render/StencilFaceState.d.ts.map +1 -1
  149. package/src/shade/descriptor/pipeline/render/StencilFaceState.js +107 -88
  150. package/src/shade/playground/particle_ecs/README.md +9 -8
  151. package/src/shade/playground/particle_ecs/bonfire_editor.js +3 -3
  152. package/src/shade/playground/particle_ecs/bonfire_effects.d.ts +6 -6
  153. package/src/shade/playground/particle_ecs/bonfire_effects.js +6 -6
  154. package/src/shade/playground/particle_editor/README.md +14 -11
  155. package/src/shade/playground/particle_system/particle_prototype.js +18 -18
  156. package/src/shade/playground/particle_system/particle_scene.js +13 -13
  157. package/src/shade/playground/probe_clipmap/README.md +42 -0
  158. package/src/shade/playground/probe_clipmap/index.html +178 -0
  159. package/src/shade/playground/probe_clipmap/main.d.ts +8 -0
  160. package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -0
  161. package/src/shade/playground/probe_clipmap/main.js +360 -0
  162. package/src/shade/renderer/Renderer.d.ts +3 -1
  163. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  164. package/src/shade/renderer/Renderer.js +94 -38
  165. package/src/shade/renderer/extension/ViewTextures.d.ts +2 -1
  166. package/src/shade/renderer/extension/ViewTextures.d.ts.map +1 -1
  167. package/src/shade/renderer/extension/ViewTextures.js +2 -1
  168. package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
  169. package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
  170. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +6 -6
  171. package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
  172. package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
  173. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts +34 -12
  174. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts.map +1 -1
  175. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.js +56 -15
  176. package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.d.ts +2 -2
  177. package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.d.ts.map +1 -1
  178. package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.js +13 -26
  179. package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.d.ts +25 -2
  180. package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.d.ts.map +1 -1
  181. package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.js +54 -32
  182. package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_VERDICT.d.ts +14 -0
  183. package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_VERDICT.d.ts.map +1 -0
  184. package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_VERDICT.js +37 -0
  185. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_arena.d.ts.map +1 -1
  186. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_arena.js +16 -0
  187. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_claim.d.ts.map +1 -1
  188. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_claim.js +2 -6
  189. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_descent.d.ts +131 -0
  190. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_descent.d.ts.map +1 -0
  191. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_descent.js +467 -0
  192. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_instance.d.ts +24 -0
  193. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_instance.d.ts.map +1 -0
  194. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_instance.js +111 -0
  195. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_rule.d.ts +42 -0
  196. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_rule.d.ts.map +1 -0
  197. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_rule.js +404 -0
  198. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_stat.d.ts +16 -0
  199. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_stat.d.ts.map +1 -0
  200. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_stat.js +23 -0
  201. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_want.d.ts +17 -0
  202. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_want.d.ts.map +1 -0
  203. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_want.js +65 -0
  204. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_collect.d.ts.map +1 -1
  205. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_collect.js +14 -70
  206. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_traverse.d.ts.map +1 -1
  207. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_traverse.js +13 -773
  208. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_cut_descent.d.ts +55 -0
  209. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_cut_descent.d.ts.map +1 -0
  210. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_cut_descent.js +248 -0
  211. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.d.ts.map +1 -1
  212. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.js +15 -174
  213. package/src/shade/renderer/global_illumination/brick4/gpu/draw/chunk_brick4_probe_meta_pick2.d.ts.map +1 -1
  214. package/src/shade/renderer/global_illumination/brick4/gpu/draw/chunk_brick4_probe_meta_pick2.js +8 -24
  215. package/src/shade/renderer/global_illumination/brick4/gpu/draw/chunk_brick4_sample_forward_indirect.d.ts.map +1 -1
  216. package/src/shade/renderer/global_illumination/brick4/gpu/draw/chunk_brick4_sample_forward_indirect.js +1 -25
  217. package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_get_visibility_mask.d.ts.map +1 -1
  218. package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_get_visibility_mask.js +5 -23
  219. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +25 -4
  220. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
  221. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +126 -8
  222. package/src/shade/renderer/global_illumination/probe_clipmap/PROBE_CLIPMAP_PROPOSAL_2026_10_27.md +832 -4
  223. package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.d.ts +7 -0
  224. package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.d.ts.map +1 -1
  225. package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.js +8 -0
  226. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts +16 -0
  227. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts.map +1 -1
  228. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.js +9 -0
  229. package/src/shade/renderer/global_illumination/probe_clipmap/brick/{mesh/chunk_mesh_brick_object.d.ts → chunk_brick_object.d.ts} +8 -8
  230. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_object.d.ts.map +1 -0
  231. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_object.js +42 -0
  232. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_provider.d.ts +45 -0
  233. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_provider.d.ts.map +1 -0
  234. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_provider.js +93 -0
  235. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK_INSTANCE_STRUCT.d.ts +0 -7
  236. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK_INSTANCE_STRUCT.d.ts.map +1 -1
  237. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK_INSTANCE_STRUCT.js +0 -8
  238. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_instance.d.ts +2 -4
  239. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_instance.d.ts.map +1 -1
  240. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_instance.js +5 -8
  241. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_provider.d.ts.map +1 -1
  242. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_provider.js +13 -22
  243. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGEO_BRICK.d.ts +99 -0
  244. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGEO_BRICK.d.ts.map +1 -0
  245. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGEO_BRICK.js +139 -0
  246. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGeoBrickProvider.d.ts +65 -0
  247. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGeoBrickProvider.d.ts.map +1 -0
  248. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/VGeoBrickProvider.js +393 -0
  249. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_box.d.ts +17 -0
  250. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_box.d.ts.map +1 -0
  251. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_box.js +36 -0
  252. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_pair.d.ts +29 -0
  253. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_pair.d.ts.map +1 -0
  254. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_pair.js +108 -0
  255. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_texel.d.ts +31 -0
  256. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_texel.d.ts.map +1 -0
  257. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_texel.js +113 -0
  258. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_triangle.d.ts +36 -0
  259. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_triangle.d.ts.map +1 -0
  260. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/chunk_vgeo_brick_triangle.js +85 -0
  261. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_distance.d.ts +23 -0
  262. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_distance.d.ts.map +1 -0
  263. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_distance.js +273 -0
  264. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_gather.d.ts +13 -0
  265. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_gather.d.ts.map +1 -0
  266. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_gather.js +151 -0
  267. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_traverse.d.ts +13 -0
  268. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_traverse.d.ts.map +1 -0
  269. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_traverse.js +133 -0
  270. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_wait.d.ts +22 -0
  271. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_wait.d.ts.map +1 -0
  272. package/src/shade/renderer/global_illumination/probe_clipmap/brick/vgeo/shader_vgeo_brick_wait.js +135 -0
  273. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts +20 -6
  274. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts.map +1 -1
  275. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js +152 -10
  276. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts +7 -0
  277. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts.map +1 -1
  278. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.js +8 -0
  279. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts +14 -2
  280. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts.map +1 -1
  281. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.js +50 -5
  282. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_cage.d.ts +19 -0
  283. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_cage.d.ts.map +1 -0
  284. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_cage.js +40 -0
  285. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.d.ts +72 -0
  286. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.d.ts.map +1 -0
  287. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.js +343 -0
  288. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.d.ts +29 -0
  289. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.d.ts.map +1 -0
  290. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.js +188 -0
  291. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.d.ts +26 -0
  292. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.d.ts.map +1 -0
  293. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.js +132 -0
  294. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts +4 -0
  295. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts.map +1 -1
  296. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.js +26 -3
  297. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.d.ts +3 -0
  298. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.d.ts.map +1 -1
  299. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.js +8 -1
  300. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_diffuse.d.ts +12 -0
  301. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_diffuse.d.ts.map +1 -0
  302. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_diffuse.js +101 -0
  303. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.d.ts +1 -1
  304. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.js +1 -1
  305. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.d.ts +15 -0
  306. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.d.ts.map +1 -0
  307. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.js +175 -0
  308. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts +26 -0
  309. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts.map +1 -0
  310. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.js +210 -0
  311. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_retire.d.ts +3 -3
  312. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_retire.js +3 -3
  313. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.d.ts +2 -1
  314. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.d.ts.map +1 -1
  315. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.js +5 -1
  316. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts.map +1 -1
  317. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.js +3 -10
  318. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.d.ts +5 -9
  319. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.d.ts.map +1 -1
  320. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.js +9 -110
  321. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.d.ts +27 -0
  322. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.d.ts.map +1 -0
  323. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.js +110 -0
  324. package/src/shade/renderer/light/world_cluster/chunk_world_light_cluster_lookup.d.ts +13 -0
  325. package/src/shade/renderer/light/world_cluster/chunk_world_light_cluster_lookup.d.ts.map +1 -1
  326. package/src/shade/renderer/light/world_cluster/chunk_world_light_cluster_lookup.js +40 -0
  327. package/src/shade/renderer/light/world_cluster/graph_build_world_light_clusters.d.ts +11 -6
  328. package/src/shade/renderer/light/world_cluster/graph_build_world_light_clusters.d.ts.map +1 -1
  329. package/src/shade/renderer/light/world_cluster/graph_build_world_light_clusters.js +15 -8
  330. package/src/shade/renderer/light/world_cluster/shader_world_cluster_assign_lights.d.ts +9 -2
  331. package/src/shade/renderer/light/world_cluster/shader_world_cluster_assign_lights.d.ts.map +1 -1
  332. package/src/shade/renderer/light/world_cluster/shader_world_cluster_assign_lights.js +25 -11
  333. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  334. package/src/shade/renderer/particles/DESIGN.md +151 -42
  335. package/src/shade/renderer/particles/EMITTER_GLOBAL_STATE_PLAN_2026_10_29.md +283 -0
  336. package/src/shade/renderer/particles/GPUParticleSystem.d.ts +10 -2
  337. package/src/shade/renderer/particles/GPUParticleSystem.d.ts.map +1 -1
  338. package/src/shade/renderer/particles/GPUParticleSystem.js +46 -8
  339. package/src/shade/renderer/particles/ParticleConstants.d.ts +23 -6
  340. package/src/shade/renderer/particles/ParticleConstants.d.ts.map +1 -1
  341. package/src/shade/renderer/particles/ParticleConstants.js +25 -6
  342. package/src/shade/renderer/particles/bounds/chunk_particle_bounds.js +5 -5
  343. package/src/shade/renderer/particles/bounds/shader_particle_bounds.js +187 -187
  344. package/src/shade/renderer/particles/data/PARTICLE_DATABASE_SPEC.d.ts +20 -9
  345. package/src/shade/renderer/particles/data/PARTICLE_DATABASE_SPEC.d.ts.map +1 -1
  346. package/src/shade/renderer/particles/data/PARTICLE_DATABASE_SPEC.js +36 -10
  347. package/src/shade/renderer/particles/data/PARTICLE_EMITTER_STRUCT.d.ts +8 -7
  348. package/src/shade/renderer/particles/data/PARTICLE_EMITTER_STRUCT.d.ts.map +1 -1
  349. package/src/shade/renderer/particles/data/PARTICLE_EMITTER_STRUCT.js +25 -16
  350. package/src/shade/renderer/particles/data/PARTICLE_FIELD_BINDING.d.ts +51 -0
  351. package/src/shade/renderer/particles/data/PARTICLE_FIELD_BINDING.d.ts.map +1 -0
  352. package/src/shade/renderer/particles/data/PARTICLE_FIELD_BINDING.js +56 -0
  353. package/src/shade/renderer/particles/data/particle_emitter_record.d.ts.map +1 -1
  354. package/src/shade/renderer/particles/data/particle_emitter_record.js +2 -0
  355. package/src/shade/renderer/particles/graph/ParticleGroupBuilder.d.ts +1 -1
  356. package/src/shade/renderer/particles/graph/ParticleGroupBuilder.js +1 -1
  357. package/src/shade/renderer/particles/graph/ParticleNodeDescription.d.ts +22 -11
  358. package/src/shade/renderer/particles/graph/ParticleNodeDescription.d.ts.map +1 -1
  359. package/src/shade/renderer/particles/graph/ParticleNodeDescription.js +14 -11
  360. package/src/shade/renderer/particles/graph/ParticleNodeRegistry.d.ts +4 -4
  361. package/src/shade/renderer/particles/graph/ParticleNodeRegistry.d.ts.map +1 -1
  362. package/src/shade/renderer/particles/graph/ParticleNodeRegistry.js +59 -24
  363. package/src/shade/renderer/particles/graph/ParticleValueType.d.ts +3 -3
  364. package/src/shade/renderer/particles/graph/ParticleValueType.js +287 -287
  365. package/src/shade/renderer/particles/graph/compile_particle_graph.d.ts +13 -6
  366. package/src/shade/renderer/particles/graph/compile_particle_graph.d.ts.map +1 -1
  367. package/src/shade/renderer/particles/graph/compile_particle_graph.js +46 -27
  368. package/src/shade/renderer/particles/graph/infer_particle_graph_types.d.ts +8 -2
  369. package/src/shade/renderer/particles/graph/infer_particle_graph_types.d.ts.map +1 -1
  370. package/src/shade/renderer/particles/graph/infer_particle_graph_types.js +240 -234
  371. package/src/shade/renderer/particles/graph/make_particle_group.d.ts +1 -1
  372. package/src/shade/renderer/particles/graph/make_particle_group.js +1 -1
  373. package/src/shade/renderer/particles/graph/particle_graph_authoring.d.ts +3 -2
  374. package/src/shade/renderer/particles/graph/particle_graph_authoring.d.ts.map +1 -1
  375. package/src/shade/renderer/particles/graph/particle_graph_authoring.js +3 -2
  376. package/src/shade/renderer/particles/graph/particle_graph_distributions.js +170 -170
  377. package/src/shade/renderer/particles/graph/particle_graph_json.d.ts +25 -16
  378. package/src/shade/renderer/particles/graph/particle_graph_json.d.ts.map +1 -1
  379. package/src/shade/renderer/particles/graph/particle_graph_json.js +16 -2
  380. package/src/shade/renderer/particles/graph/particle_node_parameters.d.ts +29 -15
  381. package/src/shade/renderer/particles/graph/particle_node_parameters.d.ts.map +1 -1
  382. package/src/shade/renderer/particles/graph/particle_node_parameters.js +54 -22
  383. package/src/shade/renderer/particles/graph/particle_node_presentation.d.ts.map +1 -1
  384. package/src/shade/renderer/particles/graph/particle_node_presentation.js +18 -8
  385. package/src/shade/renderer/particles/graph/validate_particle_graph.d.ts +9 -2
  386. package/src/shade/renderer/particles/graph/validate_particle_graph.d.ts.map +1 -1
  387. package/src/shade/renderer/particles/graph/validate_particle_graph.js +70 -32
  388. package/src/shade/renderer/particles/graph_particles.d.ts +9 -4
  389. package/src/shade/renderer/particles/graph_particles.d.ts.map +1 -1
  390. package/src/shade/renderer/particles/graph_particles.js +27 -4
  391. package/src/shade/renderer/particles/isa/InstructionStream.d.ts +7 -6
  392. package/src/shade/renderer/particles/isa/InstructionStream.d.ts.map +1 -1
  393. package/src/shade/renderer/particles/isa/InstructionStream.js +17 -16
  394. package/src/shade/renderer/particles/isa/ParticleAssembler.d.ts +17 -0
  395. package/src/shade/renderer/particles/isa/ParticleAssembler.d.ts.map +1 -1
  396. package/src/shade/renderer/particles/isa/ParticleAssembler.js +35 -0
  397. package/src/shade/renderer/particles/isa/ParticleProgram.d.ts +26 -6
  398. package/src/shade/renderer/particles/isa/ParticleProgram.d.ts.map +1 -1
  399. package/src/shade/renderer/particles/isa/ParticleProgram.js +61 -9
  400. package/src/shade/renderer/particles/isa/ParticleVMISA.d.ts +55 -4
  401. package/src/shade/renderer/particles/isa/ParticleVMISA.d.ts.map +1 -1
  402. package/src/shade/renderer/particles/isa/ParticleVMISA.js +79 -10
  403. package/src/shade/renderer/particles/isa/particle_assembly.d.ts +20 -6
  404. package/src/shade/renderer/particles/isa/particle_assembly.d.ts.map +1 -1
  405. package/src/shade/renderer/particles/isa/particle_assembly.js +136 -25
  406. package/src/shade/renderer/particles/isa/particle_link_global_fields.d.ts +20 -0
  407. package/src/shade/renderer/particles/isa/particle_link_global_fields.d.ts.map +1 -0
  408. package/src/shade/renderer/particles/isa/particle_link_global_fields.js +46 -0
  409. package/src/shade/renderer/particles/isa/validate_particle_program.js +8 -8
  410. package/src/shade/renderer/particles/layout/ParticleLayout.d.ts +62 -28
  411. package/src/shade/renderer/particles/layout/ParticleLayout.d.ts.map +1 -1
  412. package/src/shade/renderer/particles/layout/ParticleLayout.js +102 -62
  413. package/src/shade/renderer/particles/optimizer/dag/optimize_particle_program_vector.d.ts.map +1 -1
  414. package/src/shade/renderer/particles/optimizer/dag/optimize_particle_program_vector.js +2 -0
  415. package/src/shade/renderer/particles/optimizer/dag/particle_vector_groups.js +1 -1
  416. package/src/shade/renderer/particles/optimizer/dag/particle_vector_lift.js +4 -3
  417. package/src/shade/renderer/particles/optimizer/dag/particle_vector_lower.js +2 -2
  418. package/src/shade/renderer/particles/optimizer/dag/particle_vector_pack.d.ts +3 -3
  419. package/src/shade/renderer/particles/optimizer/dag/particle_vector_pack.js +11 -11
  420. package/src/shade/renderer/particles/optimizer/optimize_particle_program.d.ts +4 -4
  421. package/src/shade/renderer/particles/optimizer/optimize_particle_program.d.ts.map +1 -1
  422. package/src/shade/renderer/particles/optimizer/optimize_particle_program.js +5 -4
  423. package/src/shade/renderer/particles/optimizer/particle_integer_bounds.d.ts +1 -1
  424. package/src/shade/renderer/particles/optimizer/particle_integer_bounds.js +1 -1
  425. package/src/shade/renderer/particles/optimizer/particle_program_equivalence.d.ts +4 -4
  426. package/src/shade/renderer/particles/optimizer/particle_program_equivalence.d.ts.map +1 -1
  427. package/src/shade/renderer/particles/optimizer/particle_program_equivalence.js +13 -11
  428. package/src/shade/renderer/particles/optimizer/particle_program_fuzz.js +7 -7
  429. package/src/shade/renderer/particles/optimizer/particle_vm_semantics.d.ts +3 -2
  430. package/src/shade/renderer/particles/optimizer/particle_vm_semantics.d.ts.map +1 -1
  431. package/src/shade/renderer/particles/optimizer/particle_vm_semantics.js +5 -4
  432. package/src/shade/renderer/particles/optimizer/pass_allocate_registers.d.ts.map +1 -1
  433. package/src/shade/renderer/particles/optimizer/pass_dedup_constants.d.ts.map +1 -1
  434. package/src/shade/renderer/particles/optimizer/pass_eliminate_dead_code.d.ts.map +1 -1
  435. package/src/shade/renderer/particles/optimizer/pass_eliminate_dead_code.js +51 -51
  436. package/src/shade/renderer/particles/optimizer/pass_fold_constants.d.ts.map +1 -1
  437. package/src/shade/renderer/particles/optimizer/pass_fold_constants.js +5 -5
  438. package/src/shade/renderer/particles/optimizer/pass_inline_constants.d.ts.map +1 -1
  439. package/src/shade/renderer/particles/optimizer/pass_narrow_widths.d.ts.map +1 -1
  440. package/src/shade/renderer/particles/optimizer/pass_pack_registers.d.ts.map +1 -1
  441. package/src/shade/renderer/particles/optimizer/pass_peephole.d.ts.map +1 -1
  442. package/src/shade/renderer/particles/optimizer/pass_propagate_copies.d.ts.map +1 -1
  443. package/src/shade/renderer/particles/optimizer/pass_schedule.d.ts.map +1 -1
  444. package/src/shade/renderer/particles/optimizer/pass_schedule.js +2 -2
  445. package/src/shade/renderer/particles/optimizer/pass_share_subexpressions.d.ts.map +1 -1
  446. package/src/shade/renderer/particles/optimizer/pass_share_subexpressions.js +5 -4
  447. package/src/shade/renderer/particles/runtime/EmitterRegistry.d.ts +93 -22
  448. package/src/shade/renderer/particles/runtime/EmitterRegistry.d.ts.map +1 -1
  449. package/src/shade/renderer/particles/runtime/EmitterRegistry.js +336 -29
  450. package/src/shade/renderer/particles/runtime/GPUParticleEmitterContext.d.ts +43 -3
  451. package/src/shade/renderer/particles/runtime/GPUParticleEmitterContext.d.ts.map +1 -1
  452. package/src/shade/renderer/particles/runtime/GPUParticleEmitterContext.js +43 -3
  453. package/src/shade/renderer/particles/runtime/ParticleEmitter.d.ts +56 -26
  454. package/src/shade/renderer/particles/runtime/ParticleEmitter.d.ts.map +1 -1
  455. package/src/shade/renderer/particles/runtime/ParticleEmitter.js +89 -33
  456. package/src/shade/renderer/particles/runtime/ParticleGlobalFields.d.ts +85 -0
  457. package/src/shade/renderer/particles/runtime/ParticleGlobalFields.d.ts.map +1 -0
  458. package/src/shade/renderer/particles/runtime/ParticleGlobalFields.js +221 -0
  459. package/src/shade/renderer/particles/runtime/ProgramHeap.d.ts +143 -18
  460. package/src/shade/renderer/particles/runtime/ProgramHeap.d.ts.map +1 -1
  461. package/src/shade/renderer/particles/runtime/ProgramHeap.js +378 -28
  462. package/src/shade/renderer/particles/runtime/create_particle_effect.d.ts +19 -7
  463. package/src/shade/renderer/particles/runtime/create_particle_effect.d.ts.map +1 -1
  464. package/src/shade/renderer/particles/runtime/create_particle_effect.js +22 -9
  465. package/src/shade/renderer/particles/shaders/chunk_particle_billboard_vertex.js +8 -8
  466. package/src/shade/renderer/particles/shaders/chunk_particle_render_math.js +1 -1
  467. package/src/shade/renderer/particles/shaders/chunk_particle_setup_context.d.ts +3 -0
  468. package/src/shade/renderer/particles/shaders/chunk_particle_setup_context.d.ts.map +1 -1
  469. package/src/shade/renderer/particles/shaders/chunk_particle_setup_context.js +4 -0
  470. package/src/shade/renderer/particles/shaders/shader_particle_field_bind.d.ts +30 -0
  471. package/src/shade/renderer/particles/shaders/shader_particle_field_bind.d.ts.map +1 -0
  472. package/src/shade/renderer/particles/shaders/shader_particle_field_bind.js +121 -0
  473. package/src/shade/renderer/particles/vm/PARTICLE_VM_CONTEXT_STRUCT.d.ts.map +1 -1
  474. package/src/shade/renderer/particles/vm/PARTICLE_VM_CONTEXT_STRUCT.js +3 -1
  475. package/src/shade/renderer/particles/vm/ParticleVMReference.d.ts +12 -4
  476. package/src/shade/renderer/particles/vm/ParticleVMReference.d.ts.map +1 -1
  477. package/src/shade/renderer/particles/vm/ParticleVMReference.js +48 -11
  478. package/src/shade/renderer/particles/vm/chunk_particle_vm.d.ts.map +1 -1
  479. package/src/shade/renderer/particles/vm/chunk_particle_vm.js +36 -14
  480. package/src/shade/renderer/postprocess/PostProcess.d.ts.map +1 -1
  481. package/src/shade/renderer/postprocess/PostProcess.js +2 -1
  482. package/src/shade/renderer/postprocess/gtao/GTAO.d.ts +31 -19
  483. package/src/shade/renderer/postprocess/gtao/GTAO.d.ts.map +1 -1
  484. package/src/shade/renderer/postprocess/gtao/GTAO.js +44 -30
  485. package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.d.ts.map +1 -1
  486. package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.js +16 -2
  487. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  488. package/src/shade/renderer/postprocess/nss/NSS.d.ts.map +1 -1
  489. package/src/shade/renderer/postprocess/nss/NSS.js +4 -3
  490. package/src/shade/renderer/postprocess/ssr/SSR.d.ts +7 -1
  491. package/src/shade/renderer/postprocess/ssr/SSR.d.ts.map +1 -1
  492. package/src/shade/renderer/postprocess/ssr/SSR.js +16 -0
  493. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_add_hit_irradiance.d.ts +20 -2
  494. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_add_hit_irradiance.d.ts.map +1 -1
  495. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_add_hit_irradiance.js +53 -3
  496. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.d.ts +10 -2
  497. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.d.ts.map +1 -1
  498. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.js +31 -3
  499. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.d.ts.map +1 -1
  500. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.js +17 -11
  501. package/src/shade/renderer/postprocess/taa/TAA.d.ts +4 -2
  502. package/src/shade/renderer/postprocess/taa/TAA.d.ts.map +1 -1
  503. package/src/shade/renderer/postprocess/taa/TAA.js +6 -1
  504. package/src/shade/renderer/postprocess/taa/chunk_fsr2_compute_depth_clip.d.ts.map +1 -1
  505. package/src/shade/renderer/postprocess/taa/chunk_fsr2_compute_depth_clip.js +10 -5
  506. package/src/shade/renderer/postprocess/taa/shader_taa.d.ts.map +1 -1
  507. package/src/shade/renderer/postprocess/taa/shader_taa.js +15 -12
  508. package/src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.d.ts.map +1 -1
  509. package/src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.js +26 -17
  510. package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect.d.ts +4 -3
  511. package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect.d.ts.map +1 -1
  512. package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect.js +6 -4
  513. package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect_probe_clipmap.d.ts +12 -0
  514. package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect_probe_clipmap.d.ts.map +1 -0
  515. package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect_probe_clipmap.js +57 -0
  516. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts +4 -2
  517. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts.map +1 -1
  518. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.js +4 -2
  519. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts +8 -2
  520. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts.map +1 -1
  521. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.js +28 -15
  522. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_draw.d.ts +2 -1
  523. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_draw.d.ts.map +1 -1
  524. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_draw.js +19 -3
  525. package/src/shade/renderer/rasterize/native/graph_rasterize_meshes_alpha_tested.d.ts.map +1 -1
  526. package/src/shade/renderer/rasterize/native/graph_rasterize_meshes_alpha_tested.js +4 -2
  527. package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.d.ts +3 -1
  528. package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.d.ts.map +1 -1
  529. package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.js +27 -14
  530. package/src/shade/renderer/rasterize/native/oit/shader_oit_resolve_moments.d.ts +2 -1
  531. package/src/shade/renderer/rasterize/native/oit/shader_oit_resolve_moments.d.ts.map +1 -1
  532. package/src/shade/renderer/rasterize/native/oit/shader_oit_resolve_moments.js +19 -3
  533. package/src/shade/renderer/shader/chunk/geometry/meshlet/chunk_read_meshlet_triangle_bounds.d.ts +2 -8
  534. package/src/shade/renderer/shader/chunk/geometry/meshlet/chunk_read_meshlet_triangle_bounds.d.ts.map +1 -1
  535. package/src/shade/renderer/shader/chunk/geometry/meshlet/chunk_read_meshlet_triangle_bounds.js +25 -52
  536. package/src/shade/renderer/shader/chunk/geometry/meshlet/chunk_read_meshlet_triangle_positions.d.ts +15 -0
  537. package/src/shade/renderer/shader/chunk/geometry/meshlet/chunk_read_meshlet_triangle_positions.d.ts.map +1 -0
  538. package/src/shade/renderer/shader/chunk/geometry/meshlet/chunk_read_meshlet_triangle_positions.js +52 -0
  539. package/src/shade/renderer/shader/chunk/geometry/triangle/TRIANGLE_POSITIONS_STRUCT.d.ts +7 -0
  540. package/src/shade/renderer/shader/chunk/geometry/triangle/TRIANGLE_POSITIONS_STRUCT.d.ts.map +1 -0
  541. package/src/shade/renderer/shader/chunk/geometry/triangle/TRIANGLE_POSITIONS_STRUCT.js +12 -0
  542. package/src/shade/renderer/shader/chunk/grid/chunk_index_to_grid2d_reciprocal.d.ts +22 -0
  543. package/src/shade/renderer/shader/chunk/grid/chunk_index_to_grid2d_reciprocal.d.ts.map +1 -0
  544. package/src/shade/renderer/shader/chunk/grid/chunk_index_to_grid2d_reciprocal.js +37 -0
  545. package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_mask_weights_by_visibility.d.ts.map +1 -1
  546. package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_mask_weights_by_visibility.js +26 -60
  547. package/src/shade/renderer/shader/chunk/light/probe/chunk_probe_visibility_weight.d.ts +23 -0
  548. package/src/shade/renderer/shader/chunk/light/probe/chunk_probe_visibility_weight.d.ts.map +1 -0
  549. package/src/shade/renderer/shader/chunk/light/probe/chunk_probe_visibility_weight.js +54 -0
  550. package/src/shade/renderer/shader/chunk/math/chunk_f16_round_stochastic.d.ts +25 -0
  551. package/src/shade/renderer/shader/chunk/math/chunk_f16_round_stochastic.d.ts.map +1 -0
  552. package/src/shade/renderer/shader/chunk/math/chunk_f16_round_stochastic.js +43 -0
  553. package/src/shade/renderer/shader/chunk/random/chunk_jitter_from_vectors.d.ts +14 -0
  554. package/src/shade/renderer/shader/chunk/random/chunk_jitter_from_vectors.d.ts.map +1 -0
  555. package/src/shade/renderer/shader/chunk/random/chunk_jitter_from_vectors.js +37 -0
  556. package/src/shade/renderer/shader/chunk/random/reservoir/chunk_pick2_wrs_mat2x4.d.ts +27 -0
  557. package/src/shade/renderer/shader/chunk/random/reservoir/chunk_pick2_wrs_mat2x4.d.ts.map +1 -0
  558. package/src/shade/renderer/shader/chunk/random/reservoir/chunk_pick2_wrs_mat2x4.js +61 -0
  559. package/src/shade/renderer/shader/chunk/spherical_harmonics/l1i/chunk_resolve_irradiance_sh_to_specular.d.ts +21 -0
  560. package/src/shade/renderer/shader/chunk/spherical_harmonics/l1i/chunk_resolve_irradiance_sh_to_specular.d.ts.map +1 -0
  561. package/src/shade/renderer/shader/chunk/spherical_harmonics/l1i/chunk_resolve_irradiance_sh_to_specular.js +41 -0
  562. package/src/shade/renderer/texture/util/texture_fill_rectangle.d.ts.map +1 -1
  563. package/src/shade/renderer/texture/util/texture_fill_rectangle.js +282 -267
  564. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts +8 -4
  565. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts.map +1 -1
  566. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.js +36 -36
  567. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts +6 -1
  568. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts.map +1 -1
  569. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.js +498 -484
  570. package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.d.ts +15 -2
  571. package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.d.ts.map +1 -1
  572. package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.js +57 -3
  573. package/src/shade/renderer/volumetrics/irradiance_clipmap/shader_irradiance_clipmap_build.d.ts.map +1 -1
  574. package/src/shade/renderer/volumetrics/irradiance_clipmap/shader_irradiance_clipmap_build.js +197 -191
  575. package/src/shade/renderer/volumetrics/taa/shader_volumetrics_taa.js +4 -4
  576. package/src/shade/renderer/water/GPUWaterRenderer.d.ts +2 -1
  577. package/src/shade/renderer/water/GPUWaterRenderer.d.ts.map +1 -1
  578. package/src/shade/renderer/water/GPUWaterRenderer.js +5 -1
  579. package/src/shade/renderer/water/chunk_water_gi.d.ts +13 -3
  580. package/src/shade/renderer/water/chunk_water_gi.d.ts.map +1 -1
  581. package/src/shade/renderer/water/chunk_water_gi.js +47 -5
  582. package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
  583. package/src/shade/renderer/water/shader_water.d.ts +3 -2
  584. package/src/shade/renderer/water/shader_water.d.ts.map +1 -1
  585. package/src/shade/renderer/water/shader_water.js +9 -3
  586. package/src/shade/renderer/geometry/sdf/SDF_BUILD_SETTINGS_STRUCT.d.ts +0 -3
  587. package/src/shade/renderer/geometry/sdf/SDF_BUILD_SETTINGS_STRUCT.d.ts.map +0 -1
  588. package/src/shade/renderer/geometry/sdf/SFD_BUILD_WORKGROUP_SIZE.d.ts +0 -2
  589. package/src/shade/renderer/geometry/sdf/SFD_BUILD_WORKGROUP_SIZE.d.ts.map +0 -1
  590. package/src/shade/renderer/geometry/sdf/chunk_blas_query_sdf.d.ts +0 -8
  591. package/src/shade/renderer/geometry/sdf/chunk_blas_query_sdf.d.ts.map +0 -1
  592. package/src/shade/renderer/geometry/sdf/chunk_blas_query_volume_sign.d.ts +0 -3
  593. package/src/shade/renderer/geometry/sdf/chunk_blas_query_volume_sign.d.ts.map +0 -1
  594. package/src/shade/renderer/geometry/sdf/shader_build_sdf.d.ts +0 -3
  595. package/src/shade/renderer/geometry/sdf/shader_build_sdf.d.ts.map +0 -1
  596. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_object.d.ts.map +0 -1
  597. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_object.js +0 -42
  598. package/src/shade/renderer/particles/shaders/shader_particle_init_free_list.d.ts +0 -31
  599. package/src/shade/renderer/particles/shaders/shader_particle_init_free_list.d.ts.map +0 -1
  600. package/src/shade/renderer/shadow/vsm/VSMMoverTracker.d.ts +0 -42
  601. package/src/shade/renderer/shadow/vsm/VSMMoverTracker.d.ts.map +0 -1
  602. package/src/shade/renderer/shadow/vsm/VSM_MOVER_LAYOUT.d.ts +0 -54
  603. package/src/shade/renderer/shadow/vsm/VSM_MOVER_LAYOUT.d.ts.map +0 -1
  604. package/src/shade/renderer/shadow/vsm/shader/chunk_vsm_append_mover.d.ts +0 -14
  605. package/src/shade/renderer/shadow/vsm/shader/chunk_vsm_append_mover.d.ts.map +0 -1
  606. package/src/shade/renderer/shadow/vsm/shader/shader_vsm_movers.d.ts +0 -30
  607. package/src/shade/renderer/shadow/vsm/shader/shader_vsm_movers.d.ts.map +0 -1
  608. package/src/shade/renderer/shadow/vsm/shader/shader_vsm_skinned_movers.d.ts +0 -23
  609. package/src/shade/renderer/shadow/vsm/shader/shader_vsm_skinned_movers.d.ts.map +0 -1
@@ -0,0 +1,135 @@
1
+ import { chunk_vgeo_cut_arena } from "../../../../geometry/virtual/runtime/cut/chunk_vgeo_cut_arena.js";
2
+ import { chunk_vgeo_cut_want } from "../../../../geometry/virtual/runtime/cut/chunk_vgeo_cut_want.js";
3
+ import { VGEO_CUT_PARAMS_STRUCT } from "../../../../geometry/virtual/runtime/cut/VGEO_CUT_PARAMS_STRUCT.js";
4
+ import { VGEO_PAGE_ROW_NONE } from "../../../../geometry/virtual/runtime/layout/VGEO_PAGE_ROW_NONE.js";
5
+ import { COLLECTION_U32_STRUCT_READ } from "../../../../gpu_primitive/COLLECTION_U32_STRUCT_READ.js";
6
+ import { COLLECTION_U32_STRUCT_WRITE } from "../../../../gpu_primitive/COLLECTION_U32_STRUCT_WRITE.js";
7
+ import { chunk_folded_workgroup_index } from "../../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
8
+ import { CodeChunk } from "../../../../shader/compiler/CodeChunk.js";
9
+ import { ComputeShader } from "../../../../shader/ComputeShader.js";
10
+ import { ShaderResourceSetDescriptor } from "../../../../shader/resource/ShaderResourceSetDescriptor.js";
11
+ import { atomic_u32, u32 } from "../../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
12
+ import { WebGPUArray } from "../../../../shader/type/WebGPUArray.js";
13
+ import {
14
+ BRICK_PENDING_RESOURCE,
15
+ BRICK_RING_RESOURCE,
16
+ BRICK_STATE_RESOURCE,
17
+ chunk_brick_clipmap,
18
+ chunk_brick_clipmap_enqueue
19
+ } from "../chunk_brick_clipmap.js";
20
+ import { VGEO_BRICK_SETTINGS, VGEO_BRICK_WAIT_OFFSET, VGEO_BRICK_WAIT_WORDS } from "./VGEO_BRICK.js";
21
+
22
+ /**
23
+ * Lanes of the wait: a waiting cell each.
24
+ * @type {number}
25
+ */
26
+ export const VGEO_BRICK_WAIT_WORKGROUP_SIZE = 64;
27
+
28
+ const resources = new ShaderResourceSetDescriptor();
29
+
30
+ resources.setImmediate("settings", VGEO_BRICK_SETTINGS);
31
+
32
+ resources.createGroup()
33
+ .addUniform("params", VGEO_CUT_PARAMS_STRUCT)
34
+ .addStorageBuffer("vg_lookup", WebGPUArray.from(u32))
35
+ .addStorageBuffer("vg_arena", WebGPUArray.from(u32))
36
+ // the frame's feedback, where the provider's cut's slot takes the wants, and the frame's want stamps
37
+ .addStorageBuffer("feedback", WebGPUArray.from(atomic_u32), true)
38
+ .addStorageBuffer("vg_want_stamps", WebGPUArray.from(atomic_u32), true);
39
+
40
+ resources.createGroup()
41
+ // the cells the last frame left waiting, and the list this frame's leaves
42
+ .addStorageBuffer("vgeo_brick_waiting_in", COLLECTION_U32_STRUCT_READ)
43
+ .addStorageBuffer("vgeo_brick_waiting", COLLECTION_U32_STRUCT_WRITE, true);
44
+
45
+ resources.createGroup()
46
+ .add(BRICK_STATE_RESOURCE)
47
+ .add(BRICK_RING_RESOURCE)
48
+ .add(BRICK_PENDING_RESOURCE);
49
+
50
+ const body = CodeChunk.from(
51
+ //language=WGSL
52
+ `
53
+ const VG_PAGE_ROW_NONE = ${VGEO_PAGE_ROW_NONE}u;
54
+ const VGEO_BRICK_WAIT_WORDS = ${VGEO_BRICK_WAIT_WORDS}u;
55
+
56
+ @compute @workgroup_size(${VGEO_BRICK_WAIT_WORKGROUP_SIZE})
57
+ fn main(
58
+ @builtin(workgroup_id) workgroup_id: vec3<u32>,
59
+ @builtin(local_invocation_index) lane: u32,
60
+ ) {
61
+ let i = folded_workgroup_index(workgroup_id) * ${VGEO_BRICK_WAIT_WORKGROUP_SIZE}u + lane;
62
+
63
+ // the list's count runs past what it holds
64
+ if (i >= min(vgeo_brick_waiting_in.count, settings.wait_capacity)) {
65
+ return;
66
+ }
67
+
68
+ let at = VGEO_BRICK_WAIT_WORDS * i;
69
+ let key = vgeo_brick_waiting_in.elements[at + ${VGEO_BRICK_WAIT_OFFSET.KEY}u];
70
+ let lookup = vgeo_brick_waiting_in.elements[at + ${VGEO_BRICK_WAIT_OFFSET.LOOKUP}u];
71
+ let page = vgeo_brick_waiting_in.elements[at + ${VGEO_BRICK_WAIT_OFFSET.PAGE}u];
72
+ let group = vgeo_brick_waiting_in.elements[at + ${VGEO_BRICK_WAIT_OFFSET.GROUP}u];
73
+
74
+ let row = vg_lookup[lookup + page];
75
+
76
+ // the page is resident and the group drawable: the cell is built again, whatever its storage cell holds then
77
+ if (row != VG_PAGE_ROW_NONE && vg_group_selectable(row, group)) {
78
+ brick_clipmap_enqueue(key, settings.ring_capacity);
79
+ return;
80
+ }
81
+
82
+ if (row == VG_PAGE_ROW_NONE) {
83
+ let source = vgeo_brick_waiting_in.elements[at + ${VGEO_BRICK_WAIT_OFFSET.SOURCE}u];
84
+
85
+ // the page it was found through has gone too: the cell is built again, and its cut finds the way down anew
86
+ if (vg_lookup[lookup + vgeo_brick_waiting_in.elements[at + ${VGEO_BRICK_WAIT_OFFSET.SOURCE_PAGE}u]] != source) {
87
+ brick_clipmap_enqueue(key, settings.ring_capacity);
88
+ return;
89
+ }
90
+
91
+ // a want lasts the reading it is in: the page is wanted again each frame the cell waits on it, as the camera
92
+ // cut wants its pages again each frame it draws a stand-in
93
+ vg_want(
94
+ source,
95
+ vgeo_brick_waiting_in.elements[at + ${VGEO_BRICK_WAIT_OFFSET.REF}u],
96
+ page,
97
+ lookup,
98
+ bitcast<f32>(vgeo_brick_waiting_in.elements[at + ${VGEO_BRICK_WAIT_OFFSET.ERROR}u])
99
+ );
100
+ }
101
+
102
+ // within the capacity: the list kept onto was cleared, and holds no more than the one it keeps from
103
+ let kept = atomicAdd(&vgeo_brick_waiting.count, 1u);
104
+
105
+ for (var w = 0u; w < VGEO_BRICK_WAIT_WORDS; w++) {
106
+ vgeo_brick_waiting.elements[VGEO_BRICK_WAIT_WORDS * kept + w] = vgeo_brick_waiting_in.elements[at + w];
107
+ }
108
+ }
109
+ `, [
110
+ chunk_brick_clipmap,
111
+ chunk_brick_clipmap_enqueue,
112
+ chunk_folded_workgroup_index,
113
+ chunk_vgeo_cut_arena,
114
+ chunk_vgeo_cut_want,
115
+ ]);
116
+
117
+ /**
118
+ * The vgeo provider's wait (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §7.6 contract 6, §7.8): a thread a cell the last
119
+ * frame left waiting, built while a cluster of its cut stood in for a page not resident or a group not selectable.
120
+ * A cell whose page is resident and whose group is selectable now is queued again with `brick_clipmap_enqueue`, so
121
+ * exactly the cells that stood something in are built again, once what they waited on is there. The rest wait on,
122
+ * onto the list this frame's distance pass adds its own to (and counts those past its capacity).
123
+ *
124
+ * A want lasts the reading it is in (`VGeoResidency.apply` drops what its budgets defer), so a cell waiting on a page
125
+ * not resident wants it again, each frame, through the provider's cut's slot (`vg_want`): through the page its
126
+ * stand-in was found in, while that row still holds that page. Once it holds another, the cell is queued again
127
+ * instead, and its cut finds the way down anew. A group held back carries no want, as in the cut.
128
+ *
129
+ * @type {ComputeShader}
130
+ */
131
+ export const shader_vgeo_brick_wait = ComputeShader.from({
132
+ label: "Brick Clipmap VGeo Wait",
133
+ resources,
134
+ body,
135
+ });
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * What shading samples (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8): {@link cascade_count} cascades of
3
3
  * {@link resolution}³ lattice points around the view, {@link spacing} metres apart in the finest
4
- * cascade and twice as far apart in each one around it. A point holds a probe only while something on
5
- * screen wants it, so probes are a sparse cache over the lattice.
4
+ * cascade and twice as far apart in each one around it. A point holds a probe only while a pixel wants
5
+ * it, or a hit of a probe a pixel wants, so probes are a sparse cache over the lattice.
6
6
  *
7
7
  * **Storage** (§8.2):
8
8
  * - {@link indirection}, `r32uint`, a texel a lattice point in storage that wraps, the cascades
@@ -18,9 +18,10 @@
18
18
  *
19
19
  * **A frame's lifetime** ({@link graph_update}, §8.3, §8.5): the windows are placed around the anchor,
20
20
  * coarsest first, each a parent cell inside its parent. Retire frees the probes whose points left
21
- * their windows or that nobody wanted for `retention_time`, want marks the cages one pixel of each
22
- * screen tile reads, admit gives each wanted point without a probe a NEW one, schedule sets the period
23
- * T from the wanted count, and the due passes list the frame's updates, NEW probes first.
21
+ * their windows or that nothing wanted for `retention_time`, want marks the cages one pixel of each
22
+ * screen tile reads, the hits' wants the cages the last frame's hits read their bounce from, admit
23
+ * gives each wanted point without a probe a NEW one, schedule sets the period T from the wanted count,
24
+ * and the due passes list the frame's updates, NEW probes first.
24
25
  *
25
26
  * **The frame's update** (§8.4, §8.6), once the brick clipmap is built: relocate, then trace, a ray a
26
27
  * thread, R a probe, each with its hit and the suns' soft shadows there.
@@ -79,6 +80,16 @@ export class GPUProbeClipmap {
79
80
  * @readonly
80
81
  */
81
82
  readonly depth_resolution: number;
83
+ /**
84
+ * Put what the probes' readers bind into `bindings`, under the names `chunk_probe_clipmap_pick` reads
85
+ * them by: the levels and the sampling uniforms, the indirection, the states and records, the depth
86
+ * atlas. As the last {@link graph_update} left them; take them each frame, since a growth replaces
87
+ * the per-slot buffers.
88
+ *
89
+ * @param {Object} bindings
90
+ * @returns {Object} bindings
91
+ */
92
+ write_sampling_bindings(bindings: any): any;
82
93
  /**
83
94
  * @returns {GPUTexture}
84
95
  */
@@ -140,8 +151,10 @@ export class GPUProbeClipmap {
140
151
  * @param {import("../../../material/resident/GPUResidentMaterialContext.js").GPUResidentMaterialContext} options.materials
141
152
  * the resident materials, updated this frame: what a hit no card sees takes
142
153
  * @param {GPUBuffer} options.card_rows the row → card set table, a word a `meshes` row
154
+ * @param {number} options.shadowmap_atlas graph handle of the frame's shadow map atlas, which the hits'
155
+ * local lights are shadowed by
143
156
  */
144
- graph_update({ graph, x, y, z, depth, normal, camera, stbn, resolution, time, retention_time, response_time, ray_budget, rays_per_probe, brick_clipmap, bricks, scene, materials, card_rows }: {
157
+ graph_update({ graph, x, y, z, depth, normal, camera, stbn, resolution, time, retention_time, response_time, ray_budget, rays_per_probe, brick_clipmap, bricks, scene, materials, card_rows, shadowmap_atlas }: {
145
158
  graph: FrameGraph;
146
159
  x: number;
147
160
  y: number;
@@ -161,6 +174,7 @@ export class GPUProbeClipmap {
161
174
  scene: import("../../../scene/GPUSceneContext.js").GPUSceneContext;
162
175
  materials: import("../../../material/resident/GPUResidentMaterialContext.js").GPUResidentMaterialContext;
163
176
  card_rows: GPUBuffer;
177
+ shadowmap_atlas: number;
164
178
  }): void;
165
179
  destroy(): void;
166
180
  #private;
@@ -1 +1 @@
1
- {"version":3,"file":"GPUProbeClipmap.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js"],"names":[],"mappings":"AAgFA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH;IA4KI;;;;;;;;OAQG;IACH;QAN2B,aAAa,EAA7B,MAAM;QACU,UAAU,EAA1B,MAAM;QACU,OAAO,EAAvB,MAAM;QACU,mBAAmB,EAAnC,MAAM;QACU,gBAAgB,EAAhC,MAAM;OAyFhB;IA3QD;;;OAGG;IACH,wBAHU,MAAM,CAGF;IAEd;;;;OAIG;IACH,qBAHU,MAAM,CAGL;IAEX;;;;OAIG;IACH,kBAHU,MAAM,CAGR;IAER;;;;OAIG;IACH,8BAHU,MAAM,CAGI;IAEpB;;;;OAIG;IACH,2BAHU,MAAM,CAGC;IA6OjB;;OAEG;IACH,8BAEC;IAED;;;;;OAKG;IACH,wBAEC;IAED;;;OAGG;IACH,uBAEC;IAED;;;;OAIG;IACH,gBAJW,MAAM,QACN,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,mBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,oBAHW,oBAAoB,GAClB,OAAO,CAQnB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH;QAxB+B,KAAK,EAAzB,UAAU;QACM,CAAC,EAAjB,MAAM;QACU,CAAC,EAAjB,MAAM;QACU,CAAC,EAAjB,MAAM;QACU,KAAK,EAArB,MAAM;QACU,MAAM,EAAtB,MAAM;QACa,MAAM;QACd,IAAI;QACY,UAAU,EAArC,UAAU,MAAM,CAAC;QACD,IAAI,EAApB,MAAM;QACU,cAAc,EAA9B,MAAM;QACU,aAAa,EAA7B,MAAM;QACU,UAAU,EAA1B,MAAM;QACU,cAAc,EAA9B,MAAM;QACyD,aAAa,EAA5E,OAAO,6BAA6B,EAAE,eAAe;QAErC,MAAM,EAAtB,MAAM;QAE+D,KAAK,EAA1E,OAAO,mCAAmC,EAAE,eAAe;QAE4C,SAAS,EAAhH,OAAO,0DAA0D,EAAE,0BAA0B;QAE1E,SAAS;aA8JtC;IAqVD,gBAcC;;CACJ;mCAl6BY,OAAO,4BAA4B,EAAE,oBAAoB;yBACzD,OAAO,iEAAiE,EAAE,UAAU"}
1
+ {"version":3,"file":"GPUProbeClipmap.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js"],"names":[],"mappings":"AA0FA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH;IA4LI;;;;;;;;OAQG;IACH;QAN2B,aAAa,EAA7B,MAAM;QACU,UAAU,EAA1B,MAAM;QACU,OAAO,EAAvB,MAAM;QACU,mBAAmB,EAAnC,MAAM;QACU,gBAAgB,EAAhC,MAAM;OA+FhB;IAjSD;;;OAGG;IACH,wBAHU,MAAM,CAGF;IAEd;;;;OAIG;IACH,qBAHU,MAAM,CAGL;IAEX;;;;OAIG;IACH,kBAHU,MAAM,CAGR;IAER;;;;OAIG;IACH,8BAHU,MAAM,CAGI;IAEpB;;;;OAIG;IACH,2BAHU,MAAM,CAGC;IAmQjB;;;;;;;;OAQG;IACH,4CAUC;IAED;;OAEG;IACH,8BAEC;IAED;;;;;OAKG;IACH,wBAEC;IAED;;;OAGG;IACH,uBAEC;IAED;;;;OAIG;IACH,gBAJW,MAAM,QACN,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,mBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,oBAHW,oBAAoB,GAClB,OAAO,CAQnB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH;QA1B+B,KAAK,EAAzB,UAAU;QACM,CAAC,EAAjB,MAAM;QACU,CAAC,EAAjB,MAAM;QACU,CAAC,EAAjB,MAAM;QACU,KAAK,EAArB,MAAM;QACU,MAAM,EAAtB,MAAM;QACa,MAAM;QACd,IAAI;QACY,UAAU,EAArC,UAAU,MAAM,CAAC;QACD,IAAI,EAApB,MAAM;QACU,cAAc,EAA9B,MAAM;QACU,aAAa,EAA7B,MAAM;QACU,UAAU,EAA1B,MAAM;QACU,cAAc,EAA9B,MAAM;QACyD,aAAa,EAA5E,OAAO,6BAA6B,EAAE,eAAe;QAErC,MAAM,EAAtB,MAAM;QAE+D,KAAK,EAA1E,OAAO,mCAAmC,EAAE,eAAe;QAE4C,SAAS,EAAhH,OAAO,0DAA0D,EAAE,0BAA0B;QAE1E,SAAS;QACZ,eAAe,EAA/B,MAAM;aAuNhB;IAmXD,gBAcC;;CACJ;mCA5iCY,OAAO,4BAA4B,EAAE,oBAAoB;yBACzD,OAAO,iEAAiE,EAAE,UAAU"}
@@ -2,6 +2,7 @@ import { assert } from "../../../../../core/assert.js";
2
2
  import { ClipmapCascadePlacement } from "../../../../../core/geom/clipmap/ClipmapCascadePlacement.js";
3
3
  import { BufferDescriptor } from "../../../../descriptor/buffer/BufferDescriptor.js";
4
4
  import { graph_read_buffer } from "../../../buffer/graph_read_buffer.js";
5
+ import { graph_build_world_light_clusters } from "../../../light/world_cluster/graph_build_world_light_clusters.js";
5
6
  import { WEBGPU_GUARANTEED_MAX_COMPUTE_WORKGROUPS_PER_DIMENSION } from "../../../gpu_primitive/indirect/WEBGPU_GUARANTEED_MAX_COMPUTE_WORKGROUPS_PER_DIMENSION.js";
6
7
  import { shader_slot_stack_fill, SLOT_STACK_FILL_WORKGROUP_SIZE } from "../../../gpu_primitive/slot_stack/shader_slot_stack_fill.js";
7
8
  import {
@@ -18,6 +19,7 @@ import {
18
19
  PROBE_CLIPMAP_OCTAHEDRAL_RESOLUTION_MIN
19
20
  } from "../ProbeClipmapSettings.js";
20
21
  import { PROBE_PROJECTION_ROW_STRUCT, PROBE_RAY_STRUCT, PROBE_RECORD_STRUCT } from "./chunk_probe_clipmap.js";
22
+ import { PROBE_SAMPLING_STRUCT } from "./chunk_probe_clipmap_pick.js";
21
23
  import {
22
24
  PROBE_COUNTER_FREE,
23
25
  PROBE_COUNTER_STARVED,
@@ -43,10 +45,12 @@ import { shader_probe_clipmap_publish } from "./shader_probe_clipmap_publish.js"
43
45
  import { shader_probe_clipmap_relocate } from "./shader_probe_clipmap_relocate.js";
44
46
  import { shader_probe_clipmap_retire } from "./shader_probe_clipmap_retire.js";
45
47
  import { shader_probe_clipmap_schedule } from "./shader_probe_clipmap_schedule.js";
48
+ import { shader_probe_clipmap_light } from "./shader_probe_clipmap_light.js";
46
49
  import { shader_probe_clipmap_shade } from "./shader_probe_clipmap_shade.js";
47
50
  import { shader_probe_clipmap_trace } from "./shader_probe_clipmap_trace.js";
48
51
  import { shader_probe_clipmap_trace_command } from "./shader_probe_clipmap_trace_command.js";
49
52
  import { shader_probe_clipmap_want } from "./shader_probe_clipmap_want.js";
53
+ import { shader_probe_clipmap_want_hits } from "./shader_probe_clipmap_want_hits.js";
50
54
 
51
55
  /**
52
56
  * @typedef {import("../ProbeClipmapSettings.js").ProbeClipmapSettings} ProbeClipmapSettings
@@ -78,11 +82,17 @@ const PROBE_CASCADE_NEST_MARGIN = 1;
78
82
  */
79
83
  const LIST_HEADER_BYTES = 16;
80
84
 
85
+ // word offsets of the radiance atlas's shape in PROBE_SAMPLING_STRUCT
86
+ const SAMPLING_RADIANCE_RESOLUTION = PROBE_SAMPLING_STRUCT.get("radiance_resolution").offset >>> 2;
87
+ const SAMPLING_RADIANCE_TILES_PER_ROW = PROBE_SAMPLING_STRUCT.get("radiance_tiles_per_row").offset >>> 2;
88
+ const SAMPLING_RADIANCE_TEXEL = PROBE_SAMPLING_STRUCT.get("radiance_texel").offset >>> 2;
89
+ const SAMPLING_RADIANCE_TILES_PER_ROW_RECIPROCAL = PROBE_SAMPLING_STRUCT.get("radiance_tiles_per_row_reciprocal").offset >>> 2;
90
+
81
91
  /**
82
92
  * What shading samples (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8): {@link cascade_count} cascades of
83
93
  * {@link resolution}³ lattice points around the view, {@link spacing} metres apart in the finest
84
- * cascade and twice as far apart in each one around it. A point holds a probe only while something on
85
- * screen wants it, so probes are a sparse cache over the lattice.
94
+ * cascade and twice as far apart in each one around it. A point holds a probe only while a pixel wants
95
+ * it, or a hit of a probe a pixel wants, so probes are a sparse cache over the lattice.
86
96
  *
87
97
  * **Storage** (§8.2):
88
98
  * - {@link indirection}, `r32uint`, a texel a lattice point in storage that wraps, the cascades
@@ -98,9 +108,10 @@ const LIST_HEADER_BYTES = 16;
98
108
  *
99
109
  * **A frame's lifetime** ({@link graph_update}, §8.3, §8.5): the windows are placed around the anchor,
100
110
  * coarsest first, each a parent cell inside its parent. Retire frees the probes whose points left
101
- * their windows or that nobody wanted for `retention_time`, want marks the cages one pixel of each
102
- * screen tile reads, admit gives each wanted point without a probe a NEW one, schedule sets the period
103
- * T from the wanted count, and the due passes list the frame's updates, NEW probes first.
111
+ * their windows or that nothing wanted for `retention_time`, want marks the cages one pixel of each
112
+ * screen tile reads, the hits' wants the cages the last frame's hits read their bounce from, admit
113
+ * gives each wanted point without a probe a NEW one, schedule sets the period T from the wanted count,
114
+ * and the due passes list the frame's updates, NEW probes first.
104
115
  *
105
116
  * **The frame's update** (§8.4, §8.6), once the brick clipmap is built: relocate, then trace, a ray a
106
117
  * thread, R a probe, each with its hit and the suns' soft shadows there.
@@ -210,6 +221,10 @@ export class GPUProbeClipmap {
210
221
  /** Rays the rays buffer holds: U·R as it last grew. */
211
222
  #ray_capacity = 0;
212
223
 
224
+ /** U and R of the rays the last frame traced, which the hits' wants read. */
225
+ #rays_trace_capacity = 0;
226
+ #rays_per_probe = 0;
227
+
213
228
  /** @type {GPUTileAtlas2D} */
214
229
  #radiance;
215
230
 
@@ -238,12 +253,20 @@ export class GPUProbeClipmap {
238
253
 
239
254
  #destroyed = false;
240
255
 
256
+ /** The probes' shape for their readers, `PROBE_SAMPLING_STRUCT`. @type {GPUBuffer} */
257
+ #sampling;
258
+
259
+ #sampling_data = new ArrayBuffer(PROBE_SAMPLING_STRUCT.size);
260
+ #sampling_u32 = new Uint32Array(this.#sampling_data);
261
+ #sampling_f32 = new Float32Array(this.#sampling_data);
262
+
241
263
  #levels_data = new ArrayBuffer(CLIPMAP_LEVEL_ARRAY.size);
242
264
  #levels_i32 = new Int32Array(this.#levels_data);
243
265
  #levels_f32 = new Float32Array(this.#levels_data);
244
266
 
245
267
  #retire_settings = { capacity: 0, resolution: 0, time: 0, retention_time: 0 };
246
268
  #want_settings = { cascade_count: 0, resolution: 0, frame: 0, key_count: 0 };
269
+ #want_hits_settings = { cascade_count: 0, resolution: 0, key_count: 0, trace_capacity: 0, rays_per_probe: 0 };
247
270
  #admit_command_settings = { key_count: 0 };
248
271
  #admit_settings = { capacity: 0, resolution: 0, key_count: 0, time: 0 };
249
272
  #schedule_settings = { capacity: 0, key_count: 0, trace_capacity: 0 };
@@ -261,7 +284,11 @@ export class GPUProbeClipmap {
261
284
 
262
285
  #lifetime_data = { counters: -1, depth: -1, normal: -1, stbn: -1 };
263
286
 
264
- #update_data = { counters: -1, bricks: -1 };
287
+ #update_data = { counters: -1, bricks: -1, world_cluster_lookup: -1, world_cluster_data: -1, shadowmap_atlas: -1 };
288
+
289
+ /** The coarsest brick window's box, metres, which the world light clusters cull lights against. */
290
+ #clusters_min = [0, 0, 0];
291
+ #clusters_max = [0, 0, 0];
265
292
 
266
293
  /** The frame's brick clipmap, which the update's rays read. @type {import("../brick/GPUBrickClipmap.js").GPUBrickClipmap|null} */
267
294
  #brick_clipmap = null;
@@ -381,6 +408,33 @@ export class GPUProbeClipmap {
381
408
  size: CLIPMAP_LEVEL_ARRAY.size,
382
409
  usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,
383
410
  }));
411
+
412
+ this.#sampling = device.createBuffer(BufferDescriptor.fromJSON({
413
+ label: 'Probe clipmap / probe sampling',
414
+ size: PROBE_SAMPLING_STRUCT.size,
415
+ usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,
416
+ }));
417
+ }
418
+
419
+ /**
420
+ * Put what the probes' readers bind into `bindings`, under the names `chunk_probe_clipmap_pick` reads
421
+ * them by: the levels and the sampling uniforms, the indirection, the states and records, the depth
422
+ * atlas. As the last {@link graph_update} left them; take them each frame, since a growth replaces
423
+ * the per-slot buffers.
424
+ *
425
+ * @param {Object} bindings
426
+ * @returns {Object} bindings
427
+ */
428
+ write_sampling_bindings(bindings) {
429
+ bindings.probe_levels = this.#levels;
430
+ bindings.probe_sampling = this.#sampling;
431
+ bindings.probe_indirection = this.#indirection_view;
432
+ bindings.probe_states = this.#states;
433
+ bindings.probe_records = this.#records;
434
+ bindings.probe_depth = this.#depth.texture_at(0).obtainView();
435
+ bindings.probe_radiance = this.#radiance.texture_at(0).obtainView();
436
+
437
+ return bindings;
384
438
  }
385
439
 
386
440
  /**
@@ -466,8 +520,10 @@ export class GPUProbeClipmap {
466
520
  * @param {import("../../../material/resident/GPUResidentMaterialContext.js").GPUResidentMaterialContext} options.materials
467
521
  * the resident materials, updated this frame: what a hit no card sees takes
468
522
  * @param {GPUBuffer} options.card_rows the row → card set table, a word a `meshes` row
523
+ * @param {number} options.shadowmap_atlas graph handle of the frame's shadow map atlas, which the hits'
524
+ * local lights are shadowed by
469
525
  */
470
- graph_update({ graph, x, y, z, depth, normal, camera, stbn, resolution, time, retention_time, response_time, ray_budget, rays_per_probe, brick_clipmap, bricks, scene, materials, card_rows }) {
526
+ graph_update({ graph, x, y, z, depth, normal, camera, stbn, resolution, time, retention_time, response_time, ray_budget, rays_per_probe, brick_clipmap, bricks, scene, materials, card_rows, shadowmap_atlas }) {
471
527
  assert.defined(graph, 'graph');
472
528
  assert.defined(camera, 'camera');
473
529
  assert.defined(stbn, 'stbn');
@@ -483,6 +539,7 @@ export class GPUProbeClipmap {
483
539
  assert.defined(scene, 'scene');
484
540
  assert.defined(materials, 'materials');
485
541
  assert.defined(card_rows, 'card_rows');
542
+ assert.isNonNegativeInteger(shadowmap_atlas, 'shadowmap_atlas');
486
543
  assert.notOk(this.#destroyed, 'destroyed');
487
544
 
488
545
  if (this.#grow_pending) {
@@ -503,6 +560,26 @@ export class GPUProbeClipmap {
503
560
 
504
561
  this.#device.queue.writeBuffer(this.#levels, 0, this.#levels_data);
505
562
 
563
+ // the readers' view of the clipmap: its shape, and the depth and radiance atlases', which grow by rows
564
+ const depth_texture = this.#depth.texture_at(0);
565
+ const radiance_texture = this.#radiance.texture_at(0);
566
+
567
+ this.#sampling_u32[0] = this.cascade_count;
568
+ this.#sampling_u32[1] = this.resolution;
569
+ this.#sampling_u32[2] = this.depth_resolution;
570
+ this.#sampling_u32[3] = this.#depth.tiles_per_row;
571
+ this.#sampling_f32[4] = 1 / depth_texture.width;
572
+ this.#sampling_f32[5] = 1 / depth_texture.height;
573
+ // rounded to f32 as it is stored, which index_to_grid2d_reciprocal asks for
574
+ this.#sampling_f32[6] = 1 / this.#depth.tiles_per_row;
575
+ this.#sampling_u32[SAMPLING_RADIANCE_RESOLUTION] = this.radiance_resolution;
576
+ this.#sampling_u32[SAMPLING_RADIANCE_TILES_PER_ROW] = this.#radiance.tiles_per_row;
577
+ this.#sampling_f32[SAMPLING_RADIANCE_TEXEL] = 1 / radiance_texture.width;
578
+ this.#sampling_f32[SAMPLING_RADIANCE_TEXEL + 1] = 1 / radiance_texture.height;
579
+ this.#sampling_f32[SAMPLING_RADIANCE_TILES_PER_ROW_RECIPROCAL] = 1 / this.#radiance.tiles_per_row;
580
+
581
+ this.#device.queue.writeBuffer(this.#sampling, 0, this.#sampling_data);
582
+
506
583
  const clock = time - this.#time_origin;
507
584
 
508
585
  this.#retire_settings.capacity = this.#capacity;
@@ -515,6 +592,18 @@ export class GPUProbeClipmap {
515
592
  this.#want_settings.frame = this.#frame;
516
593
  this.#want_settings.key_count = this.#key_count;
517
594
 
595
+ // the hits' wants read the last frame's rays, as that frame laid them out
596
+ const want_hits = this.#want_hits_settings;
597
+
598
+ want_hits.cascade_count = this.cascade_count;
599
+ want_hits.resolution = this.resolution;
600
+ want_hits.key_count = this.#key_count;
601
+ want_hits.trace_capacity = this.#rays_trace_capacity;
602
+ want_hits.rays_per_probe = this.#rays_per_probe;
603
+
604
+ this.#rays_trace_capacity = trace_capacity;
605
+ this.#rays_per_probe = rays_per_probe;
606
+
518
607
  this.#admit_command_settings.key_count = this.#key_count;
519
608
 
520
609
  this.#admit_settings.capacity = this.#capacity;
@@ -598,12 +687,35 @@ export class GPUProbeClipmap {
598
687
 
599
688
  pass.make_side_effect();
600
689
 
690
+ // the local lights the rays' hits take, clustered over the bricks' cascades, where every hit is (§8.7)
691
+ const coarsest_cell = brick_clipmap.cell_size(coarsest);
692
+
693
+ for (let axis = 0; axis < 3; axis++) {
694
+ const corner = brick_clipmap.corner(coarsest, axis);
695
+
696
+ this.#clusters_min[axis] = corner * coarsest_cell;
697
+ this.#clusters_max[axis] = (corner + brick_clipmap.resolution) * coarsest_cell;
698
+ }
699
+
700
+ const clusters = graph_build_world_light_clusters({
701
+ graph,
702
+ lights: scene.lights,
703
+ levels: graph_import_buffer(graph, brick_clipmap.levels, "probe_brick_levels"),
704
+ cascade_count: brick_clipmap.cascade_count,
705
+ border: 0,
706
+ coarsest_min: this.#clusters_min,
707
+ coarsest_max: this.#clusters_max,
708
+ });
709
+
601
710
  // the frame's updates, once its bricks are built
602
711
  const update_data = this.#update_data;
603
712
  const update = graph.add("Probe Clipmap Update", update_data, this.#execute_update);
604
713
 
605
714
  update_data.counters = update.write(data.counters);
606
715
  update_data.bricks = update.read(bricks);
716
+ update_data.world_cluster_lookup = update.read(clusters.lookup);
717
+ update_data.world_cluster_data = update.read(clusters.data);
718
+ update_data.shadowmap_atlas = update.read(shadowmap_atlas);
607
719
 
608
720
  update.make_side_effect();
609
721
 
@@ -753,10 +865,10 @@ export class GPUProbeClipmap {
753
865
 
754
866
  this.#parity = 1 - this.#parity;
755
867
 
756
- // the frame's lists start empty, and no point is wanted yet
868
+ // the frame's lists start empty, and no point is wanted yet; the trace list holds the last frame's
869
+ // updates until the hits' wants have read their rays
757
870
  encoder.clearBuffer(active_write, 0, 4);
758
871
  encoder.clearBuffer(this.#wanted, 0, 4);
759
- encoder.clearBuffer(this.#trace, 0, 4);
760
872
  encoder.clearBuffer(this.#wanted_bits);
761
873
 
762
874
  b.probe_levels = this.#levels;
@@ -794,6 +906,21 @@ export class GPUProbeClipmap {
794
906
  bindings: b,
795
907
  });
796
908
 
909
+ // the last frame's hits want the probes their bounce reads, through the launch their rays had,
910
+ // before the frame's trace command writes it over
911
+ b.probe_origins = this.#origins;
912
+ b.probe_rays = this.#rays;
913
+ b.settings = this.#want_hits_settings;
914
+
915
+ shader_probe_clipmap_want_hits.dispatchIndirect({
916
+ encoder,
917
+ bindings: b,
918
+ command: this.#dispatch,
919
+ command_offset: 4 * PROBE_DISPATCH_RAYS,
920
+ });
921
+
922
+ encoder.clearBuffer(this.#trace, 0, 4);
923
+
797
924
  b.settings = this.#admit_command_settings;
798
925
 
799
926
  shader_probe_clipmap_admit_command.dispatch({ encoder, bindings: b });
@@ -886,6 +1013,21 @@ export class GPUProbeClipmap {
886
1013
  command_offset: 4 * PROBE_DISPATCH_RAYS,
887
1014
  });
888
1015
 
1016
+ // the light each hit takes from beyond the trace: its cell's local lights, and the next bounce from
1017
+ // last frame's probes
1018
+ this.write_sampling_bindings(b);
1019
+ b.world_cluster_lookup = resources.get(data.world_cluster_lookup);
1020
+ b.world_cluster_data = resources.get(data.world_cluster_data);
1021
+ b.shadowmapAtlas = resources.get(data.shadowmap_atlas).obtainView();
1022
+ b.settings = this.#trace_settings;
1023
+
1024
+ shader_probe_clipmap_light.dispatchIndirect({
1025
+ encoder,
1026
+ bindings: b,
1027
+ command: this.#dispatch,
1028
+ command_offset: 4 * PROBE_DISPATCH_RAYS,
1029
+ });
1030
+
889
1031
  // the probes' maps from their rays, against the atlases as they were; their SH and kind from the
890
1032
  // maps; then the atlases from the maps
891
1033
  b.probe_maps = this.#maps;
@@ -975,7 +1117,7 @@ export class GPUProbeClipmap {
975
1117
  this.#radiance.destroy();
976
1118
  this.#depth.destroy();
977
1119
 
978
- for (const buffer of [this.#levels, this.#states, this.#records, this.#free, this.#counters, this.#dispatch, ...this.#active, this.#wanted, this.#wanted_bits, this.#trace, this.#origins, this.#maps, this.#projection, this.#rays]) {
1120
+ for (const buffer of [this.#levels, this.#states, this.#records, this.#free, this.#counters, this.#dispatch, ...this.#active, this.#wanted, this.#wanted_bits, this.#trace, this.#origins, this.#maps, this.#projection, this.#rays, this.#sampling]) {
979
1121
  buffer?.destroy();
980
1122
  }
981
1123
  }
@@ -191,6 +191,13 @@ export const PROBE_WANT_TILE: number;
191
191
  * @type {number}
192
192
  */
193
193
  export const PROBE_WANT_WORKGROUP_TILES: number;
194
+ /**
195
+ * A wanted list entry's top bit: a pixel wanted the point, not only hits (§8.3). Admit marks the point's
196
+ * probe as the screen's on it, and only the screen's probes' hits want in turn. The key is the other
197
+ * bits.
198
+ * @type {number}
199
+ */
200
+ export const PROBE_WANTED_SCREEN: number;
194
201
  /**
195
202
  * Lanes of the fill, a texel of the indirection each.
196
203
  * @type {number}
@@ -1 +1 @@
1
- {"version":3,"file":"PROBE_CLIPMAP.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.js"],"names":[],"mappings":"AAiNA;;;;;;;;GAQG;AACH,8DAJW,MAAM,oBACN,MAAM,GACJ,MAAM,CAIlB;AAjND;;;GAGG;AACH,iCAFU,MAAM,CAE6B;AAS7C;;;GAGG;AACH,+BAFU,MAAM,CAEkB;AAElC;;;GAGG;AACH,8BAFU,MAAM,CAEiB;AAEjC;;;GAGG;AACH,gCAFU,MAAM,CAEmB;AAEnC;;;;GAIG;AACH,+BAFU,MAAM,CAEkB;AAElC;;;GAGG;AACH,oCAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH,wCAFU,MAAM,CAE2B;AAM3C;;;GAGG;AACH,iCAFU,MAAM,CAEoB;AAEpC;;;;GAIG;AACH,oCAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH,mCAFU,MAAM,CAEsB;AAEtC;;;GAGG;AACH,kCAFU,MAAM,CAEqB;AAQrC;;;;GAIG;AACH,oCAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH,mCAFU,MAAM,CAEsB;AAEtC;;;GAGG;AACH,oCAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH,kCAFU,MAAM,CAEqB;AAErC;;;GAGG;AACH,oCAFU,MAAM,CAEwB;AAExC;;;GAGG;AACH,kCAFU,MAAM,CAEsB;AAEtC;;;GAGG;AACH,qCAFU,MAAM,CAEyB;AAEzC;;;GAGG;AACH,mCAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH,0CAFU,MAAM,CAE8B;AAE9C;;;GAGG;AACH,iCAFU,MAAM,CAEoB;AAEpC;;;;GAIG;AACH,yCAFU,MAAM,CAE+B;AAE/C;;;;GAIG;AACH,qCAFU,MAAM,CAE2B;AAE3C;;;GAGG;AACH,qCAFU,MAAM,CAEwB;AAExC;;;GAGG;AACH,gCAFU,MAAM,CAE8B;AAE9C;;;;GAIG;AACH,oCAFU,MAAM,CAEyB;AAEzC;;;;GAIG;AACH,2CAFU,MAAM,CAEgC;AAEhD;;;GAGG;AACH,yCAFU,MAAM,CAE+B;AAE/C;;;GAGG;AACH,qCAFU,MAAM,CAEyB;AAezC;;;;GAIG;AACH,kCAFU,MAAM,CAEqB;AAOrC;;;GAGG;AACH,kCAFU,MAAM,CAEqB;AAErC;;;GAGG;AACH,kCAFU,MAAM,CAEqB;AAErC;;;GAGG;AACH,sCAFU,MAAM,CAEyB;AAEzC;;;GAGG;AACH,8BAFU,MAAM,CAEiB;AAEjC;;;GAGG;AACH,yCAFU,MAAM,CAE4B;AAE5C;;;GAGG;AACH,wCAFU,MAAM,CAE4B;AAE5C;;;;GAIG;AACH,gCAFU,MAAM,CAEmB;AAEnC;;;GAGG;AACH,kCAFU,MAAM,CAEuB;AAEvC;;;;GAIG;AACH,uCAFU,MAAM,CAE4B"}
1
+ {"version":3,"file":"PROBE_CLIPMAP.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.js"],"names":[],"mappings":"AAiNA;;;;;;;;GAQG;AACH,8DAJW,MAAM,oBACN,MAAM,GACJ,MAAM,CAIlB;AAjND;;;GAGG;AACH,iCAFU,MAAM,CAE6B;AAS7C;;;GAGG;AACH,+BAFU,MAAM,CAEkB;AAElC;;;GAGG;AACH,8BAFU,MAAM,CAEiB;AAEjC;;;GAGG;AACH,gCAFU,MAAM,CAEmB;AAEnC;;;;GAIG;AACH,+BAFU,MAAM,CAEkB;AAElC;;;GAGG;AACH,oCAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH,wCAFU,MAAM,CAE2B;AAM3C;;;GAGG;AACH,iCAFU,MAAM,CAEoB;AAEpC;;;;GAIG;AACH,oCAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH,mCAFU,MAAM,CAEsB;AAEtC;;;GAGG;AACH,kCAFU,MAAM,CAEqB;AAQrC;;;;GAIG;AACH,oCAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH,mCAFU,MAAM,CAEsB;AAEtC;;;GAGG;AACH,oCAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH,kCAFU,MAAM,CAEqB;AAErC;;;GAGG;AACH,oCAFU,MAAM,CAEwB;AAExC;;;GAGG;AACH,kCAFU,MAAM,CAEsB;AAEtC;;;GAGG;AACH,qCAFU,MAAM,CAEyB;AAEzC;;;GAGG;AACH,mCAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH,0CAFU,MAAM,CAE8B;AAE9C;;;GAGG;AACH,iCAFU,MAAM,CAEoB;AAEpC;;;;GAIG;AACH,yCAFU,MAAM,CAE+B;AAE/C;;;;GAIG;AACH,qCAFU,MAAM,CAE2B;AAE3C;;;GAGG;AACH,qCAFU,MAAM,CAEwB;AAExC;;;GAGG;AACH,gCAFU,MAAM,CAE8B;AAE9C;;;;GAIG;AACH,oCAFU,MAAM,CAEyB;AAEzC;;;;GAIG;AACH,2CAFU,MAAM,CAEgC;AAEhD;;;GAGG;AACH,yCAFU,MAAM,CAE+B;AAE/C;;;GAGG;AACH,qCAFU,MAAM,CAEyB;AAezC;;;;GAIG;AACH,kCAFU,MAAM,CAEqB;AAOrC;;;GAGG;AACH,kCAFU,MAAM,CAEqB;AAErC;;;GAGG;AACH,kCAFU,MAAM,CAEqB;AAErC;;;GAGG;AACH,sCAFU,MAAM,CAEyB;AAEzC;;;GAGG;AACH,8BAFU,MAAM,CAEiB;AAEjC;;;GAGG;AACH,yCAFU,MAAM,CAE4B;AAE5C;;;;;GAKG;AACH,kCAFU,MAAM,CAE8B;AAE9C;;;GAGG;AACH,wCAFU,MAAM,CAE4B;AAE5C;;;;GAIG;AACH,gCAFU,MAAM,CAEmB;AAEnC;;;GAGG;AACH,kCAFU,MAAM,CAEuB;AAEvC;;;;GAIG;AACH,uCAFU,MAAM,CAE4B"}
@@ -262,6 +262,14 @@ export const PROBE_WANT_TILE = 8;
262
262
  */
263
263
  export const PROBE_WANT_WORKGROUP_TILES = 8;
264
264
 
265
+ /**
266
+ * A wanted list entry's top bit: a pixel wanted the point, not only hits (§8.3). Admit marks the point's
267
+ * probe as the screen's on it, and only the screen's probes' hits want in turn. The key is the other
268
+ * bits.
269
+ * @type {number}
270
+ */
271
+ export const PROBE_WANTED_SCREEN = 0x80000000;
272
+
265
273
  /**
266
274
  * Lanes of the fill, a texel of the indirection each.
267
275
  * @type {number}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * A probe's record (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.2), 64 bytes a slot: where it is, when it
3
- * was wanted and traced, its last update's back faces, and its irradiance. Where relocation moved it
4
- * is the state's second word, which readers weighing it load with the state.
3
+ * was wanted and traced, its last update's back faces, whose want it was, and its irradiance. Where
4
+ * relocation moved it is the state's second word, which readers weighing it load with the state.
5
5
  *
6
6
  * @type {WebGPUStruct}
7
7
  */
@@ -226,6 +226,18 @@ export const chunk_probe_clipmap: CodeChunk;
226
226
  * @type {CodeChunk}
227
227
  */
228
228
  export const chunk_probe_clipmap_ray_texel: CodeChunk;
229
+ /**
230
+ * The STBN jitter of a ray in its texel (§8.6): the noise moved by the slot's hash so that neighbouring
231
+ * probes do not jitter alike, and a fresh sample for each update and each round of a texel's rays. The
232
+ * trace aims its ray by it, and the light pass picks the probes at its hit with it (§8.7).
233
+ *
234
+ * ```wgsl
235
+ * fn probe_clipmap_ray_jitter(slot: u32, texel: u32, ray: u32, updates: u32, rays: u32, n: u32) -> vec2<f32> // ray: its index among the probe's R; n: n_r
236
+ * ```
237
+ *
238
+ * @type {CodeChunk}
239
+ */
240
+ export const chunk_probe_clipmap_ray_jitter: CodeChunk;
229
241
  import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
230
242
  import { ShaderResourceDescriptor } from "../../../shader/resource/ShaderResourceDescriptor.js";
231
243
  import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_probe_clipmap.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.js"],"names":[],"mappings":"AAoCA;;;;;;GAMG;AACH,kCAFU,YAAY,CAcJ;AAElB;;;;;GAKG;AACH,+BAFU,YAAY,CAqBP;AAEf;;;;;;GAMG;AACH,oCAFU,wBAAwB,CAEyE;AAE3G;;;;GAIG;AACH,+CAFU,wBAAwB,CAE0G;AAE5I;;;;GAIG;AACH,0CAFU,wBAAwB,CAE+F;AAEjI;;;GAGG;AACH,yCAFU,wBAAwB,CAEwF;AAE1H;;;GAGG;AACH,2CAFU,wBAAwB,CAE+G;AAEjJ;;;GAGG;AACH,0CAFU,wBAAwB,CAEwG;AAE1I;;;GAGG;AACH,sCAFU,wBAAwB,CAEkG;AAEpI;;;;GAIG;AACH,2CAFU,wBAAwB,CAEoF;AAEtH;;;GAGG;AACH,kCAFU,wBAAwB,CAE6E;AAE/G;;;GAGG;AACH,yCAFU,wBAAwB,CAEgG;AAElI;;;GAGG;AACH,0CAFU,wBAAwB,CAEyG;AAE3I;;;GAGG;AACH,4CAFU,wBAAwB,CAEoG;AAEtI;;;GAGG;AACH,yCAFU,wBAAwB,CAEwG;AAE1I;;;GAGG;AACH,8CAFU,wBAAwB,CAE0F;AAE5H;;;GAGG;AACH,yCAFU,wBAAwB,CAEiG;AAEnI;;;GAGG;AACH,wCAFU,wBAAwB,CAEyF;AAE3H;;;GAGG;AACH,0CAFU,wBAAwB,CAEmG;AAErI;;;GAGG;AACH,yCAFU,wBAAwB,CAE2F;AAE7H;;;GAGG;AACH,sCAFU,wBAAwB,CAEqF;AAEvH;;;;GAIG;AACH,2CAFU,wBAAwB,CAEiG;AAEnI;;;GAGG;AACH,0CAFU,wBAAwB,CAE0F;AAE5H;;;GAGG;AACH,wCAFU,wBAAwB,CAEsG;AAExI;;;GAGG;AACH,uCAFU,wBAAwB,CAE+F;AAEjI;;;;GAIG;AACH,wCAFU,wBAAwB,CAEmF;AAErH;;;GAGG;AACH,uCAFU,wBAAwB,CAE4E;AAE9G;;;GAGG;AACH,0CAFU,YAAY,CAQG;AAEzB;;;GAGG;AACH,8CAFU,wBAAwB,CAE6H;AAE/J;;;GAGG;AACH,6CAFU,wBAAwB,CAEsH;AAExJ;;;;GAIG;AACH,8CAFU,wBAAwB,CAE+E;AAEjH;;;;GAIG;AACH,2CAFU,wBAAwB,CAEyE;AAE3G;;;GAGG;AACH,4CAFU,wBAAwB,CAEwG;AAE1I;;;GAGG;AACH,yCAFU,wBAAwB,CAEgG;AAElI;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,kCAFU,SAAS,CAqFhB;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,4CAFU,SAAS,CA+BhB;6BAtb0B,sCAAsC;yCAH1B,sDAAsD;0BADrE,uCAAuC"}
1
+ {"version":3,"file":"chunk_probe_clipmap.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.js"],"names":[],"mappings":"AAwCA;;;;;;GAMG;AACH,kCAFU,YAAY,CAmBJ;AAElB;;;;;GAKG;AACH,+BAFU,YAAY,CAwBP;AAEf;;;;;;GAMG;AACH,oCAFU,wBAAwB,CAEyE;AAE3G;;;;GAIG;AACH,+CAFU,wBAAwB,CAE0G;AAE5I;;;;GAIG;AACH,0CAFU,wBAAwB,CAE+F;AAEjI;;;GAGG;AACH,yCAFU,wBAAwB,CAEwF;AAE1H;;;GAGG;AACH,2CAFU,wBAAwB,CAE+G;AAEjJ;;;GAGG;AACH,0CAFU,wBAAwB,CAEwG;AAE1I;;;GAGG;AACH,sCAFU,wBAAwB,CAEkG;AAEpI;;;;GAIG;AACH,2CAFU,wBAAwB,CAEoF;AAEtH;;;GAGG;AACH,kCAFU,wBAAwB,CAE6E;AAE/G;;;GAGG;AACH,yCAFU,wBAAwB,CAEgG;AAElI;;;GAGG;AACH,0CAFU,wBAAwB,CAEyG;AAE3I;;;GAGG;AACH,4CAFU,wBAAwB,CAEoG;AAEtI;;;GAGG;AACH,yCAFU,wBAAwB,CAEwG;AAE1I;;;GAGG;AACH,8CAFU,wBAAwB,CAE0F;AAE5H;;;GAGG;AACH,yCAFU,wBAAwB,CAEiG;AAEnI;;;GAGG;AACH,wCAFU,wBAAwB,CAEyF;AAE3H;;;GAGG;AACH,0CAFU,wBAAwB,CAEmG;AAErI;;;GAGG;AACH,yCAFU,wBAAwB,CAE2F;AAE7H;;;GAGG;AACH,sCAFU,wBAAwB,CAEqF;AAEvH;;;;GAIG;AACH,2CAFU,wBAAwB,CAEiG;AAEnI;;;GAGG;AACH,0CAFU,wBAAwB,CAE0F;AAE5H;;;GAGG;AACH,wCAFU,wBAAwB,CAEsG;AAExI;;;GAGG;AACH,uCAFU,wBAAwB,CAE+F;AAEjI;;;;GAIG;AACH,wCAFU,wBAAwB,CAEmF;AAErH;;;GAGG;AACH,uCAFU,wBAAwB,CAE4E;AAE9G;;;GAGG;AACH,0CAFU,YAAY,CAQG;AAEzB;;;GAGG;AACH,8CAFU,wBAAwB,CAE6H;AAE/J;;;GAGG;AACH,6CAFU,wBAAwB,CAEsH;AAExJ;;;;GAIG;AACH,8CAFU,wBAAwB,CAE+E;AAEjH;;;;GAIG;AACH,2CAFU,wBAAwB,CAEyE;AAE3G;;;GAGG;AACH,4CAFU,wBAAwB,CAEwG;AAE1I;;;GAGG;AACH,yCAFU,wBAAwB,CAEgG;AAElI;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,kCAFU,SAAS,CAuFhB;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,4CAFU,SAAS,CA+BhB;AAEH;;;;;;;;;;GAUG;AACH,6CAFU,SAAS,CAkBhB;6BA/d0B,sCAAsC;yCAH1B,sDAAsD;0BADrE,uCAAuC"}