@woosh/meep-engine 3.60.5 → 3.60.7

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 (376) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/build/bundle-worker-terrain.js +1 -1
  3. package/package.json +1 -1
  4. package/src/core/binary/BitSet.d.ts.map +1 -1
  5. package/src/core/binary/BitSet.js +2 -1
  6. package/src/{format/image/avif/av1/util → core/binary/operations}/ceil_log2.d.ts +2 -2
  7. package/src/core/binary/operations/ceil_log2.d.ts.map +1 -0
  8. package/src/{format/image/avif/av1/util → core/binary/operations}/ceil_log2.js +18 -18
  9. package/src/core/binary/zstd/ZstdReverseBitReader.d.ts.map +1 -1
  10. package/src/core/binary/zstd/ZstdReverseBitReader.js +225 -223
  11. package/src/core/binary/zstd/zstd_fse.d.ts.map +1 -1
  12. package/src/core/binary/zstd/zstd_fse.js +267 -265
  13. package/src/core/binary/zstd/zstd_huffman.d.ts.map +1 -1
  14. package/src/core/binary/zstd/zstd_huffman.js +246 -244
  15. package/src/core/bvh2/binary/2/BinaryUint32BVH.d.ts.map +1 -1
  16. package/src/core/bvh2/binary/2/BinaryUint32BVH.js +8 -2
  17. package/src/core/bvh2/bvh3/ebvh_optimize_treelet.d.ts.map +1 -1
  18. package/src/core/bvh2/bvh3/ebvh_optimize_treelet.js +8 -7
  19. package/src/core/collection/PairUint32Map.d.ts.map +1 -1
  20. package/src/core/collection/PairUint32Map.js +2 -2
  21. package/src/core/collection/Uint32Map.d.ts.map +1 -1
  22. package/src/core/collection/Uint32Map.js +2 -4
  23. package/src/core/collection/heap/FibonacciHeap.d.ts.map +1 -1
  24. package/src/core/collection/heap/FibonacciHeap.js +2 -1
  25. package/src/core/geom/2d/r-tree/StaticR2Tree.d.ts.map +1 -1
  26. package/src/core/geom/2d/r-tree/StaticR2Tree.js +8 -2
  27. package/src/core/geom/3d/shape/util/mesh_compute_triangle_edge_flags.d.ts.map +1 -1
  28. package/src/core/geom/3d/shape/util/mesh_compute_triangle_edge_flags.js +2 -3
  29. package/src/engine/graphics/texture/atlas/TextureAtlas.d.ts.map +1 -1
  30. package/src/engine/graphics/texture/atlas/TextureAtlas.js +13 -14
  31. package/src/engine/graphics/texture/atlas/sprite_atlas_border.d.ts.map +1 -1
  32. package/src/engine/graphics/texture/atlas/sprite_atlas_border.js +70 -69
  33. package/src/engine/graphics/texture/reflection/convolve_equirectangular_reflection.d.ts.map +1 -1
  34. package/src/engine/graphics/texture/reflection/convolve_equirectangular_reflection.js +2 -1
  35. package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts.map +1 -1
  36. package/src/engine/graphics3/GPUParticleEmitterSystem.js +2 -1
  37. package/src/engine/graphics3/decal/GPUDecalRenderer.d.ts.map +1 -1
  38. package/src/engine/graphics3/decal/GPUDecalRenderer.js +2 -1
  39. package/src/engine/graphics3/decal/chunk_decal_record.d.ts +14 -0
  40. package/src/engine/graphics3/decal/chunk_decal_record.d.ts.map +1 -0
  41. package/src/engine/graphics3/decal/chunk_decal_record.js +44 -0
  42. package/src/engine/graphics3/decal/shader_cluster_assign_decals.d.ts.map +1 -1
  43. package/src/engine/graphics3/decal/shader_cluster_assign_decals.js +2 -15
  44. package/src/engine/graphics3/decal/shader_cull_decals_frustum.d.ts.map +1 -1
  45. package/src/engine/graphics3/decal/shader_cull_decals_frustum.js +3 -16
  46. package/src/engine/graphics3/decal/shader_decal_composite.d.ts.map +1 -1
  47. package/src/engine/graphics3/decal/shader_decal_composite.js +3 -23
  48. package/src/engine/graphics3/terrain/TERRAIN_MATERIAL_TEMPLATE.d.ts.map +1 -1
  49. package/src/engine/graphics3/terrain/TERRAIN_MATERIAL_TEMPLATE.js +2 -1
  50. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  51. package/src/engine/physics/queries/shape_cast.js +2 -2
  52. package/src/format/image/avif/av1/decode/decode_palette.js +442 -442
  53. package/src/format/image/avif/av1/entropy/SymbolWriter.d.ts.map +1 -1
  54. package/src/format/image/avif/av1/entropy/SymbolWriter.js +2 -1
  55. package/src/generation/foliage/material/foliage_tile.d.ts.map +1 -1
  56. package/src/generation/foliage/material/foliage_tile.js +2 -1
  57. package/src/shade/device/mock/SoftwareGPUDevice.d.ts.map +1 -1
  58. package/src/shade/device/mock/SoftwareGPUDevice.js +6 -13
  59. package/src/shade/playground/caldera/main.js +3 -2
  60. package/src/shade/playground/probe_clipmap/README.md +2 -1
  61. package/src/shade/playground/probe_clipmap/index.html +7 -2
  62. package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -1
  63. package/src/shade/playground/probe_clipmap/main.js +17 -7
  64. package/src/shade/playground/sh_exponential/sh_exp_playground_shaders.d.ts.map +1 -1
  65. package/src/shade/playground/sh_exponential/sh_exp_playground_shaders.js +7 -13
  66. package/src/shade/playground/vgeo_scene/main.js +2 -1
  67. package/src/shade/playground/vsm/VSMDebugOverlay.d.ts.map +1 -1
  68. package/src/shade/playground/vsm/VSMDebugOverlay.js +3 -1
  69. package/src/shade/renderer/Renderer.d.ts +11 -0
  70. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  71. package/src/shade/renderer/Renderer.js +43 -1
  72. package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
  73. package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
  74. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +6 -6
  75. package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
  76. package/src/shade/renderer/fluid/pressure/shader_fluid_mg_coarsest.d.ts.map +1 -1
  77. package/src/shade/renderer/fluid/pressure/shader_fluid_mg_coarsest.js +5 -4
  78. package/src/shade/renderer/fluid/pressure/shader_fluid_mg_residual_restrict.d.ts.map +1 -1
  79. package/src/shade/renderer/fluid/pressure/shader_fluid_mg_residual_restrict.js +168 -166
  80. package/src/shade/renderer/fluid/pressure/shader_fluid_mg_smooth.d.ts.map +1 -1
  81. package/src/shade/renderer/fluid/pressure/shader_fluid_mg_smooth.js +221 -219
  82. package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
  83. package/src/shade/renderer/fow/shader_fog_of_war.d.ts.map +1 -1
  84. package/src/shade/renderer/fow/shader_fog_of_war.js +8 -19
  85. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts +26 -43
  86. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts.map +1 -1
  87. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +115 -123
  88. package/src/shade/renderer/geometry/sdf/MeshSDFLayout.d.ts.map +1 -1
  89. package/src/shade/renderer/geometry/sdf/MeshSDFLayout.js +2 -1
  90. package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.d.ts +20 -2
  91. package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.d.ts.map +1 -1
  92. package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.js +66 -2
  93. package/src/shade/renderer/geometry/virtual/proxy/vgeo_proxy_triangle_limit.d.ts +19 -0
  94. package/src/shade/renderer/geometry/virtual/proxy/vgeo_proxy_triangle_limit.d.ts.map +1 -0
  95. package/src/shade/renderer/geometry/virtual/proxy/vgeo_proxy_triangle_limit.js +25 -0
  96. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts.map +1 -1
  97. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.js +2 -1
  98. package/src/shade/renderer/geometry/virtual/runtime/VGeoResidency.d.ts.map +1 -1
  99. package/src/shade/renderer/geometry/virtual/runtime/VGeoResidency.js +2 -1
  100. package/src/shade/renderer/geometry/virtual/runtime/VirtualGeometry.d.ts +15 -0
  101. package/src/shade/renderer/geometry/virtual/runtime/VirtualGeometry.d.ts.map +1 -1
  102. package/src/shade/renderer/geometry/virtual/runtime/VirtualGeometry.js +38 -0
  103. package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.d.ts +28 -59
  104. package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.d.ts.map +1 -1
  105. package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.js +84 -789
  106. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_decode_from_storage.d.ts.map +1 -1
  107. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_decode_from_storage.js +10 -31
  108. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_encode_to_storage.d.ts.map +1 -1
  109. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_encode_to_storage.js +9 -15
  110. package/src/shade/renderer/global_illumination/clipmap/shader_debug_clipmap.d.ts +2 -1
  111. package/src/shade/renderer/global_illumination/clipmap/shader_debug_clipmap.d.ts.map +1 -1
  112. package/src/shade/renderer/global_illumination/clipmap/shader_debug_clipmap.js +6 -5
  113. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.d.ts.map +1 -1
  114. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.js +2 -1
  115. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +15 -3
  116. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
  117. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +168 -18
  118. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.d.ts +2 -1
  119. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.d.ts.map +1 -1
  120. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.js +2 -1
  121. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +98 -57
  122. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
  123. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +168 -77
  124. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts +4 -2
  125. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts.map +1 -1
  126. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.js +27 -12
  127. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.d.ts.map +1 -1
  128. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.js +12 -7
  129. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts.map +1 -1
  130. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +8 -2
  131. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_instance.d.ts +2 -2
  132. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_instance.js +2 -2
  133. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.d.ts.map +1 -1
  134. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.js +5 -2
  135. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.js +1 -1
  136. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.d.ts.map +1 -1
  137. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.js +5 -3
  138. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.js +1 -1
  139. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_free.d.ts.map +1 -1
  140. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_free.js +1 -1
  141. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_movers_command.d.ts.map +1 -1
  142. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_movers_command.js +4 -2
  143. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_scroll.d.ts.map +1 -1
  144. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_scroll.js +1 -1
  145. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_store.d.ts.map +1 -1
  146. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_store.js +1 -1
  147. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_take.d.ts.map +1 -1
  148. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_take.js +3 -1
  149. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_cards.js +2 -2
  150. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts +114 -41
  151. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts.map +1 -1
  152. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js +424 -207
  153. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts +34 -25
  154. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts.map +1 -1
  155. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.js +41 -31
  156. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_RESAMPLING.d.ts +7 -5
  157. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_RESAMPLING.d.ts.map +1 -1
  158. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_RESAMPLING.js +7 -5
  159. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.d.ts +47 -0
  160. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.d.ts.map +1 -0
  161. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.js +84 -0
  162. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts +48 -0
  163. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts.map +1 -0
  164. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.js +101 -0
  165. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts +58 -4
  166. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts.map +1 -1
  167. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.js +127 -30
  168. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_cage.d.ts +18 -7
  169. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_cage.d.ts.map +1 -1
  170. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_cage.js +39 -13
  171. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.d.ts +29 -8
  172. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.d.ts.map +1 -1
  173. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.js +112 -56
  174. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_resample.d.ts +19 -0
  175. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_resample.d.ts.map +1 -0
  176. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_resample.js +35 -0
  177. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.d.ts.map +1 -1
  178. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.js +9 -3
  179. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.d.ts +3 -3
  180. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.js +5 -5
  181. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts +8 -12
  182. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts.map +1 -1
  183. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.js +23 -56
  184. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.d.ts +0 -3
  185. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.d.ts.map +1 -1
  186. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.js +11 -15
  187. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.d.ts +26 -0
  188. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.d.ts.map +1 -0
  189. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.js +173 -0
  190. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.d.ts +32 -0
  191. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.d.ts.map +1 -0
  192. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.js +166 -0
  193. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.d.ts +3 -4
  194. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.d.ts.map +1 -1
  195. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.js +3 -4
  196. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.d.ts.map +1 -1
  197. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.js +3 -1
  198. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts +6 -12
  199. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts.map +1 -1
  200. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.js +15 -65
  201. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.d.ts.map +1 -1
  202. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.js +7 -2
  203. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts +4 -4
  204. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts.map +1 -1
  205. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.js +24 -17
  206. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_publish.d.ts +7 -5
  207. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_publish.d.ts.map +1 -1
  208. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_publish.js +18 -10
  209. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.d.ts +2 -2
  210. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.d.ts.map +1 -1
  211. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.js +9 -5
  212. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_relocate.d.ts +3 -0
  213. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_relocate.d.ts.map +1 -1
  214. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_relocate.js +9 -6
  215. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample.d.ts +1 -1
  216. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample.d.ts.map +1 -1
  217. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample.js +16 -16
  218. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample_rays.d.ts +36 -0
  219. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample_rays.d.ts.map +1 -0
  220. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample_rays.js +233 -0
  221. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.d.ts.map +1 -1
  222. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.js +7 -5
  223. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.d.ts.map +1 -1
  224. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.js +5 -3
  225. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts.map +1 -1
  226. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.js +10 -4
  227. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.d.ts +2 -1
  228. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.d.ts.map +1 -1
  229. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.js +12 -6
  230. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.d.ts +1 -2
  231. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.d.ts.map +1 -1
  232. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.js +5 -6
  233. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.d.ts +14 -18
  234. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.d.ts.map +1 -1
  235. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.js +25 -35
  236. package/src/shade/renderer/gpu_primitive/WEBGPU_GUARANTEED_MAX_UNIFORM_BUFFER_BINDING_SIZE.d.ts +13 -0
  237. package/src/shade/renderer/gpu_primitive/WEBGPU_GUARANTEED_MAX_UNIFORM_BUFFER_BINDING_SIZE.d.ts.map +1 -0
  238. package/src/shade/renderer/gpu_primitive/WEBGPU_GUARANTEED_MAX_UNIFORM_BUFFER_BINDING_SIZE.js +12 -0
  239. package/src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.d.ts +27 -2
  240. package/src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.d.ts.map +1 -1
  241. package/src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.js +62 -6
  242. package/src/shade/renderer/gpu_primitive/indirect/IndirectComputeCommandBuildPass.d.ts.map +1 -1
  243. package/src/shade/renderer/gpu_primitive/indirect/IndirectComputeCommandBuildPass.js +10 -19
  244. package/src/shade/renderer/gpu_primitive/indirect/chunk_folded_dispatch.d.ts.map +1 -1
  245. package/src/shade/renderer/gpu_primitive/indirect/chunk_folded_dispatch.js +6 -3
  246. package/src/shade/renderer/hiz/hzb_pick_alignment.d.ts.map +1 -1
  247. package/src/shade/renderer/hiz/hzb_pick_alignment.js +149 -148
  248. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_environment_cells.d.ts.map +1 -1
  249. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_environment_cells.js +4 -2
  250. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_log_floor.d.ts.map +1 -1
  251. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_log_floor.js +6 -5
  252. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_project.d.ts.map +1 -1
  253. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_project.js +3 -1
  254. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_reference_reflectance.d.ts.map +1 -1
  255. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_reference_reflectance.js +3 -1
  256. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_solve.d.ts.map +1 -1
  257. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_solve.js +3 -1
  258. package/src/shade/renderer/light/world_cluster/WORLD_LIGHT_CLUSTER.d.ts +0 -5
  259. package/src/shade/renderer/light/world_cluster/WORLD_LIGHT_CLUSTER.d.ts.map +1 -1
  260. package/src/shade/renderer/light/world_cluster/WORLD_LIGHT_CLUSTER.js +0 -7
  261. package/src/shade/renderer/light/world_cluster/graph_build_world_light_clusters.d.ts +15 -2
  262. package/src/shade/renderer/light/world_cluster/graph_build_world_light_clusters.d.ts.map +1 -1
  263. package/src/shade/renderer/light/world_cluster/graph_build_world_light_clusters.js +51 -16
  264. package/src/shade/renderer/light/world_cluster/shader_world_cluster_assign_lights.d.ts.map +1 -1
  265. package/src/shade/renderer/light/world_cluster/shader_world_cluster_assign_lights.js +3 -2
  266. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  267. package/src/shade/renderer/material/GPUMaterialManager.d.ts +4 -1
  268. package/src/shade/renderer/material/GPUMaterialManager.d.ts.map +1 -1
  269. package/src/shade/renderer/material/GPUMaterialManager.js +5 -8
  270. package/src/shade/renderer/postprocess/dof/raymarch/chunk_dof_lds_coc_cache.d.ts +17 -0
  271. package/src/shade/renderer/postprocess/dof/raymarch/chunk_dof_lds_coc_cache.d.ts.map +1 -0
  272. package/src/shade/renderer/postprocess/dof/raymarch/chunk_dof_lds_coc_cache.js +81 -0
  273. package/src/shade/renderer/postprocess/dof/raymarch/shader_dof_raymarch_compute.d.ts.map +1 -1
  274. package/src/shade/renderer/postprocess/dof/raymarch/shader_dof_raymarch_compute.js +5 -48
  275. package/src/shade/renderer/postprocess/dof/raymarch/shader_dof_slice_compute.d.ts.map +1 -1
  276. package/src/shade/renderer/postprocess/dof/raymarch/shader_dof_slice_compute.js +4 -44
  277. package/src/shade/renderer/postprocess/gtao/GTAO.d.ts +7 -3
  278. package/src/shade/renderer/postprocess/gtao/GTAO.d.ts.map +1 -1
  279. package/src/shade/renderer/postprocess/gtao/GTAO.js +26 -13
  280. package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.d.ts +14 -0
  281. package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.d.ts.map +1 -1
  282. package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.js +196 -68
  283. package/src/shade/renderer/postprocess/gtao/chunk_integrate_lighting_sample.d.ts.map +1 -1
  284. package/src/shade/renderer/postprocess/gtao/chunk_integrate_lighting_sample.js +4 -1
  285. package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao.d.ts.map +1 -1
  286. package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao.js +42 -28
  287. package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao_with_irradiance.d.ts.map +1 -1
  288. package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao_with_irradiance.js +430 -414
  289. package/src/shade/renderer/postprocess/gtao/shader_gtao_spatial_denoise.d.ts +16 -0
  290. package/src/shade/renderer/postprocess/gtao/shader_gtao_spatial_denoise.d.ts.map +1 -0
  291. package/src/shade/renderer/postprocess/gtao/shader_gtao_spatial_denoise.js +156 -0
  292. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  293. package/src/shade/renderer/postprocess/nss/chunk_nss_luma_derivative.d.ts.map +1 -1
  294. package/src/shade/renderer/postprocess/nss/chunk_nss_luma_derivative.js +5 -7
  295. package/src/shade/renderer/postprocess/nss/chunk_nss_tonemap.d.ts +17 -0
  296. package/src/shade/renderer/postprocess/nss/chunk_nss_tonemap.d.ts.map +1 -0
  297. package/src/shade/renderer/postprocess/nss/chunk_nss_tonemap.js +56 -0
  298. package/src/shade/renderer/postprocess/nss/shader_nss_postprocess.d.ts.map +1 -1
  299. package/src/shade/renderer/postprocess/nss/shader_nss_postprocess.js +2 -22
  300. package/src/shade/renderer/postprocess/nss/shader_nss_preprocess.d.ts.map +1 -1
  301. package/src/shade/renderer/postprocess/nss/shader_nss_preprocess.js +2 -13
  302. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
  303. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +10 -13
  304. package/src/shade/renderer/rasterize/expand/bucket/RASTERIZATION_BUCKET_LIMIT.d.ts.map +1 -1
  305. package/src/shade/renderer/rasterize/expand/bucket/RASTERIZATION_BUCKET_LIMIT.js +39 -38
  306. package/src/shade/renderer/rasterize/expand/mesh/shader_prefix_sum_to_command.d.ts.map +1 -1
  307. package/src/shade/renderer/rasterize/expand/mesh/shader_prefix_sum_to_command.js +7 -12
  308. package/src/shade/renderer/scene/GPUSceneContext.d.ts +2 -2
  309. package/src/shade/renderer/scene/GPUSceneContext.js +5 -5
  310. package/src/shade/renderer/shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.d.ts +8 -6
  311. package/src/shade/renderer/shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.d.ts.map +1 -1
  312. package/src/shade/renderer/shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.js +10 -7
  313. package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_key.d.ts +16 -0
  314. package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_key.d.ts.map +1 -0
  315. package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_key.js +35 -0
  316. package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_select_finest.d.ts +5 -2
  317. package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_select_finest.d.ts.map +1 -1
  318. package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_select_finest.js +27 -18
  319. package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh2_color_get_irradiance_at.d.ts.map +1 -1
  320. package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh2_color_get_irradiance_at.js +5 -15
  321. package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh3_convolve_with_cosine_kernel.d.ts.map +1 -1
  322. package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh3_convolve_with_cosine_kernel.js +5 -19
  323. package/src/shade/renderer/shader/chunk/spherical_harmonics/dering/chunk_sh3_windowing.d.ts.map +1 -1
  324. package/src/shade/renderer/shader/chunk/spherical_harmonics/dering/chunk_sh3_windowing.js +3 -22
  325. package/src/shade/renderer/shadow/map/ShadowmapDrawSelector.d.ts.map +1 -1
  326. package/src/shade/renderer/shadow/map/ShadowmapDrawSelector.js +2 -1
  327. package/src/shade/renderer/volumetrics/chunk_volumetrics_sun_shadow_group_list.d.ts.map +1 -1
  328. package/src/shade/renderer/volumetrics/chunk_volumetrics_sun_shadow_group_list.js +154 -152
  329. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts.map +1 -1
  330. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.js +2 -1
  331. package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP.d.ts +3 -1
  332. package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP.d.ts.map +1 -1
  333. package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP.js +4 -3
  334. package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP_STRUCT.d.ts +7 -1
  335. package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP_STRUCT.d.ts.map +1 -1
  336. package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP_STRUCT.js +54 -47
  337. package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_sample.d.ts.map +1 -1
  338. package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_sample.js +371 -370
  339. package/src/shade/renderer/water/GPUWaterRenderer.d.ts.map +1 -1
  340. package/src/shade/renderer/water/GPUWaterRenderer.js +2 -1
  341. package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
  342. package/src/shade/renderer/water/surface/lod/shader_water_lod.d.ts.map +1 -1
  343. package/src/shade/renderer/water/surface/lod/shader_water_lod.js +12 -14
  344. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -1
  345. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +2 -9
  346. package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts.map +1 -1
  347. package/src/shade/renderer/water/surface/particles/chunk_water_particle.js +2 -1
  348. package/src/shade/renderer/wind/WIND_FIELD.d.ts +3 -1
  349. package/src/shade/renderer/wind/WIND_FIELD.d.ts.map +1 -1
  350. package/src/shade/renderer/wind/WIND_FIELD.js +4 -3
  351. package/src/shade/renderer/wind/WIND_FIELD_STRUCT.d.ts +8 -2
  352. package/src/shade/renderer/wind/WIND_FIELD_STRUCT.d.ts.map +1 -1
  353. package/src/shade/renderer/wind/WIND_FIELD_STRUCT.js +11 -4
  354. package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.d.ts +2 -2
  355. package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.d.ts.map +1 -1
  356. package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.js +13 -4
  357. package/src/shade/util/texture_mip_extent.d.ts.map +1 -1
  358. package/src/shade/util/texture_mip_extent.js +88 -87
  359. package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
  360. package/src/shade/wgsl/emulator/WGSLLanguageCore.js +9 -7
  361. package/src/format/image/avif/av1/util/ceil_log2.d.ts.map +0 -1
  362. package/src/shade/renderer/geometry/virtual/sdf/VGEO_SDF.d.ts +0 -47
  363. package/src/shade/renderer/geometry/virtual/sdf/VGEO_SDF.d.ts.map +0 -1
  364. package/src/shade/renderer/geometry/virtual/sdf/VGEO_SDF.js +0 -80
  365. package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_collect.d.ts +0 -16
  366. package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_collect.d.ts.map +0 -1
  367. package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_collect.js +0 -67
  368. package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_decode.d.ts +0 -17
  369. package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_decode.d.ts.map +0 -1
  370. package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_decode.js +0 -145
  371. package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_traverse.d.ts +0 -12
  372. package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_traverse.d.ts.map +0 -1
  373. package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_traverse.js +0 -105
  374. package/src/shade/renderer/shader/chunk/color/chunk_hash_squirrel3.d.ts +0 -1
  375. package/src/shade/renderer/shader/chunk/color/chunk_hash_squirrel3.d.ts.map +0 -1
  376. package/src/shade/renderer/shader/chunk/color/chunk_hash_squirrel3.js +0 -0
@@ -0,0 +1,166 @@
1
+ import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
2
+ import { chunk_hash_to_float01 } from "../../../shader/chunk/random/chunk_hash_to_float01.js";
3
+ import { chunk_pcg3d } from "../../../shader/chunk/random/pcg/chunk_pcg3d.js";
4
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
5
+ import { ComputeShader } from "../../../shader/ComputeShader.js";
6
+ import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
7
+ import { u32 } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
8
+ import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
9
+ import {
10
+ chunk_probe_clipmap,
11
+ chunk_probe_clipmap_listed,
12
+ PROBE_CANDIDATES_WRITE_RESOURCE,
13
+ PROBE_DEPTH_HISTORY_RESOURCE,
14
+ PROBE_LEVELS_RESOURCE,
15
+ PROBE_LISTED_READ_RESOURCE,
16
+ PROBE_ORIGINS_READ_RESOURCE,
17
+ PROBE_RECORDS_READ_RESOURCE,
18
+ PROBE_STATES_READ_RESOURCE,
19
+ PROBE_TRACE_READ_RESOURCE
20
+ } from "./chunk_probe_clipmap.js";
21
+ import {
22
+ chunk_probe_clipmap_pick,
23
+ PROBE_DEPTH_SAMPLER_RESOURCE,
24
+ PROBE_INDIRECTION_READ_RESOURCE,
25
+ PROBE_SAMPLING_RESOURCE
26
+ } from "./chunk_probe_clipmap_pick.js";
27
+ import { chunk_probe_clipmap_resample } from "./chunk_probe_clipmap_resample.js";
28
+ import { PROBE_DEPTH_LIMIT, PROBE_THREAD_WORKGROUP_SIZE } from "./PROBE_CLIPMAP.js";
29
+
30
+ /**
31
+ * @type {WebGPUStruct}
32
+ */
33
+ export const PROBE_CANDIDATE_SETTINGS = WebGPUStruct.from({
34
+ /** probes a frame updates at most: the trace list's bound */
35
+ trace_capacity: u32,
36
+ }, "ProbeCandidateSettings");
37
+
38
+ const resources = new ShaderResourceSetDescriptor();
39
+
40
+ resources.setImmediate("settings", PROBE_CANDIDATE_SETTINGS);
41
+
42
+ resources.createGroup()
43
+ .add(PROBE_TRACE_READ_RESOURCE)
44
+ .add(PROBE_ORIGINS_READ_RESOURCE)
45
+ .add(PROBE_LISTED_READ_RESOURCE)
46
+ .add(PROBE_CANDIDATES_WRITE_RESOURCE);
47
+
48
+ resources.createGroup()
49
+ .add(PROBE_LEVELS_RESOURCE)
50
+ .add(PROBE_SAMPLING_RESOURCE)
51
+ .add(PROBE_INDIRECTION_READ_RESOURCE)
52
+ .add(PROBE_STATES_READ_RESOURCE)
53
+ .add(PROBE_RECORDS_READ_RESOURCE)
54
+ .add(PROBE_DEPTH_HISTORY_RESOURCE)
55
+ .add(PROBE_DEPTH_SAMPLER_RESOURCE);
56
+
57
+ /**
58
+ * The candidate (Enshrouded's "pick neighbor candidates"): a thread a listed probe B, dispatched through
59
+ * `PROBE_DISPATCH_TRACED` after relocation, draws the one neighbour whose rays of this frame it re-samples
60
+ * (`shader_probe_clipmap_resample_rays`), and writes it to `probe_candidates`: its place in the list, or
61
+ * `PROBE_CLIPMAP_NONE`, and the weight its rays take.
62
+ *
63
+ * - **The neighbours**: the 26 around B's lattice point in its cascade. One is a candidate if it is ALIVE, its
64
+ * record holds that point (the storage wraps), and it is listed this frame (`probe_clipmap_listed`), so that its
65
+ * rays are in `probe_rays`. A NEW one is not. M counts them.
66
+ * - **The importance**: the neighbour's radiance, its irradiance's L0 luma, times B's visibility of it: Chebyshev
67
+ * over B's depth moments toward it (`probe_visibility_chebyshev`), its distance in B's spacings held to the depth
68
+ * limit, as the moments are. A dark neighbour, or one behind a wall, weighs about nothing.
69
+ * - **The draw**: one by its importance, a reservoir of one through the 26 with a hash of the slot, the update count
70
+ * and the neighbour.
71
+ * - **The weight**: the draw's density divided out, `(1 / M) / p`, p the drawn one's importance over the sum: the
72
+ * rays B takes are then, in expectation, every candidate's alike.
73
+ * - A probe whose first update this is, or a DEAD one, draws nothing: its depth is not yet its own, or it is
74
+ * inside a solid.
75
+ *
76
+ * Reads the depth atlas as the last publish left it, and the frame's origins, records and states, which no pass
77
+ * after relocation writes before accumulate.
78
+ *
79
+ * @type {ComputeShader}
80
+ */
81
+ export const shader_probe_clipmap_candidate = ComputeShader.from({
82
+ label: "Probe Clipmap Candidate",
83
+ resources,
84
+ body: CodeChunk.from(
85
+ //language=WGSL
86
+ `
87
+ @compute @workgroup_size(${PROBE_THREAD_WORKGROUP_SIZE})
88
+ fn main(
89
+ @builtin(workgroup_id) workgroup_id: vec3<u32>,
90
+ @builtin(local_invocation_index) lane: u32,
91
+ ) {
92
+ let k = folded_workgroup_index(workgroup_id) * PROBE_THREAD_WORKGROUP_SIZE + lane;
93
+
94
+ if (k >= min(probe_trace.count, settings.trace_capacity)) {
95
+ return;
96
+ }
97
+
98
+ let slot = probe_trace.elements[k];
99
+ let state = probe_states[slot];
100
+
101
+ var drawn = PROBE_CLIPMAP_NONE;
102
+ var drawn_importance = 0.0;
103
+ var total = 0.0;
104
+ var candidates = 0u;
105
+
106
+ if (probe_state_kind(state.x) == PROBE_STATE_ALIVE) {
107
+ let record = probe_records[slot];
108
+ let cascade = probe_record_cascade(record.flags);
109
+ let origin = probe_origins[k];
110
+ let spacing = origin.w;
111
+ let updates = probe_state_updates(state.x);
112
+
113
+ for (var j = 0u; j < 26u; j++) {
114
+ let lattice = record.cell + probe_resample_offset(j);
115
+ let neighbour = probe_clipmap_corner_slot(cascade, lattice);
116
+
117
+ if (neighbour == PROBE_CLIPMAP_NONE) {
118
+ continue;
119
+ }
120
+
121
+ // the storage wraps: the slot is this point's only if its record says so
122
+ if (probe_state_kind(probe_states[neighbour].x) != PROBE_STATE_ALIVE || any(probe_records[neighbour].cell != lattice)) {
123
+ continue;
124
+ }
125
+
126
+ let listed = probe_clipmap_listed(neighbour, settings.trace_capacity);
127
+
128
+ if (listed == PROBE_CLIPMAP_NONE) {
129
+ continue;
130
+ }
131
+
132
+ candidates++;
133
+
134
+ let to_neighbour = probe_origins[listed].xyz - origin.xyz;
135
+ let distance = length(to_neighbour);
136
+ let toward = to_neighbour / max(distance, 1e-6);
137
+ let visibility = probe_visibility_chebyshev(probe_clipmap_depth_moments(slot, toward), min(distance / spacing, ${PROBE_DEPTH_LIMIT}));
138
+ let radiance = max(probe_record_sh_decode(probe_records[neighbour].sh).Y.w, 0.0);
139
+ let importance = radiance * visibility;
140
+
141
+ if (importance <= 0.0) {
142
+ continue;
143
+ }
144
+
145
+ total += importance;
146
+
147
+ if (hash_to_float01(pcg3d(vec3<u32>(slot, updates, j)).x) * total < importance) {
148
+ drawn = listed;
149
+ drawn_importance = importance;
150
+ }
151
+ }
152
+ }
153
+
154
+ probe_candidates[k].listed = drawn;
155
+ probe_candidates[k].weight = select(0.0, total / (f32(candidates) * drawn_importance), drawn != PROBE_CLIPMAP_NONE);
156
+ }
157
+ `, [
158
+ chunk_probe_clipmap,
159
+ chunk_probe_clipmap_listed,
160
+ chunk_probe_clipmap_pick,
161
+ chunk_probe_clipmap_resample,
162
+ chunk_folded_workgroup_index,
163
+ chunk_hash_to_float01,
164
+ chunk_pcg3d,
165
+ ]),
166
+ });
@@ -8,10 +8,9 @@ export const PROBE_DUE_SETTINGS: WebGPUStruct;
8
8
  * when a want waits on it:
9
9
  * - it is NEW, in the first pass, which lists them first: it has had no update;
10
10
  * - in the second pass, it is ALIVE or DEAD, a pixel or a hit wanted it since its last update, its
11
- * wanted time past its traced time, and `(frame + h(slot)) mod T` is 0. A DEAD probe's update casts
12
- * the fewest rays (`PROBE_RAYS_PER_TEXEL_MIN`), every period rather than every eighth at R, so that a
13
- * probe inside a solid notices when the scene changes sooner, for fewer rays (Enshrouded's dead probes
14
- * trace 16 a frame).
11
+ * wanted time past its traced time, and `(frame + h(slot)) mod T` is 0. A DEAD probe is due every
12
+ * period like an ALIVE one, its update casting `PROBE_DEAD_RAYS`, so that a probe inside a solid
13
+ * notices when the scene changes (Enshrouded's dead probes trace 16 a frame).
15
14
  *
16
15
  * Wanted since its last update, not this frame: a hit wants a probe the frame after its own probe's
17
16
  * update, so a probe that only hits keep is wanted on few of its turns. Measured on Sponza with the
@@ -1 +1 @@
1
- {"version":3,"file":"shader_probe_clipmap_due.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.js"],"names":[],"mappings":"AAkBA;;GAEG;AACH,iCAFU,YAAY,CAWC;AAavB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,uCAFU,aAAa,CA4CpB;6BArG0B,sCAAsC;8BAHrC,kCAAkC"}
1
+ {"version":3,"file":"shader_probe_clipmap_due.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.js"],"names":[],"mappings":"AAkBA;;GAEG;AACH,iCAFU,YAAY,CAWC;AAavB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,uCAFU,aAAa,CA4CpB;6BApG0B,sCAAsC;8BAHrC,kCAAkC"}
@@ -47,10 +47,9 @@ resources.createGroup()
47
47
  * when a want waits on it:
48
48
  * - it is NEW, in the first pass, which lists them first: it has had no update;
49
49
  * - in the second pass, it is ALIVE or DEAD, a pixel or a hit wanted it since its last update, its
50
- * wanted time past its traced time, and `(frame + h(slot)) mod T` is 0. A DEAD probe's update casts
51
- * the fewest rays (`PROBE_RAYS_PER_TEXEL_MIN`), every period rather than every eighth at R, so that a
52
- * probe inside a solid notices when the scene changes sooner, for fewer rays (Enshrouded's dead probes
53
- * trace 16 a frame).
50
+ * wanted time past its traced time, and `(frame + h(slot)) mod T` is 0. A DEAD probe is due every
51
+ * period like an ALIVE one, its update casting `PROBE_DEAD_RAYS`, so that a probe inside a solid
52
+ * notices when the scene changes (Enshrouded's dead probes trace 16 a frame).
54
53
  *
55
54
  * Wanted since its last update, not this frame: a hit wants a probe the frame after its own probe's
56
55
  * update, so a probe that only hits keep is wanted on few of its turns. Measured on Sponza with the
@@ -1 +1 @@
1
- {"version":3,"file":"shader_probe_clipmap_guide.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.js"],"names":[],"mappings":"AAmBA;;GAEG;AACH,mCAFU,YAAY,CAWG;AAkEzB;;;;;;;;;GASG;AACH,8CAFU,aAAa,CAgCpB;AAEH;;;;;;GAMG;AACH,iDAFU,aAAa,CA4CpB;AAEH;;;;;;;;GAQG;AACH,gDAFU,aAAa,CA2DpB;6BA1P0B,sCAAsC;8BAHrC,kCAAkC"}
1
+ {"version":3,"file":"shader_probe_clipmap_guide.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.js"],"names":[],"mappings":"AAmBA;;GAEG;AACH,mCAFU,YAAY,CAaG;AAkEzB;;;;;;;;;GASG;AACH,8CAFU,aAAa,CAgCpB;AAEH;;;;;;GAMG;AACH,iDAFU,aAAa,CA4CpB;AAEH;;;;;;;;GAQG;AACH,gDAFU,aAAa,CA2DpB;6BA5P0B,sCAAsC;8BAHrC,kCAAkC"}
@@ -29,6 +29,8 @@ export const PROBE_GUIDE_SETTINGS = WebGPUStruct.from({
29
29
  radiance_resolution: u32,
30
30
  /** tiles a row of the radiance atlas */
31
31
  radiance_tiles_per_row: u32,
32
+ /** texels of skirt around a radiance tile's map on each side: 1, or 0 for a clipmap whose radiance is never sampled */
33
+ radiance_skirt: u32,
32
34
  }, "ProbeGuideSettings");
33
35
 
34
36
  const resources = new ShaderResourceSetDescriptor();
@@ -78,7 +80,7 @@ fn probe_guide_thread(workgroup_id: vec3<u32>, lane: u32) -> ProbeGuideThread {
78
80
  out.slot = probe_trace.elements[out.k];
79
81
  out.updates = probe_state_updates(probe_states[out.slot].x);
80
82
  out.base = out.k * probe_clipmap_guide_words(n);
81
- out.tile = index_to_grid2d(out.slot, settings.radiance_tiles_per_row) * (n + 2u) + 1u;
83
+ out.tile = index_to_grid2d(out.slot, settings.radiance_tiles_per_row) * (n + 2u * settings.radiance_skirt) + settings.radiance_skirt;
82
84
 
83
85
  return out;
84
86
  }
@@ -1,8 +1,8 @@
1
1
  /**
2
- * The light a front-face hit takes from beyond the trace (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.7): a
2
+ * The light a front-face hit takes from the local lights (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.7): a
3
3
  * thread a ray, after shade through the same launch, `PROBE_DISPATCH_RAYS`, its probe the one trace wrote
4
- * into its flags. It adds ρ_d·(E_loc + E_ind)/π to the radiance shade left, ρ_d being the albedo shade
5
- * left in the ray's \`row\`.
4
+ * into its flags. It adds ρ_d·E_loc/π to the radiance shade left, ρ_d being the albedo shade left in the
5
+ * ray's \`row\`; the next bounce, E_ind, is the bounce pass's, after it (`shader_probe_clipmap_bounce`).
6
6
  *
7
7
  * - **E_loc, the local lights**: one of the point and spot lights of the hit's cell of the world light
8
8
  * clusters, built over the bricks' cascades so that every hit has one, at most
@@ -19,16 +19,10 @@
19
19
  * a voxel, whichever is more, for the expand at that end. It sees the light if it misses; a hit, or a
20
20
  * march that spends its steps, is no light. A light that casts no shadow traces none.
21
21
  * - The pick and the point are drawn from the ray's slot and direction, fresh every update.
22
- * - **E_ind, the next bounce**: this mode's own diffuse at the hit, `probe_clipmap_sample_sh` from the
23
- * hit along its normal, the view back along the ray, with the ray's own jitter as the pick's noise.
24
- * The projection writes the records later in the frame, so they hold last frame's SH: each frame takes
25
- * one more bounce.
26
- * - Where no probe weighs anything the bounce is **zero**, not the environment: a hit behind the camera
27
- * in a cave must not bring daylight in. The next frame's hits' wants ask for the probes it read
28
- * (`shader_probe_clipmap_want_hits`), so the bounce has them a frame or two later.
29
- * - LPV's 0.97 a bounce is dropped: an albedo under one bounds the series already.
30
22
  *
31
- * Its own pass because shade binds nine of a stage's ten storage buffers, and the pick takes two more.
23
+ * Its own pass because shade binds nine of a stage's ten storage buffers; apart from the bounce because the
24
+ * two together would bind twelve storage buffers, and a shadow march is another cost than probe taps
25
+ * (WORLD_PROBE_CACHE_SCOPE_2026_11_01.md §1.5).
32
26
  *
33
27
  * @type {ComputeShader}
34
28
  */
@@ -1 +1 @@
1
- {"version":3,"file":"shader_probe_clipmap_light.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.js"],"names":[],"mappings":"AA8FA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,yCAFU,aAAa,CA6LpB;8BApS2B,kCAAkC"}
1
+ {"version":3,"file":"shader_probe_clipmap_light.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.js"],"names":[],"mappings":"AAqEA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,yCAFU,aAAa,CA0KpB;8BAnP2B,kCAAkC"}
@@ -11,20 +11,20 @@ import {
11
11
  import { chunk_rgb_to_luminance } from "../../../shader/chunk/color/chunk_rgb_to_luminance.js";
12
12
  import { chunk_rgbe9995_decode } from "../../../shader/chunk/color/rgbe9995/chunk_rgbe9995_decode.js";
13
13
  import { chunk_rgbe9995_encode } from "../../../shader/chunk/color/rgbe9995/chunk_rgbe9995_encode.js";
14
- import { chunk_uv_octahedral_unit_decode } from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
14
+ import {
15
+ chunk_uv_octahedral_unit_decode
16
+ } from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
15
17
  import { chunk_sphere_sample_volume } from "../../../shader/chunk/geometry/sphere/chunk_sphere_sample_volume.js";
16
18
  import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
17
19
  import { RECIPROCAL_PI_DECLARATION } from "../../../shader/chunk/math/RECIPROCAL_PI_DECLARATION.js";
18
20
  import { chunk_hash_to_float01 } from "../../../shader/chunk/random/chunk_hash_to_float01.js";
19
21
  import { chunk_pcg4d } from "../../../shader/chunk/random/pcg/chunk_pcg4d.js";
20
- import {
21
- chunk_resolve_irradiance_sh_to_diffuse
22
- } from "../../../shader/chunk/spherical_harmonics/l1i/chunk_resolve_irradiance_sh_to_diffuse.js";
23
22
  import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
24
23
  import { ComputeShader } from "../../../shader/ComputeShader.js";
25
24
  import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
26
- import { STBN_VEC2_RESOURCE } from "../../../STATIC_GRAPHICS_ENGINE_ASSET_RESOURCES.js";
27
- import { chunk_irradiance_clipmap_local_light } from "../../../volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_local_light.js";
25
+ import {
26
+ chunk_irradiance_clipmap_local_light
27
+ } from "../../../volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_local_light.js";
28
28
  import { IRRADIANCE_CLIPMAP_LIGHT_BUDGET } from "../../../volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP.js";
29
29
  import { BRICK_TRACE_HIT } from "../brick/BRICK_CLIPMAP.js";
30
30
  import {
@@ -37,25 +37,11 @@ import {
37
37
  } from "../brick/chunk_brick_clipmap_trace.js";
38
38
  import {
39
39
  chunk_probe_clipmap,
40
- chunk_probe_clipmap_ray_jitter,
41
- chunk_probe_clipmap_ray_layout,
42
40
  chunk_probe_clipmap_ray_origin,
43
- chunk_probe_clipmap_ray_texel,
44
- PROBE_DEPTH_HISTORY_RESOURCE,
45
- PROBE_LEVELS_RESOURCE,
46
41
  PROBE_ORIGINS_READ_RESOURCE,
47
- PROBE_RAY_SUMS_READ_RESOURCE,
48
42
  PROBE_RAYS_WRITE_RESOURCE,
49
- PROBE_RECORDS_READ_RESOURCE,
50
- PROBE_STATES_READ_RESOURCE,
51
43
  PROBE_TRACE_READ_RESOURCE
52
44
  } from "./chunk_probe_clipmap.js";
53
- import {
54
- chunk_probe_clipmap_pick,
55
- PROBE_DEPTH_SAMPLER_RESOURCE,
56
- PROBE_INDIRECTION_READ_RESOURCE,
57
- PROBE_SAMPLING_RESOURCE
58
- } from "./chunk_probe_clipmap_pick.js";
59
45
  import { PROBE_THREAD_WORKGROUP_SIZE } from "./PROBE_CLIPMAP.js";
60
46
  import { PROBE_TRACE_SETTINGS } from "./shader_probe_clipmap_trace.js";
61
47
 
@@ -69,18 +55,7 @@ resources.setImmediate("settings", PROBE_TRACE_SETTINGS);
69
55
  resources.createGroup()
70
56
  .add(PROBE_TRACE_READ_RESOURCE)
71
57
  .add(PROBE_ORIGINS_READ_RESOURCE)
72
- .add(PROBE_RAYS_WRITE_RESOURCE)
73
- .add(PROBE_RAY_SUMS_READ_RESOURCE)
74
- .add(PROBE_STATES_READ_RESOURCE)
75
- .add(STBN_VEC2_RESOURCE);
76
-
77
- resources.createGroup()
78
- .add(PROBE_LEVELS_RESOURCE)
79
- .add(PROBE_SAMPLING_RESOURCE)
80
- .add(PROBE_INDIRECTION_READ_RESOURCE)
81
- .add(PROBE_RECORDS_READ_RESOURCE)
82
- .add(PROBE_DEPTH_HISTORY_RESOURCE)
83
- .add(PROBE_DEPTH_SAMPLER_RESOURCE);
58
+ .add(PROBE_RAYS_WRITE_RESOURCE);
84
59
 
85
60
  resources.createGroup()
86
61
  .add(BRICK_LEVELS_RESOURCE)
@@ -93,10 +68,10 @@ resources.createGroup()
93
68
  .add(WORLD_CLUSTER_DATA_RESOURCE);
94
69
 
95
70
  /**
96
- * The light a front-face hit takes from beyond the trace (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.7): a
71
+ * The light a front-face hit takes from the local lights (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.7): a
97
72
  * thread a ray, after shade through the same launch, `PROBE_DISPATCH_RAYS`, its probe the one trace wrote
98
- * into its flags. It adds ρ_d·(E_loc + E_ind)/π to the radiance shade left, ρ_d being the albedo shade
99
- * left in the ray's \`row\`.
73
+ * into its flags. It adds ρ_d·E_loc/π to the radiance shade left, ρ_d being the albedo shade left in the
74
+ * ray's \`row\`; the next bounce, E_ind, is the bounce pass's, after it (`shader_probe_clipmap_bounce`).
100
75
  *
101
76
  * - **E_loc, the local lights**: one of the point and spot lights of the hit's cell of the world light
102
77
  * clusters, built over the bricks' cascades so that every hit has one, at most
@@ -113,16 +88,10 @@ resources.createGroup()
113
88
  * a voxel, whichever is more, for the expand at that end. It sees the light if it misses; a hit, or a
114
89
  * march that spends its steps, is no light. A light that casts no shadow traces none.
115
90
  * - The pick and the point are drawn from the ray's slot and direction, fresh every update.
116
- * - **E_ind, the next bounce**: this mode's own diffuse at the hit, `probe_clipmap_sample_sh` from the
117
- * hit along its normal, the view back along the ray, with the ray's own jitter as the pick's noise.
118
- * The projection writes the records later in the frame, so they hold last frame's SH: each frame takes
119
- * one more bounce.
120
- * - Where no probe weighs anything the bounce is **zero**, not the environment: a hit behind the camera
121
- * in a cave must not bring daylight in. The next frame's hits' wants ask for the probes it read
122
- * (`shader_probe_clipmap_want_hits`), so the bounce has them a frame or two later.
123
- * - LPV's 0.97 a bounce is dropped: an albedo under one bounds the series already.
124
91
  *
125
- * Its own pass because shade binds nine of a stage's ten storage buffers, and the pick takes two more.
92
+ * Its own pass because shade binds nine of a stage's ten storage buffers; apart from the bounce because the
93
+ * two together would bind twelve storage buffers, and a shadow march is another cost than probe taps
94
+ * (WORLD_PROBE_CACHE_SCOPE_2026_11_01.md §1.5).
126
95
  *
127
96
  * @type {ComputeShader}
128
97
  */
@@ -255,16 +224,8 @@ fn main(
255
224
  return;
256
225
  }
257
226
 
258
- // the probe's update's rays, and this one's place among them
259
227
  let k = record.flags >> PROBE_RAY_PROBE_SHIFT;
260
- let span = probe_clipmap_probe_rays(k);
261
- let rays = span.y;
262
- let i = ray - span.x;
263
-
264
228
  let slot = probe_trace.elements[k];
265
- let n = settings.radiance_resolution;
266
- let updates = probe_state_updates(probe_states[slot].x);
267
- let texel = probe_clipmap_ray_texel(i, updates, rays, n * n);
268
229
 
269
230
  let direction = uv_octahedral_unit_decode(unpack2x16unorm(record.direction));
270
231
  let position = probe_clipmap_ray_origin(probe_origins[k], slot, record.direction) + record.t * direction;
@@ -274,14 +235,8 @@ fn main(
274
235
  let hash = pcg4d(vec4<u32>(slot, record.direction, 0xA54FF53Au, 0u));
275
236
  let random = vec4<f32>(hash_to_float01(hash.x), hash_to_float01(hash.y), hash_to_float01(hash.z), hash_to_float01(hash.w));
276
237
 
277
- // E/π: the local lights', then the next bounce's, which the resolve gives as E/π
278
- var e = probe_clipmap_local_irradiance((record.flags >> PROBE_RAY_CASCADE_SHIFT) & PROBE_RAY_CASCADE_MASK, position, normal, random) * RECIPROCAL_PI;
279
-
280
- let probes = probe_clipmap_sample_sh(position, normal, -direction, probe_clipmap_ray_jitter(slot, texel, i, updates, rays, n));
281
-
282
- if (probes.found) {
283
- e += resolve_irradiance_sh_to_diffuse(probes.sh.Y, probes.sh.CoCg, normal);
284
- }
238
+ // E/π of the local lights
239
+ let e = probe_clipmap_local_irradiance((record.flags >> PROBE_RAY_CASCADE_SHIFT) & PROBE_RAY_CASCADE_MASK, position, normal, random) * RECIPROCAL_PI;
285
240
 
286
241
  if (all(e == vec3<f32>(0.0))) {
287
242
  return;
@@ -291,14 +246,9 @@ fn main(
291
246
  }
292
247
  `, [
293
248
  chunk_probe_clipmap,
294
- chunk_probe_clipmap_ray_layout,
295
- chunk_probe_clipmap_ray_texel,
296
- chunk_probe_clipmap_ray_jitter,
297
249
  chunk_probe_clipmap_ray_origin,
298
250
  chunk_folded_workgroup_index,
299
251
  chunk_uv_octahedral_unit_decode,
300
- chunk_probe_clipmap_pick,
301
- chunk_resolve_irradiance_sh_to_diffuse,
302
252
  RECIPROCAL_PI_DECLARATION,
303
253
  chunk_world_light_cluster_lookup_at,
304
254
  chunk_light_cluster_counts,
@@ -1 +1 @@
1
- {"version":3,"file":"shader_probe_clipmap_order.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.js"],"names":[],"mappings":"AAeA;;GAEG;AACH,mCAFU,YAAY,CASG;AAWzB;;;;;;;;;;;;;;GAcG;AACH,yCAFU,aAAa,CA4DpB;6BArG0B,sCAAsC;8BAHrC,kCAAkC"}
1
+ {"version":3,"file":"shader_probe_clipmap_order.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.js"],"names":[],"mappings":"AAoBA;;GAEG;AACH,mCAFU,YAAY,CASG;AAWzB;;;;;;;;;;;;;;GAcG;AACH,yCAFU,aAAa,CA4DpB;6BAzG0B,sCAAsC;8BAHrC,kCAAkC"}
@@ -1,3 +1,4 @@
1
+ import { assert } from "../../../../../core/assert.js";
1
2
  import { chunk_sort_bitonic_workgroup } from "../../../gpu_primitive/sort/chunk_sort_bitonic_workgroup.js";
2
3
  import { SORT_KEYS_PER_THREAD, SORT_TILE_SIZE, SORT_WORKGROUP_SIZE } from "../../../gpu_primitive/sort/defs.js";
3
4
  import { chunk_v3_morton_encode } from "../../../shader/chunk/bvh/morton/chunk_v3_morton_encode.js";
@@ -7,8 +8,12 @@ import { ComputeShader } from "../../../shader/ComputeShader.js";
7
8
  import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
8
9
  import { u32 } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
9
10
  import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
10
- import { assert } from "../../../../../core/assert.js";
11
- import { chunk_probe_clipmap, PROBE_LEVELS_RESOURCE, PROBE_RECORDS_READ_RESOURCE, PROBE_TRACE_ORDER_RESOURCE } from "./chunk_probe_clipmap.js";
11
+ import {
12
+ chunk_probe_clipmap,
13
+ PROBE_LEVELS_RESOURCE,
14
+ PROBE_RECORDS_READ_RESOURCE,
15
+ PROBE_TRACE_ORDER_RESOURCE
16
+ } from "./chunk_probe_clipmap.js";
12
17
  import { PROBE_ORDER_RUN } from "./PROBE_CLIPMAP.js";
13
18
 
14
19
  assert.equal(PROBE_ORDER_RUN, SORT_TILE_SIZE, 'PROBE_ORDER_RUN is a tile of the bitonic sort');
@@ -16,7 +16,7 @@ export const shader_probe_clipmap_project_rows: ComputeShader;
16
16
  /**
17
17
  * Projection, probes (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.4, §8.8): a thread a listed probe,
18
18
  * dispatched through `PROBE_DISPATCH_TRACED`. It sums its rows into its record's SH, and classifies it
19
- * by the update's resolved rays: dead past a quarter of back faces, else alive, its update counted and
19
+ * by the update's resolved rays: dead when every one hit a back face, else alive, its update counted and
20
20
  * its time the frame's. An update with no resolved ray keeps the probe's kind.
21
21
  *
22
22
  * Only uniform rays classify. Those are a uniform update's, and a guided update's whose guide weighs
@@ -32,9 +32,9 @@ export const shader_probe_clipmap_project_rows: ComputeShader;
32
32
  * texel's own noise (measured: the estimator's inconsistency barely moves on a doubling); a sum of the
33
33
  * falls unbounded is one bright sample's.
34
34
  * - The score is held to the probe's own: moved means past `PROBE_CHANGE_SIGNIFICANCE` of its running
35
- * deviation, at least one, from its running mean, both over the estimator's variance window (2τ). A
36
- * probe whose means sit off its samples (the estimator's own bias on texels lit by few rays) scores
37
- * steadily off zero.
35
+ * deviation, at least one, from its running mean, both over the estimator's variance window,
36
+ * `PROBE_VARIANCE_BLEND` an update however long since the last. A probe whose means sit off its samples
37
+ * (the estimator's own bias on texels lit by few rays) scores steadily off zero.
38
38
  * - Measured, Sponza on the 4090, the camera and the light still, 3,600 frames settled: of the probes
39
39
  * past 64 updates, 4.2% asked for the most against a sum of the raw falls held to zero, 3.2% with each
40
40
  * texel's fall bounded, and 1.1–1.3% held to their own statistics.
@@ -1 +1 @@
1
- {"version":3,"file":"shader_probe_clipmap_project.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.js"],"names":[],"mappings":"AAyBA;;GAEG;AACH,qCAFU,YAAY,CAqBK;AAW3B;;;;;;;;;GASG;AACH,gDAFU,aAAa,CAuDpB;AAcH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,2CAFU,aAAa,CA8FpB;6BAxP0B,sCAAsC;8BAHrC,kCAAkC"}
1
+ {"version":3,"file":"shader_probe_clipmap_project.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.js"],"names":[],"mappings":"AAoCA;;GAEG;AACH,qCAFU,YAAY,CAmBK;AAW3B;;;;;;;;;GASG;AACH,gDAFU,aAAa,CAuDpB;AAcH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,2CAFU,aAAa,CA4FpB;6BAzP0B,sCAAsC;8BAHrC,kCAAkC"}
@@ -1,11 +1,17 @@
1
- import { chunk_octahedral_solid_angle } from "../../../shader/chunk/geometry/octahedron/chunk_octahedral_solid_angle.js";
2
- import { chunk_uv_octahedral_unit_decode } from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
1
+ import {
2
+ chunk_octahedral_solid_angle
3
+ } from "../../../shader/chunk/geometry/octahedron/chunk_octahedral_solid_angle.js";
4
+ import {
5
+ chunk_uv_octahedral_unit_decode
6
+ } from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
3
7
  import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
4
- import { chunk_convert_to_irradiance_sh } from "../../../shader/chunk/spherical_harmonics/l1i/chunk_convert_to_irradiance_sh.js";
8
+ import {
9
+ chunk_convert_to_irradiance_sh
10
+ } from "../../../shader/chunk/spherical_harmonics/l1i/chunk_convert_to_irradiance_sh.js";
5
11
  import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
6
12
  import { ComputeShader } from "../../../shader/ComputeShader.js";
7
13
  import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
8
- import { f32, u32 } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
14
+ import { u32 } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
9
15
  import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
10
16
  import {
11
17
  chunk_probe_clipmap,
@@ -21,7 +27,12 @@ import {
21
27
  PROBE_STATES_STORE_RESOURCE,
22
28
  PROBE_TRACE_READ_RESOURCE
23
29
  } from "./chunk_probe_clipmap.js";
24
- import { PROBE_CHANGE_SIGNIFICANCE, PROBE_DEAD_BACK_FACE_SHARE, PROBE_RADIANCE_SAMPLES_LIMIT, PROBE_THREAD_WORKGROUP_SIZE } from "./PROBE_CLIPMAP.js";
30
+ import {
31
+ PROBE_CHANGE_SIGNIFICANCE,
32
+ PROBE_RADIANCE_SAMPLES_LIMIT,
33
+ PROBE_THREAD_WORKGROUP_SIZE,
34
+ PROBE_VARIANCE_BLEND
35
+ } from "./PROBE_CLIPMAP.js";
25
36
 
26
37
  /**
27
38
  * @type {WebGPUStruct}
@@ -39,12 +50,10 @@ export const PROBE_PROJECT_SETTINGS = WebGPUStruct.from({
39
50
  frame: u32,
40
51
  /** updates between a probe's uniform ones, `PROBE_UNIFORM_PERIOD` */
41
52
  uniform_period: u32,
42
- /** the fewest rays an update casts, `PROBE_RAYS_PER_TEXEL_MIN` of the texels */
53
+ /** the fewest rays a guided update casts, `PROBE_RAYS_PER_TEXEL_MIN` of the texels */
43
54
  rays_min: u32,
44
55
  /** the most rays an update casts, `PROBE_RAYS_PER_TEXEL_MAX` of the texels */
45
56
  rays_max: u32,
46
- /** the radiance's short mean's response, τ, in frames: the change score's statistics follow it */
47
- response_frames: f32,
48
57
  }, "ProbeProjectSettings");
49
58
 
50
59
  const row_resources = new ShaderResourceSetDescriptor();
@@ -136,7 +145,7 @@ probe_resources.createGroup()
136
145
  /**
137
146
  * Projection, probes (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.4, §8.8): a thread a listed probe,
138
147
  * dispatched through `PROBE_DISPATCH_TRACED`. It sums its rows into its record's SH, and classifies it
139
- * by the update's resolved rays: dead past a quarter of back faces, else alive, its update counted and
148
+ * by the update's resolved rays: dead when every one hit a back face, else alive, its update counted and
140
149
  * its time the frame's. An update with no resolved ray keeps the probe's kind.
141
150
  *
142
151
  * Only uniform rays classify. Those are a uniform update's, and a guided update's whose guide weighs
@@ -152,9 +161,9 @@ probe_resources.createGroup()
152
161
  * texel's own noise (measured: the estimator's inconsistency barely moves on a doubling); a sum of the
153
162
  * falls unbounded is one bright sample's.
154
163
  * - The score is held to the probe's own: moved means past `PROBE_CHANGE_SIGNIFICANCE` of its running
155
- * deviation, at least one, from its running mean, both over the estimator's variance window (2τ). A
156
- * probe whose means sit off its samples (the estimator's own bias on texels lit by few rays) scores
157
- * steadily off zero.
164
+ * deviation, at least one, from its running mean, both over the estimator's variance window,
165
+ * `PROBE_VARIANCE_BLEND` an update however long since the last. A probe whose means sit off its samples
166
+ * (the estimator's own bias on texels lit by few rays) scores steadily off zero.
158
167
  * - Measured, Sponza on the 4090, the camera and the light still, 3,600 frames settled: of the probes
159
168
  * past 64 updates, 4.2% asked for the most against a sum of the raw falls held to zero, 3.2% with each
160
169
  * texel's fall bounded, and 1.1–1.3% held to their own statistics.
@@ -208,13 +217,11 @@ fn main(
208
217
  if (sum.resolved > 0u && uniform) {
209
218
  let share = f32(sum.back_faces) / f32(sum.resolved);
210
219
 
211
- kind = select(PROBE_STATE_ALIVE, PROBE_STATE_DEAD, share > ${PROBE_DEAD_BACK_FACE_SHARE});
220
+ kind = select(PROBE_STATE_ALIVE, PROBE_STATE_DEAD, sum.back_faces == sum.resolved);
212
221
 
213
- probe_records[slot].flags = (probe_records[slot].flags & 0xFFFF0000u) | probe_record_flags(share, false, 0u);
222
+ probe_records[slot].flags = (probe_records[slot].flags & 0xFFFF0000u) | probe_record_flags(share, 0u);
214
223
  }
215
224
 
216
- let elapsed = f32(settings.frame - probe_records[slot].traced_frame);
217
-
218
225
  probe_states[slot].x = probe_state(kind, updates + 1u);
219
226
  probe_records[slot].sh = probe_record_sh_encode(sum.sh);
220
227
  probe_records[slot].traced_frame = settings.frame;
@@ -234,7 +241,7 @@ fn main(
234
241
  // window; a score past their reach counts at it, so a change in the light does not become the probe's
235
242
  // own spread, while a lasting shift of its own still does within a few windows
236
243
  let held = clamp(score, request.change_mean - reach, request.change_mean + reach);
237
- let blend = max(1.0 / f32(request.changes + 1u), 1.0 - exp(-0.5 * elapsed / settings.response_frames));
244
+ let blend = max(1.0 / f32(request.changes + 1u), ${PROBE_VARIANCE_BLEND});
238
245
  let mean = mix(request.change_mean, held, blend);
239
246
 
240
247
  request.change_variance = mix(request.change_variance, (held - request.change_mean) * (held - mean), blend);
@@ -4,11 +4,13 @@
4
4
  export const PROBE_PUBLISH_SETTINGS: WebGPUStruct;
5
5
  /**
6
6
  * Publish (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.8): a thread a texel of each listed probe's two
7
- * tiles, the radiance tile's (n_r + 2)² then the depth tile's (n_d + 2)², dispatched through
8
- * `PROBE_DISPATCH_PUBLISH`. A tile is its map with a one-texel skirt, each skirt texel the interior texel
9
- * the octahedral fold puts next to it, so a reader's bilinear tap across the edge reads what a wrap would
10
- * (`texture_octahedral_skirt_uv`). Every texel is written from the probe's maps, which accumulation
11
- * wrote whole: the atlases are only ever stored into here.
7
+ * tiles, the radiance tile's (n_r + 2s)² then the depth tile's (n_d + 2)², dispatched through
8
+ * `PROBE_DISPATCH_PUBLISH`. A tile is its map with a skirt of s texels, one for the depth and
9
+ * `radiance_skirt` for the radiance, each skirt texel the interior texel the octahedral fold puts next to it,
10
+ * so a reader's bilinear tap across the edge reads what a wrap would (`texture_octahedral_skirt_uv`). A
11
+ * clipmap whose radiance is never sampled, only loaded texel by texel, has none there
12
+ * (WORLD_PROBE_CACHE_SCOPE_2026_11_01.md §1.8). Every texel is written from the probe's maps, which
13
+ * accumulation wrote whole: the atlases are only ever stored into here.
12
14
  *
13
15
  * @type {ComputeShader}
14
16
  */
@@ -1 +1 @@
1
- {"version":3,"file":"shader_probe_clipmap_publish.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_publish.js"],"names":[],"mappings":"AAiBA;;GAEG;AACH,qCAFU,YAAY,CAaK;AAY3B;;;;;;;;;GASG;AACH,2CAFU,aAAa,CAqDpB;6BAjG0B,sCAAsC;8BAHrC,kCAAkC"}
1
+ {"version":3,"file":"shader_probe_clipmap_publish.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_publish.js"],"names":[],"mappings":"AAmBA;;GAEG;AACH,qCAFU,YAAY,CAeK;AAY3B;;;;;;;;;;;GAWG;AACH,2CAFU,aAAa,CAuDpB;6BAvG0B,sCAAsC;8BAHrC,kCAAkC"}