@woosh/meep-engine 3.60.6 → 3.60.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (328) hide show
  1. package/build/bundle-worker-terrain.js +1 -1
  2. package/package.json +1 -1
  3. package/src/core/binary/BitSet.d.ts.map +1 -1
  4. package/src/core/binary/BitSet.js +2 -1
  5. package/src/{format/image/avif/av1/util → core/binary/operations}/ceil_log2.d.ts +2 -2
  6. package/src/core/binary/operations/ceil_log2.d.ts.map +1 -0
  7. package/src/{format/image/avif/av1/util → core/binary/operations}/ceil_log2.js +18 -18
  8. package/src/core/binary/zstd/ZstdReverseBitReader.d.ts.map +1 -1
  9. package/src/core/binary/zstd/ZstdReverseBitReader.js +225 -223
  10. package/src/core/binary/zstd/zstd_fse.d.ts.map +1 -1
  11. package/src/core/binary/zstd/zstd_fse.js +267 -265
  12. package/src/core/binary/zstd/zstd_huffman.d.ts.map +1 -1
  13. package/src/core/binary/zstd/zstd_huffman.js +246 -244
  14. package/src/core/bvh2/binary/2/BinaryUint32BVH.d.ts.map +1 -1
  15. package/src/core/bvh2/binary/2/BinaryUint32BVH.js +8 -2
  16. package/src/core/bvh2/bvh3/ebvh_optimize_treelet.d.ts.map +1 -1
  17. package/src/core/bvh2/bvh3/ebvh_optimize_treelet.js +8 -7
  18. package/src/core/collection/PairUint32Map.d.ts.map +1 -1
  19. package/src/core/collection/PairUint32Map.js +2 -2
  20. package/src/core/collection/Uint32Map.d.ts.map +1 -1
  21. package/src/core/collection/Uint32Map.js +2 -4
  22. package/src/core/collection/heap/FibonacciHeap.d.ts.map +1 -1
  23. package/src/core/collection/heap/FibonacciHeap.js +2 -1
  24. package/src/core/geom/2d/r-tree/StaticR2Tree.d.ts.map +1 -1
  25. package/src/core/geom/2d/r-tree/StaticR2Tree.js +8 -2
  26. package/src/core/geom/3d/shape/util/mesh_compute_triangle_edge_flags.d.ts.map +1 -1
  27. package/src/core/geom/3d/shape/util/mesh_compute_triangle_edge_flags.js +2 -3
  28. package/src/engine/graphics/texture/atlas/TextureAtlas.d.ts.map +1 -1
  29. package/src/engine/graphics/texture/atlas/TextureAtlas.js +13 -14
  30. package/src/engine/graphics/texture/atlas/sprite_atlas_border.d.ts.map +1 -1
  31. package/src/engine/graphics/texture/atlas/sprite_atlas_border.js +70 -69
  32. package/src/engine/graphics/texture/reflection/convolve_equirectangular_reflection.d.ts.map +1 -1
  33. package/src/engine/graphics/texture/reflection/convolve_equirectangular_reflection.js +2 -1
  34. package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts.map +1 -1
  35. package/src/engine/graphics3/GPUParticleEmitterSystem.js +2 -1
  36. package/src/engine/graphics3/decal/GPUDecalRenderer.d.ts.map +1 -1
  37. package/src/engine/graphics3/decal/GPUDecalRenderer.js +2 -1
  38. package/src/engine/graphics3/decal/chunk_decal_record.d.ts +14 -0
  39. package/src/engine/graphics3/decal/chunk_decal_record.d.ts.map +1 -0
  40. package/src/engine/graphics3/decal/chunk_decal_record.js +44 -0
  41. package/src/engine/graphics3/decal/shader_cluster_assign_decals.d.ts.map +1 -1
  42. package/src/engine/graphics3/decal/shader_cluster_assign_decals.js +2 -15
  43. package/src/engine/graphics3/decal/shader_cull_decals_frustum.d.ts.map +1 -1
  44. package/src/engine/graphics3/decal/shader_cull_decals_frustum.js +3 -16
  45. package/src/engine/graphics3/decal/shader_decal_composite.d.ts.map +1 -1
  46. package/src/engine/graphics3/decal/shader_decal_composite.js +3 -23
  47. package/src/engine/graphics3/terrain/TERRAIN_MATERIAL_TEMPLATE.d.ts.map +1 -1
  48. package/src/engine/graphics3/terrain/TERRAIN_MATERIAL_TEMPLATE.js +2 -1
  49. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  50. package/src/engine/physics/queries/shape_cast.js +2 -2
  51. package/src/format/image/avif/av1/decode/decode_palette.js +442 -442
  52. package/src/format/image/avif/av1/entropy/SymbolWriter.d.ts.map +1 -1
  53. package/src/format/image/avif/av1/entropy/SymbolWriter.js +2 -1
  54. package/src/generation/foliage/material/foliage_tile.d.ts.map +1 -1
  55. package/src/generation/foliage/material/foliage_tile.js +2 -1
  56. package/src/generation/markers/GridActionRuleSet.d.ts.map +1 -1
  57. package/src/generation/markers/GridActionRuleSet.js +12 -3
  58. package/src/shade/device/mock/SoftwareGPUDevice.d.ts.map +1 -1
  59. package/src/shade/device/mock/SoftwareGPUDevice.js +6 -13
  60. package/src/shade/playground/caldera/main.js +3 -2
  61. package/src/shade/playground/probe_clipmap/README.md +2 -1
  62. package/src/shade/playground/probe_clipmap/index.html +7 -2
  63. package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -1
  64. package/src/shade/playground/probe_clipmap/main.js +17 -7
  65. package/src/shade/playground/sh_exponential/sh_exp_playground_shaders.d.ts.map +1 -1
  66. package/src/shade/playground/sh_exponential/sh_exp_playground_shaders.js +7 -13
  67. package/src/shade/playground/vgeo_scene/main.js +2 -1
  68. package/src/shade/playground/vsm/VSMDebugOverlay.d.ts.map +1 -1
  69. package/src/shade/playground/vsm/VSMDebugOverlay.js +3 -1
  70. package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
  71. package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
  72. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +6 -6
  73. package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
  74. package/src/shade/renderer/fluid/pressure/shader_fluid_mg_coarsest.d.ts.map +1 -1
  75. package/src/shade/renderer/fluid/pressure/shader_fluid_mg_coarsest.js +5 -4
  76. package/src/shade/renderer/fluid/pressure/shader_fluid_mg_residual_restrict.d.ts.map +1 -1
  77. package/src/shade/renderer/fluid/pressure/shader_fluid_mg_residual_restrict.js +168 -166
  78. package/src/shade/renderer/fluid/pressure/shader_fluid_mg_smooth.d.ts.map +1 -1
  79. package/src/shade/renderer/fluid/pressure/shader_fluid_mg_smooth.js +221 -219
  80. package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
  81. package/src/shade/renderer/fow/shader_fog_of_war.d.ts.map +1 -1
  82. package/src/shade/renderer/fow/shader_fog_of_war.js +8 -19
  83. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts.map +1 -1
  84. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +6 -6
  85. package/src/shade/renderer/geometry/sdf/MeshSDFLayout.d.ts.map +1 -1
  86. package/src/shade/renderer/geometry/sdf/MeshSDFLayout.js +2 -1
  87. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts.map +1 -1
  88. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.js +2 -1
  89. package/src/shade/renderer/geometry/virtual/runtime/VGeoResidency.d.ts.map +1 -1
  90. package/src/shade/renderer/geometry/virtual/runtime/VGeoResidency.js +2 -1
  91. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_decode_from_storage.d.ts.map +1 -1
  92. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_decode_from_storage.js +10 -31
  93. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_encode_to_storage.d.ts.map +1 -1
  94. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_encode_to_storage.js +9 -15
  95. package/src/shade/renderer/global_illumination/clipmap/shader_debug_clipmap.d.ts +2 -1
  96. package/src/shade/renderer/global_illumination/clipmap/shader_debug_clipmap.d.ts.map +1 -1
  97. package/src/shade/renderer/global_illumination/clipmap/shader_debug_clipmap.js +6 -5
  98. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.d.ts.map +1 -1
  99. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.js +2 -1
  100. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +15 -3
  101. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
  102. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +168 -18
  103. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +98 -57
  104. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
  105. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +168 -77
  106. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts +4 -2
  107. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts.map +1 -1
  108. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.js +27 -12
  109. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.d.ts.map +1 -1
  110. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.js +12 -7
  111. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts.map +1 -1
  112. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +8 -2
  113. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.d.ts.map +1 -1
  114. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.js +5 -2
  115. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.js +1 -1
  116. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.d.ts.map +1 -1
  117. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.js +5 -3
  118. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.js +1 -1
  119. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_free.d.ts.map +1 -1
  120. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_free.js +1 -1
  121. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_movers_command.d.ts.map +1 -1
  122. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_movers_command.js +4 -2
  123. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_scroll.d.ts.map +1 -1
  124. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_scroll.js +1 -1
  125. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_store.d.ts.map +1 -1
  126. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_store.js +1 -1
  127. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_take.d.ts.map +1 -1
  128. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_take.js +3 -1
  129. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_cards.js +2 -2
  130. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts +114 -41
  131. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts.map +1 -1
  132. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js +424 -207
  133. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts +34 -25
  134. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts.map +1 -1
  135. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.js +41 -31
  136. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_RESAMPLING.d.ts +7 -5
  137. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_RESAMPLING.d.ts.map +1 -1
  138. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_RESAMPLING.js +7 -5
  139. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.d.ts +47 -0
  140. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.d.ts.map +1 -0
  141. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.js +84 -0
  142. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts +48 -0
  143. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts.map +1 -0
  144. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.js +101 -0
  145. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts +58 -4
  146. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts.map +1 -1
  147. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.js +127 -30
  148. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_cage.d.ts +18 -7
  149. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_cage.d.ts.map +1 -1
  150. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_cage.js +39 -13
  151. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.d.ts +29 -8
  152. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.d.ts.map +1 -1
  153. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.js +112 -56
  154. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_resample.d.ts +19 -0
  155. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_resample.d.ts.map +1 -0
  156. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_resample.js +35 -0
  157. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.d.ts.map +1 -1
  158. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.js +9 -3
  159. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.d.ts +3 -3
  160. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.js +5 -5
  161. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts +8 -12
  162. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts.map +1 -1
  163. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.js +23 -56
  164. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.d.ts +0 -3
  165. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.d.ts.map +1 -1
  166. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.js +11 -15
  167. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.d.ts +26 -0
  168. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.d.ts.map +1 -0
  169. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.js +173 -0
  170. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.d.ts +32 -0
  171. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.d.ts.map +1 -0
  172. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.js +166 -0
  173. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.d.ts +3 -4
  174. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.d.ts.map +1 -1
  175. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.js +3 -4
  176. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.d.ts.map +1 -1
  177. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.js +3 -1
  178. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts +6 -12
  179. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts.map +1 -1
  180. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.js +15 -65
  181. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.d.ts.map +1 -1
  182. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.js +7 -2
  183. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts +4 -4
  184. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts.map +1 -1
  185. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.js +24 -17
  186. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_publish.d.ts +7 -5
  187. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_publish.d.ts.map +1 -1
  188. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_publish.js +18 -10
  189. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.d.ts +2 -2
  190. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.d.ts.map +1 -1
  191. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.js +9 -5
  192. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_relocate.d.ts +3 -0
  193. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_relocate.d.ts.map +1 -1
  194. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_relocate.js +9 -6
  195. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample.d.ts +1 -1
  196. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample.d.ts.map +1 -1
  197. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample.js +16 -16
  198. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample_rays.d.ts +36 -0
  199. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample_rays.d.ts.map +1 -0
  200. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample_rays.js +233 -0
  201. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.d.ts.map +1 -1
  202. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.js +7 -5
  203. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.d.ts.map +1 -1
  204. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.js +5 -3
  205. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts.map +1 -1
  206. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.js +10 -4
  207. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.d.ts +2 -1
  208. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.d.ts.map +1 -1
  209. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.js +12 -6
  210. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.d.ts +1 -2
  211. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.d.ts.map +1 -1
  212. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.js +5 -6
  213. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.d.ts +14 -18
  214. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.d.ts.map +1 -1
  215. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.js +25 -35
  216. package/src/shade/renderer/gpu_primitive/WEBGPU_GUARANTEED_MAX_UNIFORM_BUFFER_BINDING_SIZE.d.ts +13 -0
  217. package/src/shade/renderer/gpu_primitive/WEBGPU_GUARANTEED_MAX_UNIFORM_BUFFER_BINDING_SIZE.d.ts.map +1 -0
  218. package/src/shade/renderer/gpu_primitive/WEBGPU_GUARANTEED_MAX_UNIFORM_BUFFER_BINDING_SIZE.js +12 -0
  219. package/src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.d.ts +27 -2
  220. package/src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.d.ts.map +1 -1
  221. package/src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.js +62 -6
  222. package/src/shade/renderer/gpu_primitive/indirect/IndirectComputeCommandBuildPass.d.ts.map +1 -1
  223. package/src/shade/renderer/gpu_primitive/indirect/IndirectComputeCommandBuildPass.js +10 -19
  224. package/src/shade/renderer/gpu_primitive/indirect/chunk_folded_dispatch.d.ts.map +1 -1
  225. package/src/shade/renderer/gpu_primitive/indirect/chunk_folded_dispatch.js +6 -3
  226. package/src/shade/renderer/hiz/hzb_pick_alignment.d.ts.map +1 -1
  227. package/src/shade/renderer/hiz/hzb_pick_alignment.js +149 -148
  228. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_environment_cells.d.ts.map +1 -1
  229. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_environment_cells.js +4 -2
  230. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_log_floor.d.ts.map +1 -1
  231. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_log_floor.js +6 -5
  232. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_project.d.ts.map +1 -1
  233. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_project.js +3 -1
  234. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_reference_reflectance.d.ts.map +1 -1
  235. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_reference_reflectance.js +3 -1
  236. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_solve.d.ts.map +1 -1
  237. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_solve.js +3 -1
  238. package/src/shade/renderer/light/world_cluster/WORLD_LIGHT_CLUSTER.d.ts +0 -5
  239. package/src/shade/renderer/light/world_cluster/WORLD_LIGHT_CLUSTER.d.ts.map +1 -1
  240. package/src/shade/renderer/light/world_cluster/WORLD_LIGHT_CLUSTER.js +0 -7
  241. package/src/shade/renderer/light/world_cluster/graph_build_world_light_clusters.d.ts +15 -2
  242. package/src/shade/renderer/light/world_cluster/graph_build_world_light_clusters.d.ts.map +1 -1
  243. package/src/shade/renderer/light/world_cluster/graph_build_world_light_clusters.js +51 -16
  244. package/src/shade/renderer/light/world_cluster/shader_world_cluster_assign_lights.d.ts.map +1 -1
  245. package/src/shade/renderer/light/world_cluster/shader_world_cluster_assign_lights.js +3 -2
  246. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  247. package/src/shade/renderer/postprocess/dof/raymarch/chunk_dof_lds_coc_cache.d.ts +17 -0
  248. package/src/shade/renderer/postprocess/dof/raymarch/chunk_dof_lds_coc_cache.d.ts.map +1 -0
  249. package/src/shade/renderer/postprocess/dof/raymarch/chunk_dof_lds_coc_cache.js +81 -0
  250. package/src/shade/renderer/postprocess/dof/raymarch/shader_dof_raymarch_compute.d.ts.map +1 -1
  251. package/src/shade/renderer/postprocess/dof/raymarch/shader_dof_raymarch_compute.js +5 -48
  252. package/src/shade/renderer/postprocess/dof/raymarch/shader_dof_slice_compute.d.ts.map +1 -1
  253. package/src/shade/renderer/postprocess/dof/raymarch/shader_dof_slice_compute.js +4 -44
  254. package/src/shade/renderer/postprocess/gtao/chunk_integrate_lighting_sample.d.ts.map +1 -1
  255. package/src/shade/renderer/postprocess/gtao/chunk_integrate_lighting_sample.js +4 -1
  256. package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao_with_irradiance.d.ts.map +1 -1
  257. package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao_with_irradiance.js +8 -7
  258. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  259. package/src/shade/renderer/postprocess/nss/chunk_nss_luma_derivative.d.ts.map +1 -1
  260. package/src/shade/renderer/postprocess/nss/chunk_nss_luma_derivative.js +5 -7
  261. package/src/shade/renderer/postprocess/nss/chunk_nss_tonemap.d.ts +17 -0
  262. package/src/shade/renderer/postprocess/nss/chunk_nss_tonemap.d.ts.map +1 -0
  263. package/src/shade/renderer/postprocess/nss/chunk_nss_tonemap.js +56 -0
  264. package/src/shade/renderer/postprocess/nss/shader_nss_postprocess.d.ts.map +1 -1
  265. package/src/shade/renderer/postprocess/nss/shader_nss_postprocess.js +2 -22
  266. package/src/shade/renderer/postprocess/nss/shader_nss_preprocess.d.ts.map +1 -1
  267. package/src/shade/renderer/postprocess/nss/shader_nss_preprocess.js +2 -13
  268. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
  269. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +10 -13
  270. package/src/shade/renderer/rasterize/expand/bucket/RASTERIZATION_BUCKET_LIMIT.d.ts.map +1 -1
  271. package/src/shade/renderer/rasterize/expand/bucket/RASTERIZATION_BUCKET_LIMIT.js +39 -38
  272. package/src/shade/renderer/rasterize/expand/mesh/shader_prefix_sum_to_command.d.ts.map +1 -1
  273. package/src/shade/renderer/rasterize/expand/mesh/shader_prefix_sum_to_command.js +7 -12
  274. package/src/shade/renderer/shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.d.ts +8 -6
  275. package/src/shade/renderer/shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.d.ts.map +1 -1
  276. package/src/shade/renderer/shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.js +10 -7
  277. package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_key.d.ts +16 -0
  278. package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_key.d.ts.map +1 -0
  279. package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_key.js +35 -0
  280. package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_select_finest.d.ts +5 -2
  281. package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_select_finest.d.ts.map +1 -1
  282. package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_select_finest.js +27 -18
  283. package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh2_color_get_irradiance_at.d.ts.map +1 -1
  284. package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh2_color_get_irradiance_at.js +5 -15
  285. package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh3_convolve_with_cosine_kernel.d.ts.map +1 -1
  286. package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh3_convolve_with_cosine_kernel.js +5 -19
  287. package/src/shade/renderer/shader/chunk/spherical_harmonics/dering/chunk_sh3_windowing.d.ts.map +1 -1
  288. package/src/shade/renderer/shader/chunk/spherical_harmonics/dering/chunk_sh3_windowing.js +3 -22
  289. package/src/shade/renderer/shadow/map/ShadowmapDrawSelector.d.ts.map +1 -1
  290. package/src/shade/renderer/shadow/map/ShadowmapDrawSelector.js +2 -1
  291. package/src/shade/renderer/volumetrics/chunk_volumetrics_sun_shadow_group_list.d.ts.map +1 -1
  292. package/src/shade/renderer/volumetrics/chunk_volumetrics_sun_shadow_group_list.js +154 -152
  293. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts.map +1 -1
  294. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.js +2 -1
  295. package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP.d.ts +3 -1
  296. package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP.d.ts.map +1 -1
  297. package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP.js +4 -3
  298. package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP_STRUCT.d.ts +7 -1
  299. package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP_STRUCT.d.ts.map +1 -1
  300. package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP_STRUCT.js +54 -47
  301. package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_sample.d.ts.map +1 -1
  302. package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_sample.js +371 -370
  303. package/src/shade/renderer/water/GPUWaterRenderer.d.ts.map +1 -1
  304. package/src/shade/renderer/water/GPUWaterRenderer.js +2 -1
  305. package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
  306. package/src/shade/renderer/water/surface/lod/shader_water_lod.d.ts.map +1 -1
  307. package/src/shade/renderer/water/surface/lod/shader_water_lod.js +12 -14
  308. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -1
  309. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +2 -9
  310. package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts.map +1 -1
  311. package/src/shade/renderer/water/surface/particles/chunk_water_particle.js +2 -1
  312. package/src/shade/renderer/wind/WIND_FIELD.d.ts +3 -1
  313. package/src/shade/renderer/wind/WIND_FIELD.d.ts.map +1 -1
  314. package/src/shade/renderer/wind/WIND_FIELD.js +4 -3
  315. package/src/shade/renderer/wind/WIND_FIELD_STRUCT.d.ts +8 -2
  316. package/src/shade/renderer/wind/WIND_FIELD_STRUCT.d.ts.map +1 -1
  317. package/src/shade/renderer/wind/WIND_FIELD_STRUCT.js +11 -4
  318. package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.d.ts +2 -2
  319. package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.d.ts.map +1 -1
  320. package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.js +13 -4
  321. package/src/shade/util/texture_mip_extent.d.ts.map +1 -1
  322. package/src/shade/util/texture_mip_extent.js +88 -87
  323. package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
  324. package/src/shade/wgsl/emulator/WGSLLanguageCore.js +9 -7
  325. package/src/format/image/avif/av1/util/ceil_log2.d.ts.map +0 -1
  326. package/src/shade/renderer/shader/chunk/color/chunk_hash_squirrel3.d.ts +0 -1
  327. package/src/shade/renderer/shader/chunk/color/chunk_hash_squirrel3.d.ts.map +0 -1
  328. package/src/shade/renderer/shader/chunk/color/chunk_hash_squirrel3.js +0 -0
@@ -1,11 +1,18 @@
1
1
  import { SamplerDescriptor } from "../../../../descriptor/texture/SamplerDescriptor.js";
2
2
  import { chunk_clipmap_select_finest } from "../../../shader/chunk/clipmap/chunk_clipmap_select_finest.js";
3
- import { chunk_uv_octahedral_unit_encode } from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_encode.js";
3
+ import { CLIPMAP_LEVEL_ARRAY } from "../../../shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.js";
4
+ import {
5
+ chunk_uv_octahedral_unit_encode
6
+ } from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_encode.js";
4
7
  import { chunk_index_to_grid2d_reciprocal } from "../../../shader/chunk/grid/chunk_index_to_grid2d_reciprocal.js";
5
8
  import { chunk_probe_visibility_weight } from "../../../shader/chunk/light/probe/chunk_probe_visibility_weight.js";
6
9
  import { chunk_pick2_wrs_mat2x4 } from "../../../shader/chunk/random/reservoir/chunk_pick2_wrs_mat2x4.js";
7
- import { METRO_L1_IRRADIANCE_STRUCT } from "../../../shader/chunk/spherical_harmonics/l1i/chunk_convert_to_irradiance_sh.js";
8
- import { chunk_texture_octahedral_skirt_uv } from "../../../shader/chunk/texture/octahedral/chunk_texture_octahedral_skirt_uv.js";
10
+ import {
11
+ METRO_L1_IRRADIANCE_STRUCT
12
+ } from "../../../shader/chunk/spherical_harmonics/l1i/chunk_convert_to_irradiance_sh.js";
13
+ import {
14
+ chunk_texture_octahedral_skirt_uv
15
+ } from "../../../shader/chunk/texture/octahedral/chunk_texture_octahedral_skirt_uv.js";
9
16
  import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
10
17
  import { ShaderResourceDescriptor } from "../../../shader/resource/ShaderResourceDescriptor.js";
11
18
  import { ShaderResourceGroupDescriptor } from "../../../shader/resource/ShaderResourceGroupDescriptor.js";
@@ -16,10 +23,11 @@ import {
16
23
  PROBE_DEPTH_HISTORY_RESOURCE,
17
24
  PROBE_LEVELS_RESOURCE,
18
25
  PROBE_RADIANCE_HISTORY_RESOURCE,
26
+ PROBE_RECORD_STRUCT,
19
27
  PROBE_RECORDS_READ_RESOURCE,
20
28
  PROBE_STATES_READ_RESOURCE
21
29
  } from "./chunk_probe_clipmap.js";
22
- import { chunk_probe_clipmap_cage } from "./chunk_probe_clipmap_cage.js";
30
+ import { chunk_probe_clipmap_cage_in } from "./chunk_probe_clipmap_cage.js";
23
31
  import { PROBE_RECEIVER_BIAS_VIEW } from "./PROBE_CLIPMAP.js";
24
32
 
25
33
  /**
@@ -80,16 +88,25 @@ export const PROBE_DEPTH_SAMPLER_DESCRIPTOR = Object.freeze(SamplerDescriptor.fr
80
88
  */
81
89
  export const PROBE_DEPTH_SAMPLER_RESOURCE = ShaderResourceDescriptor.sampler("probe_depth_sampler", "filtering", PROBE_DEPTH_SAMPLER_DESCRIPTOR);
82
90
 
91
+ const LEVELS = `ptr<uniform, ${CLIPMAP_LEVEL_ARRAY.wgsl_ref}>`;
92
+ const SAMPLING = `ptr<uniform, ${PROBE_SAMPLING_STRUCT.wgsl_ref}>`;
93
+ const STATES = `ptr<storage, array<vec2<u32>>, read>`;
94
+ const RECORDS = `ptr<storage, array<${PROBE_RECORD_STRUCT.wgsl_ref}>, read>`;
95
+
83
96
  /**
84
- * A point's picked probes (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §9.1), and their SH (§9.2):
97
+ * A point's picked probes in one clipmap (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §9.1), and their SH (§9.2),
98
+ * the clipmap passed whole: its levels, shape, indirection, states and depth atlas to the pick, its records to
99
+ * the SH. It binds nothing but the depth's sampler, so a shader can pick from two clipmaps, as the bounce pass
100
+ * does (`shader_probe_clipmap_bounce`).
85
101
  *
86
102
  * ```wgsl
87
- * fn probe_clipmap_pick(position: vec3<f32>, normal: vec3<f32>, view_direction: vec3<f32>, noise: vec2<f32>) -> ProbeClipmapPick
88
- * fn probe_clipmap_sh_of(pick: ProbeClipmapPick) -> ProbeClipmapSH
89
- * fn probe_clipmap_sample_sh(position: vec3<f32>, normal: vec3<f32>, view_direction: vec3<f32>, noise: vec2<f32>) -> ProbeClipmapSH
103
+ * fn probe_clipmap_pick_in(levels: ptr<uniform, ClipmapLevelArray>, sampling: ptr<uniform, ProbeSampling>, indirection: texture_3d<u32>, states: ptr<storage, array<vec2<u32>>, read>, depth: texture_2d<f32>, position: vec3<f32>, normal: vec3<f32>, view_direction: vec3<f32>, noise: vec2<f32>) -> ProbeClipmapPick
104
+ * fn probe_clipmap_sh_in(records: ptr<storage, array<ProbeRecord>, read>, pick: ProbeClipmapPick) -> ProbeClipmapSH
105
+ * fn probe_clipmap_corner_slot_in(sampling, indirection, cascade: u32, point: vec3<i32>) -> u32
106
+ * fn probe_clipmap_depth_moments_in(sampling, depth, slot: u32, direction: vec3<f32>) -> vec2<f32>
90
107
  * ```
91
108
  *
92
- * - **The cage**: `probe_clipmap_cage` along mix(n, v, 0.2), as want takes it, so a pixel reads the
109
+ * - **The cage**: `probe_clipmap_cage_in` along mix(n, v, 0.2), as want takes it, so a pixel reads the
93
110
  * probes it wanted.
94
111
  * - **The weights**, visibility only, of the cage's eight corners: a corner without an ALIVE probe weighs
95
112
  * nothing; one with weighs its trilinear weight × `probe_visibility_weight`: the wrap back-face term
@@ -100,9 +117,8 @@ export const PROBE_DEPTH_SAMPLER_RESOURCE = ShaderResourceDescriptor.sampler("pr
100
117
  * whose corners weigh nothing gives way to the next coarser, without a skirt. With none left the
101
118
  * weights are zero, and the fallback is the caller's (§9.1, step 6).
102
119
  * - **The SH**: the picked records' Metro L1 structs mixed by their weights; resolved with
103
- * `resolve_irradiance_sh_to_diffuse` at the caller's normal, it gives E/π. `probe_clipmap_sh_of` takes a
104
- * pick already made, so a pass that samples the specular too picks once; `probe_clipmap_sample_sh` picks
105
- * and takes it.
120
+ * `resolve_irradiance_sh_to_diffuse` at the caller's normal, it gives E/π. `found` says whether any probe
121
+ * weighed anything.
106
122
  *
107
123
  * Per cascade read: 8 indirection loads, 8 state words and 8 depth taps, then 2 indirection loads for
108
124
  * the pair; then two records a cascade read for the SH. A depth tile's place takes no integer division
@@ -110,7 +126,7 @@ export const PROBE_DEPTH_SAMPLER_RESOURCE = ShaderResourceDescriptor.sampler("pr
110
126
  *
111
127
  * @type {CodeChunk}
112
128
  */
113
- export const chunk_probe_clipmap_pick = CodeChunk.from(
129
+ export const chunk_probe_clipmap_pick_in = CodeChunk.from(
114
130
  //language=WGSL
115
131
  `
116
132
  struct ProbeClipmapPick {
@@ -130,11 +146,11 @@ struct ProbeClipmapSH {
130
146
  found: bool,
131
147
  }
132
148
 
133
- fn probe_clipmap_corner_slot(cascade: u32, point: vec3<i32>) -> u32 {
134
- let resolution = probe_sampling.resolution;
149
+ fn probe_clipmap_corner_slot_in(sampling: ${SAMPLING}, indirection: texture_3d<u32>, cascade: u32, point: vec3<i32>) -> u32 {
150
+ let resolution = (*sampling).resolution;
135
151
  let storage = vec3<u32>(point) & vec3<u32>(resolution - 1u);
136
152
 
137
- return textureLoad(probe_indirection, probe_clipmap_indirection_texel(cascade, storage, resolution), 0).r;
153
+ return textureLoad(indirection, probe_clipmap_indirection_texel(cascade, storage, resolution), 0).r;
138
154
  }
139
155
 
140
156
  fn probe_clipmap_corner(k: u32) -> vec3<i32> {
@@ -142,30 +158,30 @@ fn probe_clipmap_corner(k: u32) -> vec3<i32> {
142
158
  }
143
159
 
144
160
  // a slot's depth moments toward a direction, in spacings: one bilinear tap of its tile, through its skirt
145
- fn probe_clipmap_depth_moments(slot: u32, direction: vec3<f32>) -> vec2<f32> {
146
- let side = probe_sampling.depth_resolution + 2u;
147
- let place = index_to_grid2d_reciprocal(slot, probe_sampling.depth_tiles_per_row, probe_sampling.depth_tiles_per_row_reciprocal);
161
+ fn probe_clipmap_depth_moments_in(sampling: ${SAMPLING}, depth: texture_2d<f32>, slot: u32, direction: vec3<f32>) -> vec2<f32> {
162
+ let side = (*sampling).depth_resolution + 2u;
163
+ let place = index_to_grid2d_reciprocal(slot, (*sampling).depth_tiles_per_row, (*sampling).depth_tiles_per_row_reciprocal);
148
164
  let tile = vec2<f32>(place * side);
149
165
  let in_tile = texture_octahedral_skirt_uv(uv_octahedral_unit_encode(direction), f32(side)) * f32(side);
150
166
 
151
- return textureSampleLevel(probe_depth, probe_depth_sampler, (tile + in_tile) * probe_sampling.depth_texel, 0.0).rg;
167
+ return textureSampleLevel(depth, probe_depth_sampler, (tile + in_tile) * (*sampling).depth_texel, 0.0).rg;
152
168
  }
153
169
 
154
- fn probe_clipmap_corner_weight(cascade: u32, cage: vec3<i32>, k: u32, position: vec3<f32>, normal: vec3<f32>, biased: vec3<f32>) -> f32 {
170
+ fn probe_clipmap_corner_weight_in(levels: ${LEVELS}, sampling: ${SAMPLING}, indirection: texture_3d<u32>, states: ${STATES}, depth: texture_2d<f32>, cascade: u32, cage: vec3<i32>, k: u32, position: vec3<f32>, normal: vec3<f32>, biased: vec3<f32>) -> f32 {
155
171
  let point = cage + probe_clipmap_corner(k);
156
- let slot = probe_clipmap_corner_slot(cascade, point);
172
+ let slot = probe_clipmap_corner_slot_in(sampling, indirection, cascade, point);
157
173
 
158
174
  if (slot == PROBE_CLIPMAP_NONE) {
159
175
  return 0.0;
160
176
  }
161
177
 
162
- let state = probe_states[slot];
178
+ let state = (*states)[slot];
163
179
 
164
180
  if (probe_state_kind(state.x) != PROBE_STATE_ALIVE) {
165
181
  return 0.0;
166
182
  }
167
183
 
168
- let spacing = probe_levels[cascade].cell_size;
184
+ let spacing = (*levels)[cascade].cell_size;
169
185
  let probe = vec3<f32>(point) * spacing + probe_clipmap_offset_decode(state.y, spacing);
170
186
 
171
187
  let f = biased / spacing - vec3<f32>(cage);
@@ -175,36 +191,36 @@ fn probe_clipmap_corner_weight(cascade: u32, cage: vec3<i32>, k: u32, position:
175
191
 
176
192
  let to_point = biased - probe;
177
193
  let distance = length(to_point);
178
- let moments = probe_clipmap_depth_moments(slot, to_point / max(distance, 1e-6));
194
+ let moments = probe_clipmap_depth_moments_in(sampling, depth, slot, to_point / max(distance, 1e-6));
179
195
  let visibility = probe_visibility_chebyshev(moments, distance / spacing);
180
196
 
181
197
  // the back-face term from the point itself, not the biased one
182
198
  return trilinear * probe_visibility_weight(normalize(probe - position), normal, visibility);
183
199
  }
184
200
 
185
- fn probe_clipmap_pick_cascade(cascade: u32, position: vec3<f32>, normal: vec3<f32>, bias_direction: vec3<f32>, noise: vec2<f32>) -> ProbeClipmapPair {
201
+ fn probe_clipmap_pick_cascade_in(levels: ${LEVELS}, sampling: ${SAMPLING}, indirection: texture_3d<u32>, states: ${STATES}, depth: texture_2d<f32>, cascade: u32, position: vec3<f32>, normal: vec3<f32>, bias_direction: vec3<f32>, noise: vec2<f32>) -> ProbeClipmapPair {
186
202
  var out: ProbeClipmapPair;
187
203
  var cage: vec3<i32>;
188
204
 
189
- if (!probe_clipmap_cage(cascade, position, bias_direction, &cage)) {
205
+ if (!probe_clipmap_cage_in(levels, cascade, position, bias_direction, &cage)) {
190
206
  return out;
191
207
  }
192
208
 
193
- let biased = probe_clipmap_biased(cascade, position, bias_direction);
209
+ let biased = probe_clipmap_biased_in(levels, cascade, position, bias_direction);
194
210
 
195
211
  // each corner by name: a dynamic index would put the weights in local memory
196
212
  let weights = mat2x4<f32>(
197
213
  vec4<f32>(
198
- probe_clipmap_corner_weight(cascade, cage, 0u, position, normal, biased),
199
- probe_clipmap_corner_weight(cascade, cage, 1u, position, normal, biased),
200
- probe_clipmap_corner_weight(cascade, cage, 2u, position, normal, biased),
201
- probe_clipmap_corner_weight(cascade, cage, 3u, position, normal, biased),
214
+ probe_clipmap_corner_weight_in(levels, sampling, indirection, states, depth, cascade, cage, 0u, position, normal, biased),
215
+ probe_clipmap_corner_weight_in(levels, sampling, indirection, states, depth, cascade, cage, 1u, position, normal, biased),
216
+ probe_clipmap_corner_weight_in(levels, sampling, indirection, states, depth, cascade, cage, 2u, position, normal, biased),
217
+ probe_clipmap_corner_weight_in(levels, sampling, indirection, states, depth, cascade, cage, 3u, position, normal, biased),
202
218
  ),
203
219
  vec4<f32>(
204
- probe_clipmap_corner_weight(cascade, cage, 4u, position, normal, biased),
205
- probe_clipmap_corner_weight(cascade, cage, 5u, position, normal, biased),
206
- probe_clipmap_corner_weight(cascade, cage, 6u, position, normal, biased),
207
- probe_clipmap_corner_weight(cascade, cage, 7u, position, normal, biased),
220
+ probe_clipmap_corner_weight_in(levels, sampling, indirection, states, depth, cascade, cage, 4u, position, normal, biased),
221
+ probe_clipmap_corner_weight_in(levels, sampling, indirection, states, depth, cascade, cage, 5u, position, normal, biased),
222
+ probe_clipmap_corner_weight_in(levels, sampling, indirection, states, depth, cascade, cage, 6u, position, normal, biased),
223
+ probe_clipmap_corner_weight_in(levels, sampling, indirection, states, depth, cascade, cage, 7u, position, normal, biased),
208
224
  ),
209
225
  );
210
226
 
@@ -215,19 +231,19 @@ fn probe_clipmap_pick_cascade(cascade: u32, position: vec3<f32>, normal: vec3<f3
215
231
  let pick = pick2_wrs_mat2x4(weights, noise);
216
232
 
217
233
  out.slots = vec2<u32>(
218
- probe_clipmap_corner_slot(cascade, cage + probe_clipmap_corner(pick.indices.x)),
219
- probe_clipmap_corner_slot(cascade, cage + probe_clipmap_corner(pick.indices.y)),
234
+ probe_clipmap_corner_slot_in(sampling, indirection, cascade, cage + probe_clipmap_corner(pick.indices.x)),
235
+ probe_clipmap_corner_slot_in(sampling, indirection, cascade, cage + probe_clipmap_corner(pick.indices.y)),
220
236
  );
221
237
  out.weights = vec2<f32>(1.0 - pick.blend, pick.blend);
222
238
 
223
239
  return out;
224
240
  }
225
241
 
226
- fn probe_clipmap_pick(position: vec3<f32>, normal: vec3<f32>, view_direction: vec3<f32>, noise: vec2<f32>) -> ProbeClipmapPick {
242
+ fn probe_clipmap_pick_in(levels: ${LEVELS}, sampling: ${SAMPLING}, indirection: texture_3d<u32>, states: ${STATES}, depth: texture_2d<f32>, position: vec3<f32>, normal: vec3<f32>, view_direction: vec3<f32>, noise: vec2<f32>) -> ProbeClipmapPick {
227
243
  var out: ProbeClipmapPick;
228
244
 
229
- let count = probe_sampling.cascade_count;
230
- let selection = clipmap_select_finest(&probe_levels, count, position, PROBE_BLEND_SKIRT);
245
+ let count = (*sampling).cascade_count;
246
+ let selection = clipmap_select_finest(levels, count, position, PROBE_BLEND_SKIRT);
231
247
 
232
248
  if (selection.level == CLIPMAP_LEVEL_NONE) {
233
249
  return out;
@@ -237,7 +253,7 @@ fn probe_clipmap_pick(position: vec3<f32>, normal: vec3<f32>, view_direction: ve
237
253
 
238
254
  var cascade = selection.level;
239
255
  var skirt = selection.edge_weight;
240
- var pair = probe_clipmap_pick_cascade(cascade, position, normal, bias_direction, noise);
256
+ var pair = probe_clipmap_pick_cascade_in(levels, sampling, indirection, states, depth, cascade, position, normal, bias_direction, noise);
241
257
 
242
258
  // a cascade whose corners weigh nothing gives way to the next coarser, whole
243
259
  for (var next = cascade + 1u; next < count; next++) {
@@ -247,14 +263,14 @@ fn probe_clipmap_pick(position: vec3<f32>, normal: vec3<f32>, view_direction: ve
247
263
 
248
264
  cascade = next;
249
265
  skirt = 0.0;
250
- pair = probe_clipmap_pick_cascade(cascade, position, normal, bias_direction, noise);
266
+ pair = probe_clipmap_pick_cascade_in(levels, sampling, indirection, states, depth, cascade, position, normal, bias_direction, noise);
251
267
  }
252
268
 
253
269
  out.slots = vec4<u32>(pair.slots, pair.slots);
254
270
  out.weights = vec4<f32>(pair.weights, 0.0, 0.0);
255
271
 
256
272
  if (skirt > 0.0 && cascade + 1u < count && pair.weights.x + pair.weights.y > 0.0) {
257
- let coarse = probe_clipmap_pick_cascade(cascade + 1u, position, normal, bias_direction, noise);
273
+ let coarse = probe_clipmap_pick_cascade_in(levels, sampling, indirection, states, depth, cascade + 1u, position, normal, bias_direction, noise);
258
274
 
259
275
  if (coarse.weights.x + coarse.weights.y > 0.0) {
260
276
  out.slots = vec4<u32>(pair.slots, coarse.slots);
@@ -265,7 +281,7 @@ fn probe_clipmap_pick(position: vec3<f32>, normal: vec3<f32>, view_direction: ve
265
281
  return out;
266
282
  }
267
283
 
268
- fn probe_clipmap_sh_of(pick: ProbeClipmapPick) -> ProbeClipmapSH {
284
+ fn probe_clipmap_sh_in(records: ${RECORDS}, pick: ProbeClipmapPick) -> ProbeClipmapSH {
269
285
  var out: ProbeClipmapSH;
270
286
 
271
287
  out.found = dot(pick.weights, vec4<f32>(1.0)) > 0.0;
@@ -276,52 +292,92 @@ fn probe_clipmap_sh_of(pick: ProbeClipmapPick) -> ProbeClipmapSH {
276
292
 
277
293
  // each by name, the slots of a weight of zero not read
278
294
  if (pick.weights.x > 0.0) {
279
- let sh = probe_record_sh_decode(probe_records[pick.slots.x].sh);
295
+ let sh = probe_record_sh_decode((*records)[pick.slots.x].sh);
280
296
  out.sh.CoCg += pick.weights.x * sh.CoCg;
281
297
  out.sh.Y += pick.weights.x * sh.Y;
282
298
  }
283
299
  if (pick.weights.y > 0.0) {
284
- let sh = probe_record_sh_decode(probe_records[pick.slots.y].sh);
300
+ let sh = probe_record_sh_decode((*records)[pick.slots.y].sh);
285
301
  out.sh.CoCg += pick.weights.y * sh.CoCg;
286
302
  out.sh.Y += pick.weights.y * sh.Y;
287
303
  }
288
304
  if (pick.weights.z > 0.0) {
289
- let sh = probe_record_sh_decode(probe_records[pick.slots.z].sh);
305
+ let sh = probe_record_sh_decode((*records)[pick.slots.z].sh);
290
306
  out.sh.CoCg += pick.weights.z * sh.CoCg;
291
307
  out.sh.Y += pick.weights.z * sh.Y;
292
308
  }
293
309
  if (pick.weights.w > 0.0) {
294
- let sh = probe_record_sh_decode(probe_records[pick.slots.w].sh);
310
+ let sh = probe_record_sh_decode((*records)[pick.slots.w].sh);
295
311
  out.sh.CoCg += pick.weights.w * sh.CoCg;
296
312
  out.sh.Y += pick.weights.w * sh.Y;
297
313
  }
298
314
 
299
315
  return out;
300
316
  }
301
-
302
- fn probe_clipmap_sample_sh(position: vec3<f32>, normal: vec3<f32>, view_direction: vec3<f32>, noise: vec2<f32>) -> ProbeClipmapSH {
303
- return probe_clipmap_sh_of(probe_clipmap_pick(position, normal, view_direction, noise));
304
- }
305
-
306
317
  `, [
307
318
  chunk_probe_clipmap,
308
319
  chunk_clipmap_select_finest,
309
- chunk_probe_clipmap_cage,
320
+ chunk_probe_clipmap_cage_in,
310
321
  chunk_index_to_grid2d_reciprocal,
311
322
  chunk_uv_octahedral_unit_encode,
312
323
  chunk_texture_octahedral_skirt_uv,
313
324
  chunk_probe_visibility_weight,
314
325
  chunk_pick2_wrs_mat2x4,
326
+ PROBE_SAMPLING_STRUCT.declaration_chunk,
315
327
  METRO_L1_IRRADIANCE_STRUCT.declaration_chunk,
316
328
  ]);
317
329
 
330
+ chunk_probe_clipmap_pick_in.requireResource(PROBE_DEPTH_SAMPLER_RESOURCE);
331
+
332
+ /**
333
+ * {@link chunk_probe_clipmap_pick_in} over the clipmap a shader binds under the probes' names, as every reader
334
+ * of the screen's probes does (§9.5):
335
+ *
336
+ * ```wgsl
337
+ * fn probe_clipmap_pick(position: vec3<f32>, normal: vec3<f32>, view_direction: vec3<f32>, noise: vec2<f32>) -> ProbeClipmapPick
338
+ * fn probe_clipmap_sh_of(pick: ProbeClipmapPick) -> ProbeClipmapSH
339
+ * fn probe_clipmap_sample_sh(position: vec3<f32>, normal: vec3<f32>, view_direction: vec3<f32>, noise: vec2<f32>) -> ProbeClipmapSH
340
+ * fn probe_clipmap_corner_slot(cascade: u32, point: vec3<i32>) -> u32
341
+ * fn probe_clipmap_depth_moments(slot: u32, direction: vec3<f32>) -> vec2<f32>
342
+ * ```
343
+ *
344
+ * `probe_clipmap_sh_of` takes a pick already made, so a pass that samples the specular too picks once;
345
+ * `probe_clipmap_sample_sh` picks and takes it.
346
+ *
347
+ * @type {CodeChunk}
348
+ */
349
+ export const chunk_probe_clipmap_pick = CodeChunk.from(
350
+ //language=WGSL
351
+ `
352
+ fn probe_clipmap_corner_slot(cascade: u32, point: vec3<i32>) -> u32 {
353
+ return probe_clipmap_corner_slot_in(&probe_sampling, probe_indirection, cascade, point);
354
+ }
355
+
356
+ fn probe_clipmap_depth_moments(slot: u32, direction: vec3<f32>) -> vec2<f32> {
357
+ return probe_clipmap_depth_moments_in(&probe_sampling, probe_depth, slot, direction);
358
+ }
359
+
360
+ fn probe_clipmap_pick(position: vec3<f32>, normal: vec3<f32>, view_direction: vec3<f32>, noise: vec2<f32>) -> ProbeClipmapPick {
361
+ return probe_clipmap_pick_in(&probe_levels, &probe_sampling, probe_indirection, &probe_states, probe_depth, position, normal, view_direction, noise);
362
+ }
363
+
364
+ fn probe_clipmap_sh_of(pick: ProbeClipmapPick) -> ProbeClipmapSH {
365
+ return probe_clipmap_sh_in(&probe_records, pick);
366
+ }
367
+
368
+ fn probe_clipmap_sample_sh(position: vec3<f32>, normal: vec3<f32>, view_direction: vec3<f32>, noise: vec2<f32>) -> ProbeClipmapSH {
369
+ return probe_clipmap_sh_of(probe_clipmap_pick(position, normal, view_direction, noise));
370
+ }
371
+ `, [
372
+ chunk_probe_clipmap_pick_in,
373
+ ]);
374
+
318
375
  chunk_probe_clipmap_pick.requireResource(PROBE_LEVELS_RESOURCE);
319
376
  chunk_probe_clipmap_pick.requireResource(PROBE_SAMPLING_RESOURCE);
320
377
  chunk_probe_clipmap_pick.requireResource(PROBE_INDIRECTION_READ_RESOURCE);
321
378
  chunk_probe_clipmap_pick.requireResource(PROBE_STATES_READ_RESOURCE);
322
379
  chunk_probe_clipmap_pick.requireResource(PROBE_RECORDS_READ_RESOURCE);
323
380
  chunk_probe_clipmap_pick.requireResource(PROBE_DEPTH_HISTORY_RESOURCE);
324
- chunk_probe_clipmap_pick.requireResource(PROBE_DEPTH_SAMPLER_RESOURCE);
325
381
 
326
382
  /**
327
383
  * What {@link chunk_probe_clipmap_pick} reads, as a group a reader of the probes adds to its shader (§9.5).
@@ -0,0 +1,19 @@
1
+ /**
2
+ * What re-sampling a probe's neighbours shares between its passes (`shader_probe_clipmap_resample`,
3
+ * `shader_probe_clipmap_candidate`, `shader_probe_clipmap_resample_rays`):
4
+ *
5
+ * ```wgsl
6
+ * fn probe_resample_offset(j: u32) -> vec3<i32> // the j-th of the 26 neighbours' lattice offsets, the 3×3×3 around the point, its centre skipped
7
+ * fn probe_resample_visibility(moments: vec2<f32>, distance: f32) -> f32 // distance: in the moments' spacings
8
+ * ```
9
+ *
10
+ * `probe_resample_visibility` is how well a probe's depth moments toward a point confirm a surface at its distance:
11
+ * `s² / (s² + (d − μ)²)`, μ the mean depth, s² the depth's variance plus the receiver bias squared
12
+ * (`PROBE_RECEIVER_BIAS`). Two-sided, unlike Chebyshev's: depth nearer than the point is an occluder between, and
13
+ * depth farther sees past the point.
14
+ *
15
+ * @type {CodeChunk}
16
+ */
17
+ export const chunk_probe_clipmap_resample: CodeChunk;
18
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
19
+ //# sourceMappingURL=chunk_probe_clipmap_resample.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_probe_clipmap_resample.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_resample.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AACH,2CAFU,SAAS,CAiBhB;0BAlCuB,uCAAuC"}
@@ -0,0 +1,35 @@
1
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
2
+ import { PROBE_RECEIVER_BIAS } from "./PROBE_CLIPMAP.js";
3
+
4
+ /**
5
+ * What re-sampling a probe's neighbours shares between its passes (`shader_probe_clipmap_resample`,
6
+ * `shader_probe_clipmap_candidate`, `shader_probe_clipmap_resample_rays`):
7
+ *
8
+ * ```wgsl
9
+ * fn probe_resample_offset(j: u32) -> vec3<i32> // the j-th of the 26 neighbours' lattice offsets, the 3×3×3 around the point, its centre skipped
10
+ * fn probe_resample_visibility(moments: vec2<f32>, distance: f32) -> f32 // distance: in the moments' spacings
11
+ * ```
12
+ *
13
+ * `probe_resample_visibility` is how well a probe's depth moments toward a point confirm a surface at its distance:
14
+ * `s² / (s² + (d − μ)²)`, μ the mean depth, s² the depth's variance plus the receiver bias squared
15
+ * (`PROBE_RECEIVER_BIAS`). Two-sided, unlike Chebyshev's: depth nearer than the point is an occluder between, and
16
+ * depth farther sees past the point.
17
+ *
18
+ * @type {CodeChunk}
19
+ */
20
+ export const chunk_probe_clipmap_resample = CodeChunk.from(
21
+ //language=WGSL
22
+ `
23
+ fn probe_resample_offset(j: u32) -> vec3<i32> {
24
+ let index = j + select(0u, 1u, j >= 13u);
25
+
26
+ return vec3<i32>(vec3<u32>(index % 3u, (index / 3u) % 3u, index / 9u)) - vec3<i32>(1);
27
+ }
28
+
29
+ fn probe_resample_visibility(moments: vec2<f32>, distance: f32) -> f32 {
30
+ let spread = max(moments.y - moments.x * moments.x, 0.0) + ${PROBE_RECEIVER_BIAS} * ${PROBE_RECEIVER_BIAS};
31
+ let gap = distance - moments.x;
32
+
33
+ return spread / (spread + gap * gap);
34
+ }
35
+ `);
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_probe_clipmap_sample_radiance.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.js"],"names":[],"mappings":"AAwBA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,kDAFU,SAAS,CAsIZ;0BA7KmB,uCAAuC"}
1
+ {"version":3,"file":"chunk_probe_clipmap_sample_radiance.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.js"],"names":[],"mappings":"AA8BA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,kDAFU,SAAS,CAsIZ;0BA7KmB,uCAAuC"}
@@ -1,12 +1,18 @@
1
1
  import { chunk_roughness_to_mip_ratio } from "../../../light/environment/chunk_roughness_to_mip_ratio.js";
2
- import { chunk_uv_octahedral_unit_encode } from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_encode.js";
2
+ import {
3
+ chunk_uv_octahedral_unit_encode
4
+ } from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_encode.js";
3
5
  import { chunk_index_to_grid2d_reciprocal } from "../../../shader/chunk/grid/chunk_index_to_grid2d_reciprocal.js";
4
6
  import { chunk_probe_visibility_weight } from "../../../shader/chunk/light/probe/chunk_probe_visibility_weight.js";
5
- import { METRO_L1_IRRADIANCE_STRUCT } from "../../../shader/chunk/spherical_harmonics/l1i/chunk_convert_to_irradiance_sh.js";
7
+ import {
8
+ METRO_L1_IRRADIANCE_STRUCT
9
+ } from "../../../shader/chunk/spherical_harmonics/l1i/chunk_convert_to_irradiance_sh.js";
6
10
  import {
7
11
  chunk_resolve_irradiance_sh_to_specular
8
12
  } from "../../../shader/chunk/spherical_harmonics/l1i/chunk_resolve_irradiance_sh_to_specular.js";
9
- import { chunk_texture_octahedral_skirt_uv } from "../../../shader/chunk/texture/octahedral/chunk_texture_octahedral_skirt_uv.js";
13
+ import {
14
+ chunk_texture_octahedral_skirt_uv
15
+ } from "../../../shader/chunk/texture/octahedral/chunk_texture_octahedral_skirt_uv.js";
10
16
  import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
11
17
  import {
12
18
  PROBE_LEVELS_RESOURCE,
@@ -3,14 +3,14 @@
3
3
  * for want's pixels and the hits' wants alike.
4
4
  *
5
5
  * ```wgsl
6
- * fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32>, cascade_count: u32, resolution: u32, key_count: u32, flag: u32)
6
+ * fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32>, cascade_count: u32, resolution: u32, wanted_capacity: u32)
7
7
  * ```
8
8
  *
9
9
  * The cages are the pick's: the finest cascade whose cage window holds the point, the cage of the point
10
10
  * biased along `bias_direction` by that cascade's spacing, and in the cascade's blend skirt the next
11
11
  * cascade's cage too, biased by its own. A cage a bias moved out of its window is not wanted. Each cage
12
- * point's bit is set, and a point whose bit was clear goes on the wanted list with `flag` over its key,
13
- * so the list holds every point wanted this frame once, with its first wanter's flag.
12
+ * point's bit is set, and a point whose bit was clear goes on the wanted list by its key, so the list
13
+ * holds every point wanted this frame once.
14
14
  *
15
15
  * A workgroup's lanes want a few cages between them, so the first lane to want a cage claims it in the
16
16
  * workgroup's table and sets its bits; the rest want it through that lane. Measured on the AMD iGPU at
@@ -29,14 +29,14 @@ const WANT_CLAIM_PROBES = 16;
29
29
  * for want's pixels and the hits' wants alike.
30
30
  *
31
31
  * ```wgsl
32
- * fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32>, cascade_count: u32, resolution: u32, key_count: u32, flag: u32)
32
+ * fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32>, cascade_count: u32, resolution: u32, wanted_capacity: u32)
33
33
  * ```
34
34
  *
35
35
  * The cages are the pick's: the finest cascade whose cage window holds the point, the cage of the point
36
36
  * biased along `bias_direction` by that cascade's spacing, and in the cascade's blend skirt the next
37
37
  * cascade's cage too, biased by its own. A cage a bias moved out of its window is not wanted. Each cage
38
- * point's bit is set, and a point whose bit was clear goes on the wanted list with `flag` over its key,
39
- * so the list holds every point wanted this frame once, with its first wanter's flag.
38
+ * point's bit is set, and a point whose bit was clear goes on the wanted list by its key, so the list
39
+ * holds every point wanted this frame once.
40
40
  *
41
41
  * A workgroup's lanes want a few cages between them, so the first lane to want a cage claims it in the
42
42
  * workgroup's table and sets its bits; the rest want it through that lane. Measured on the AMD iGPU at
@@ -80,7 +80,7 @@ fn probe_want_claim(key: u32) -> bool {
80
80
  return true;
81
81
  }
82
82
 
83
- fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32>, cascade_count: u32, resolution: u32, key_count: u32, flag: u32) {
83
+ fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32>, cascade_count: u32, resolution: u32, wanted_capacity: u32) {
84
84
  let selection = clipmap_select_finest(&probe_levels, cascade_count, position, PROBE_BLEND_SKIRT);
85
85
 
86
86
  let held = wants && selection.level != CLIPMAP_LEVEL_NONE;
@@ -117,7 +117,7 @@ fn probe_clipmap_want(wants: bool, position: vec3<f32>, bias_direction: vec3<f32
117
117
  first = (atomicOr(&probe_wanted_bits[key >> 5u], bit) & bit) == 0u;
118
118
  }
119
119
 
120
- collection_u32_append(&probe_wanted, first, key | flag, key_count);
120
+ collection_u32_append(&probe_wanted, first, key, wanted_capacity);
121
121
  }
122
122
  }
123
123
  `, [
@@ -20,13 +20,12 @@ export const PROBE_ACCUMULATE_SETTINGS: WebGPUStruct;
20
20
  * - **Radiance**: the mean of the texel's resolved rays, a back face's being zero, is a sample of the
21
21
  * texel's multi-scale mean (`chunk_multiscale_mean`), its estimator in `probe_estimators` and its mean
22
22
  * in the atlas.
23
- * - Δt and τ are frames: Δt since the probe's last update, τ `response_frames`.
24
- * - The short mean blends by β = max(1/(a+1), 1 − e^(−Δt·p/τ)), its variance by the same with 2τ. a is
25
- * the texel's own count of the updates that reached it, held in its alpha; p the updates between a
26
- * texel's rays: one over the share of updates that reach it, averaged over the uniform period
27
- * (`probe_clipmap_guide_rate`), n_r²/R below one ray a texel when every update is uniform. A texel
28
- * the guide passes over thus blends what it takes as fully as its rarity asks. Counting a texel
29
- * rather than the probe keeps β right where an update covers a subset.
23
+ * - The short mean blends by β = max(1/(a+1), `PROBE_SHORT_BLEND`), its variance by max(1/(a+1),
24
+ * `PROBE_VARIANCE_BLEND`), a the texel's own count of the updates that reached it, held in its alpha.
25
+ * A sample's blend is a sample's however long since the last one: a probe nobody wanted, or a texel the
26
+ * guide passes over, takes no more of its next sample for the wait. A change in the light is the
27
+ * estimator's to find. Counting a texel rather than the probe keeps β right where an update covers a
28
+ * subset.
30
29
  * - The mean blends by at least 1/(a+1) until the count reaches its limit: a young texel is its running
31
30
  * mean, which the estimator's blend reduction, nothing at its seed, would otherwise hold back. Past it
32
31
  * the estimator alone, down to 1/8192 an update on a noisy texel.
@@ -35,20 +34,17 @@ export const PROBE_ACCUMULATE_SETTINGS: WebGPUStruct;
35
34
  * - A texel's first sample seeds both means. A texel no ray reached keeps its history.
36
35
  * - Where the frame re-samples (`PROBE_CLIPMAP_RESAMPLING`), the sample pools the rays with the texel's
37
36
  * re-samples of the probe's neighbours (`shader_probe_clipmap_resample`), each a ray's worth at a
38
- * visibility of one (`chunk_probe_clipmap_resampled`). Only a texel some ray reached takes them: its
39
- * time terms are a sampled texel's.
37
+ * visibility of one (`chunk_probe_clipmap_resampled`). Only a texel some ray reached takes them.
40
38
  * - **Depth**: the moments (d, d²) of the rays landing in the texel, in spacings: a miss the limit, a
41
39
  * back face 0.2·t (DDGI 2021's shortening), a hit t, every sample held to the limit, the farthest a
42
40
  * cage tests a relocated probe, (1 + 0.45)·√3 (`PROBE_DEPTH_LIMIT`, D9). On a uniform update the
43
- * sample is the plain mean, blended by the probe's α = max(1/(n+1), 1 − e^(−Δt/τ)), n its updates. At
41
+ * sample is the plain mean, blended by the probe's α = max(1/(n+1), `PROBE_SHORT_BLEND`), n its updates. At
44
42
  * most 64 rays a texel, which the settings hold R to (R ≤ 64·n_d²).
45
43
  * - On a guided update the sample is a mean of means: each radiance texel inside the depth texel gives
46
44
  * its own mean, since the guide gives the brighter ones more rays, at most 64/f² of its rays,
47
45
  * evenly strided. It is taken only when every one of them took rays. The guide gives a dark one,
48
46
  * a back face's or a shadowed wall's, none, and the lit ones' depths are not the whole texel's: its
49
47
  * depth comes from the uniform updates.
50
- * - The time term's period is one over the share of updates that reach the depth texel, a uniform
51
- * update counting as reaching every one, a guided one as often as its least reached radiance texel.
52
48
  * - **A new probe's history is another probe's**, its slot's last owner: on its first update a texel
53
49
  * no ray reached is cleared, radiance to nothing seen, depth to the moments of a miss.
54
50
  * - **Stored rounded stochastically** onto halves (`f16_round_stochastic`), with noise fresh for each
@@ -1 +1 @@
1
- {"version":3,"file":"shader_probe_clipmap_accumulate.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.js"],"names":[],"mappings":"AA4CA;;GAEG;AACH,wCAFU,YAAY,CAqBQ;AAqB9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,8CAFU,aAAa,CAsVpB;6BAtd0B,sCAAsC;8BAHrC,kCAAkC"}
1
+ {"version":3,"file":"shader_probe_clipmap_accumulate.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.js"],"names":[],"mappings":"AA8CA;;GAEG;AACH,wCAFU,YAAY,CAmBQ;AAoB9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,8CAFU,aAAa,CA0TpB;6BApb0B,sCAAsC;8BAHrC,kCAAkC"}