@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
@@ -10,16 +10,17 @@ import { ENVIRONMENT_MAP_SAMPLER_RESOURCE } from "../../../light/environment/ENV
10
10
  import { SCENE_DATABASE_RESOURCE } from "../../../scene/SCENE_DATABASE_RESOURCE.js";
11
11
  import { chunk_rgbe9995_decode } from "../../../shader/chunk/color/rgbe9995/chunk_rgbe9995_decode.js";
12
12
  import { chunk_rgbe9995_encode } from "../../../shader/chunk/color/rgbe9995/chunk_rgbe9995_encode.js";
13
- import { chunk_sample_environment_map } from "../../../shader/chunk/texture/sample/chunk_sample_environment_map.js";
14
- import { chunk_uv_octahedral_unit_decode } from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
13
+ import {
14
+ chunk_uv_octahedral_unit_decode
15
+ } from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
15
16
  import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
16
17
  import { RECIPROCAL_PI_DECLARATION } from "../../../shader/chunk/math/RECIPROCAL_PI_DECLARATION.js";
18
+ import { chunk_sample_environment_map } from "../../../shader/chunk/texture/sample/chunk_sample_environment_map.js";
17
19
  import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
18
20
  import { ComputeShader } from "../../../shader/ComputeShader.js";
19
21
  import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
20
22
  import { BRICK_TRACE_HIT, BRICK_TRACE_MISS } from "../brick/BRICK_CLIPMAP.js";
21
23
  import { BRICK_LEVELS_RESOURCE } from "../brick/chunk_brick_clipmap_trace.js";
22
- import { chunk_probe_clipmap_hit_surface } from "./chunk_probe_clipmap_hit_surface.js";
23
24
  import {
24
25
  chunk_probe_clipmap,
25
26
  chunk_probe_clipmap_ray_origin,
@@ -27,6 +28,7 @@ import {
27
28
  PROBE_RAYS_WRITE_RESOURCE,
28
29
  PROBE_TRACE_READ_RESOURCE
29
30
  } from "./chunk_probe_clipmap.js";
31
+ import { chunk_probe_clipmap_hit_surface } from "./chunk_probe_clipmap_hit_surface.js";
30
32
  import { PROBE_THREAD_WORKGROUP_SIZE } from "./PROBE_CLIPMAP.js";
31
33
  import { PROBE_TRACE_SETTINGS } from "./shader_probe_clipmap_trace.js";
32
34
 
@@ -1 +1 @@
1
- {"version":3,"file":"shader_probe_clipmap_trace.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.js"],"names":[],"mappings":"AA+CA;;GAEG;AACH,mCAFU,YAAY,CAeG;AAwBzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,yCAFU,aAAa,CAoJpB;6BAzP0B,sCAAsC;8BAHrC,kCAAkC"}
1
+ {"version":3,"file":"shader_probe_clipmap_trace.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.js"],"names":[],"mappings":"AAqDA;;GAEG;AACH,mCAFU,YAAY,CAeG;AAwBzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,yCAFU,aAAa,CAoJpB;6BAzP0B,sCAAsC;8BAHrC,kCAAkC"}
@@ -2,12 +2,18 @@ import { MESH_SDF_BRICK_VOXELS } from "../../../geometry/sdf/MESH_SDF.js";
2
2
  import { LIGHT_DATA_RESOURCE } from "../../../light/LIGHT_DATA_RESOURCE.js";
3
3
  import { LIGHT_DATABASE_SPEC } from "../../../light/LIGHT_DATABASE_SPEC.js";
4
4
  import { LIGHT_FLAGS } from "../../../light/model/io/LIGHT_FLAGS.js";
5
- import { chunk_cone_sample_direction } from "../../../shader/chunk/geometry/cone/chunk_cone_sample_direction.js";
6
- import { chunk_uv_octahedral_unit_decode } from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
7
- import { chunk_uv_octahedral_unit_encode } from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_encode.js";
8
5
  import { chunk_rgbe9995_encode } from "../../../shader/chunk/color/rgbe9995/chunk_rgbe9995_encode.js";
6
+ import { chunk_cone_sample_direction } from "../../../shader/chunk/geometry/cone/chunk_cone_sample_direction.js";
7
+ import {
8
+ chunk_uv_octahedral_unit_decode
9
+ } from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
10
+ import {
11
+ chunk_uv_octahedral_unit_encode
12
+ } from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_encode.js";
9
13
  import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
10
- import { chunk_directional_lights_iteration_mask } from "../../../shader/chunk/light/io/chunk_directional_lights_iteration_mask.js";
14
+ import {
15
+ chunk_directional_lights_iteration_mask
16
+ } from "../../../shader/chunk/light/io/chunk_directional_lights_iteration_mask.js";
11
17
  import { chunk_hash_to_float01 } from "../../../shader/chunk/random/chunk_hash_to_float01.js";
12
18
  import { chunk_pcg3d } from "../../../shader/chunk/random/pcg/chunk_pcg3d.js";
13
19
  import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
@@ -9,7 +9,8 @@ export const PROBE_TRACE_COMMAND_SETTINGS: WebGPUStruct;
9
9
  * projection;
10
10
  * - a thread a texel of their maps, n_r² + n_d² a probe, at `PROBE_DISPATCH_TEXELS`: accumulate;
11
11
  * - a thread a row of their radiance maps, n_r a probe, at `PROBE_DISPATCH_ROWS`: the projection's rows;
12
- * - a thread a texel of their tiles, (n_r + 2)² + (n_d + 2)² a probe, at `PROBE_DISPATCH_PUBLISH`.
12
+ * - a thread a texel of their tiles, (n_r + 2s)² + (n_d + 2)² a probe, s the radiance's skirt, at
13
+ * `PROBE_DISPATCH_PUBLISH`.
13
14
  *
14
15
  * It writes the count of the ray counts, the ray requests and the rays' layout, the probes listed, which
15
16
  * the passes after fill in (`shader_probe_clipmap_ray_layout.js`): a probe's rays are its own update's,
@@ -1 +1 @@
1
- {"version":3,"file":"shader_probe_clipmap_trace_command.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.js"],"names":[],"mappings":"AAeA;;GAEG;AACH,2CAFU,YAAY,CASU;AAahC;;;;;;;;;;;;;;GAcG;AACH,iDAFU,aAAa,CAoDpB;6BAlG0B,sCAAsC;8BAHrC,kCAAkC"}
1
+ {"version":3,"file":"shader_probe_clipmap_trace_command.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.js"],"names":[],"mappings":"AAgBA;;GAEG;AACH,2CAFU,YAAY,CAWU;AAahC;;;;;;;;;;;;;;;GAeG;AACH,iDAFU,aAAa,CAsDpB;6BAvG0B,sCAAsC;8BAHrC,kCAAkC"}
@@ -1,4 +1,5 @@
1
1
  import { chunk_folded_dispatch } from "../../../gpu_primitive/indirect/chunk_folded_dispatch.js";
2
+ import { chunk_divide_round_up_u32 } from "../../../shader/chunk/math/chunk_divide_round_up_u32.js";
2
3
  import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
3
4
  import { ComputeShader } from "../../../shader/ComputeShader.js";
4
5
  import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
@@ -23,6 +24,8 @@ export const PROBE_TRACE_COMMAND_SETTINGS = WebGPUStruct.from({
23
24
  radiance_resolution: u32,
24
25
  /** octahedral depth texels a side, n_d */
25
26
  depth_resolution: u32,
27
+ /** texels of skirt around a radiance tile's map on each side: 1, or 0 for a clipmap whose radiance is never sampled */
28
+ radiance_skirt: u32,
26
29
  }, "ProbeTraceCommandSettings");
27
30
 
28
31
  const resources = new ShaderResourceSetDescriptor();
@@ -43,7 +46,8 @@ resources.createGroup()
43
46
  * projection;
44
47
  * - a thread a texel of their maps, n_r² + n_d² a probe, at `PROBE_DISPATCH_TEXELS`: accumulate;
45
48
  * - a thread a row of their radiance maps, n_r a probe, at `PROBE_DISPATCH_ROWS`: the projection's rows;
46
- * - a thread a texel of their tiles, (n_r + 2)² + (n_d + 2)² a probe, at `PROBE_DISPATCH_PUBLISH`.
49
+ * - a thread a texel of their tiles, (n_r + 2s)² + (n_d + 2)² a probe, s the radiance's skirt, at
50
+ * `PROBE_DISPATCH_PUBLISH`.
47
51
  *
48
52
  * It writes the count of the ray counts, the ray requests and the rays' layout, the probes listed, which
49
53
  * the passes after fill in (`shader_probe_clipmap_ray_layout.js`): a probe's rays are its own update's,
@@ -60,7 +64,7 @@ export const shader_probe_clipmap_trace_command = ComputeShader.from({
60
64
  @compute @workgroup_size(1)
61
65
  fn main() {
62
66
  let traced = min(probe_trace.count, settings.trace_capacity);
63
- let probes = folded_dispatch((traced + PROBE_THREAD_WORKGROUP_SIZE - 1u) / PROBE_THREAD_WORKGROUP_SIZE);
67
+ let probes = folded_dispatch(divide_round_up_u32(traced, PROBE_THREAD_WORKGROUP_SIZE));
64
68
 
65
69
  probe_dispatch[PROBE_DISPATCH_TRACED] = probes.x;
66
70
  probe_dispatch[PROBE_DISPATCH_TRACED + 1u] = probes.y;
@@ -73,25 +77,26 @@ fn main() {
73
77
  let n = settings.radiance_resolution;
74
78
  let m = settings.depth_resolution;
75
79
 
76
- let texels = folded_dispatch((traced * (n * n + m * m) + PROBE_THREAD_WORKGROUP_SIZE - 1u) / PROBE_THREAD_WORKGROUP_SIZE);
80
+ let texels = folded_dispatch(divide_round_up_u32(traced * (n * n + m * m), PROBE_THREAD_WORKGROUP_SIZE));
77
81
 
78
82
  probe_dispatch[PROBE_DISPATCH_TEXELS] = texels.x;
79
83
  probe_dispatch[PROBE_DISPATCH_TEXELS + 1u] = texels.y;
80
84
  probe_dispatch[PROBE_DISPATCH_TEXELS + 2u] = texels.z;
81
85
 
82
- let rows = folded_dispatch((traced * n + PROBE_THREAD_WORKGROUP_SIZE - 1u) / PROBE_THREAD_WORKGROUP_SIZE);
86
+ let rows = folded_dispatch(divide_round_up_u32(traced * n, PROBE_THREAD_WORKGROUP_SIZE));
83
87
 
84
88
  probe_dispatch[PROBE_DISPATCH_ROWS] = rows.x;
85
89
  probe_dispatch[PROBE_DISPATCH_ROWS + 1u] = rows.y;
86
90
  probe_dispatch[PROBE_DISPATCH_ROWS + 2u] = rows.z;
87
91
 
88
- let tiles = folded_dispatch((traced * ((n + 2u) * (n + 2u) + (m + 2u) * (m + 2u)) + PROBE_THREAD_WORKGROUP_SIZE - 1u) / PROBE_THREAD_WORKGROUP_SIZE);
92
+ let side = n + 2u * settings.radiance_skirt;
93
+ let tiles = folded_dispatch(divide_round_up_u32(traced * (side * side + (m + 2u) * (m + 2u)), PROBE_THREAD_WORKGROUP_SIZE));
89
94
 
90
95
  probe_dispatch[PROBE_DISPATCH_PUBLISH] = tiles.x;
91
96
  probe_dispatch[PROBE_DISPATCH_PUBLISH + 1u] = tiles.y;
92
97
  probe_dispatch[PROBE_DISPATCH_PUBLISH + 2u] = tiles.z;
93
98
 
94
- let runs = folded_dispatch((traced + PROBE_ORDER_RUN - 1u) / PROBE_ORDER_RUN);
99
+ let runs = folded_dispatch(divide_round_up_u32(traced, PROBE_ORDER_RUN));
95
100
 
96
101
  probe_dispatch[PROBE_DISPATCH_ORDER] = runs.x;
97
102
  probe_dispatch[PROBE_DISPATCH_ORDER + 1u] = runs.y;
@@ -99,6 +104,7 @@ fn main() {
99
104
  }
100
105
  `, [
101
106
  chunk_probe_clipmap,
107
+ chunk_divide_round_up_u32,
102
108
  chunk_folded_dispatch,
103
109
  ]),
104
110
  });
@@ -8,8 +8,7 @@ export const PROBE_WANT_SETTINGS: WebGPUStruct;
8
8
  *
9
9
  * Each frame a tile wants the probes of one of its pixels, picked by STBN at (tile, frame): the cages
10
10
  * that pixel's pick reads (§9.1), biased along `mix(n, v, 0.2)`, through `probe_clipmap_want`. A sky
11
- * pixel wants nothing. Its points go on the wanted list as the screen's, `PROBE_WANTED_SCREEN`; want runs
12
- * before the hits' wants, so a point both want is the screen's.
11
+ * pixel wants nothing.
13
12
  *
14
13
  * At a cascade's outer edge a lattice cell is 58 pixels on a 1080p screen at a 60° field of view, and
15
14
  * 19 at 120°, so a tile of 8 samples every cell several times a frame, and a workgroup's 64 tiles want
@@ -1 +1 @@
1
- {"version":3,"file":"shader_probe_clipmap_want.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.js"],"names":[],"mappings":"AAqBA;;GAEG;AACH,kCAFU,YAAY,CAUE;AAexB;;;;;;;;;;;;;;GAcG;AACH,wCAFU,aAAa,CAqCpB;6BAtF0B,sCAAsC;8BAHrC,kCAAkC"}
1
+ {"version":3,"file":"shader_probe_clipmap_want.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.js"],"names":[],"mappings":"AAqBA;;GAEG;AACH,kCAFU,YAAY,CAUE;AAexB;;;;;;;;;;;;;GAaG;AACH,wCAFU,aAAa,CAqCpB;6BAtF0B,sCAAsC;8BAHrC,kCAAkC"}
@@ -4,12 +4,12 @@ import { chunk_is_background } from "../../../shader/chunk/depth/chunk_is_backgr
4
4
  import { chunk_mat4_extract_position } from "../../../shader/chunk/geometry/mat4/chunk_mat4_extract_position.js";
5
5
  import { chunk_decode_g_buffer_normal } from "../../../shader/chunk/geometry/normal/chunk_decode_g_buffer_normal.js";
6
6
  import { chunk_stbn_sample_vec2 } from "../../../shader/chunk/noise/chunk_stbn_sample_vec2.js";
7
- import { STBN_VEC2_RESOURCE } from "../../../STATIC_GRAPHICS_ENGINE_ASSET_RESOURCES.js";
8
7
  import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
9
8
  import { ComputeShader } from "../../../shader/ComputeShader.js";
10
9
  import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
11
10
  import { u32 } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
12
11
  import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
12
+ import { STBN_VEC2_RESOURCE } from "../../../STATIC_GRAPHICS_ENGINE_ASSET_RESOURCES.js";
13
13
  import {
14
14
  chunk_probe_clipmap,
15
15
  PROBE_LEVELS_RESOURCE,
@@ -28,8 +28,8 @@ export const PROBE_WANT_SETTINGS = WebGPUStruct.from({
28
28
  resolution: u32,
29
29
  /** the frame's index, what the tile's pixel is picked by */
30
30
  frame: u32,
31
- /** keys over every cascade: what the wanted list holds at most */
32
- key_count: u32,
31
+ /** what the wanted list holds at most: every key, or fewer where the wants cannot want more */
32
+ wanted_capacity: u32,
33
33
  }, "ProbeWantSettings");
34
34
 
35
35
  const resources = new ShaderResourceSetDescriptor();
@@ -51,8 +51,7 @@ resources.createGroup()
51
51
  *
52
52
  * Each frame a tile wants the probes of one of its pixels, picked by STBN at (tile, frame): the cages
53
53
  * that pixel's pick reads (§9.1), biased along `mix(n, v, 0.2)`, through `probe_clipmap_want`. A sky
54
- * pixel wants nothing. Its points go on the wanted list as the screen's, `PROBE_WANTED_SCREEN`; want runs
55
- * before the hits' wants, so a point both want is the screen's.
54
+ * pixel wants nothing.
56
55
  *
57
56
  * At a cascade's outer edge a lattice cell is 58 pixels on a 1080p screen at a 60° field of view, and
58
57
  * 19 at 120°, so a tile of 8 samples every cell several times a frame, and a workgroup's 64 tiles want
@@ -84,7 +83,7 @@ fn main(@builtin(global_invocation_id) id: vec3<u32>) {
84
83
  let view_direction = normalize(mat4_extract_position(camera.transform) - position);
85
84
  let bias_direction = mix(normal, view_direction, ${PROBE_RECEIVER_BIAS_VIEW});
86
85
 
87
- probe_clipmap_want(on_screen && !is_background(depth), position, bias_direction, settings.cascade_count, settings.resolution, settings.key_count, PROBE_WANTED_SCREEN);
86
+ probe_clipmap_want(on_screen && !is_background(depth), position, bias_direction, settings.cascade_count, settings.resolution, settings.wanted_capacity);
88
87
  }
89
88
  `, [
90
89
  chunk_probe_clipmap,
@@ -1,28 +1,24 @@
1
1
  /**
2
- * @type {WebGPUStruct}
3
- */
4
- export const PROBE_WANT_HITS_SETTINGS: WebGPUStruct;
5
- /**
6
- * The hits' wants (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.3, §8.7, D31): a thread a ray of the last
7
- * frame's updates, after want and before admit, through the launch those rays had,
8
- * `PROBE_DISPATCH_RAYS`, before the frame's trace command writes it over.
2
+ * The hits' wants (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.3, §8.7; WORLD_PROBE_CACHE_SCOPE_2026_11_01.md §1.3):
3
+ * a thread a ray of another clipmap's last-frame updates, through the launch those rays had,
4
+ * `PROBE_DISPATCH_RAYS` of that clipmap, before its frame's lifetime writes them over. The points go on this
5
+ * clipmap's wanted list, through its levels.
9
6
  *
10
- * A front-face hit that bounces anything wants the cages its pick reads, as a pixel does: the light pass
11
- * takes the hit's next bounce from those probes. So a probe a hit needs is admitted where nothing on
12
- * screen wanted one, and kept while hits read it. Until its first update a NEW probe weighs nothing and
13
- * the hit takes no bounce: light is lost for a frame or two, never invented.
7
+ * A front-face hit whose `row` the light passes left non-zero wants the cages its pick reads in this clipmap:
8
+ * the bounce pass clears the row of a hit whose first set held probes, so a hit wants only where that set
9
+ * had none, and this clipmap's probes are its fallback (`shader_probe_clipmap_bounce`). So a probe a hit needs
10
+ * is admitted where the first set has none, and kept while hits read it. Until its first update a NEW probe
11
+ * weighs nothing and the hit takes no bounce: light is lost for a frame or two, never invented.
14
12
  *
15
- * Only a probe a pixel wanted in the frame of its update has hits that want, so the probes hits wanted
16
- * want nothing in turn: the chain stops after one step, as Enshrouded's world-cache probes do. Unstopped,
17
- * hits would want a probe at every surface the windows hold, the dense lattice D31 turned down.
13
+ * Only the rays it binds want: this clipmap's own rays want nothing, so the chain stops after one step, as
14
+ * Enshrouded's world-cache probes do.
18
15
  *
19
- * It binds the last frame's trace list, origins and rays, which the frame's trace writes over later. A ray
20
- * names its probe, its place in that list, in its flags; a record of no ray (`PROBE_RAY_NONE`) is past
21
- * that frame's last.
16
+ * It binds the rays' trace list, origins and rays as their clipmap left them last frame. A ray names its
17
+ * probe, its place in that list, in its flags; a record of no ray (`PROBE_RAY_NONE`) is past that frame's
18
+ * last.
22
19
  *
23
20
  * @type {ComputeShader}
24
21
  */
25
22
  export const shader_probe_clipmap_want_hits: ComputeShader;
26
- import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
27
23
  import { ComputeShader } from "../../../shader/ComputeShader.js";
28
24
  //# sourceMappingURL=shader_probe_clipmap_want_hits.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shader_probe_clipmap_want_hits.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.js"],"names":[],"mappings":"AAqBA;;GAEG;AACH,uCAFU,YAAY,CAQM;AAe5B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,6CAFU,aAAa,CA8CpB;6BAvG0B,sCAAsC;8BAHrC,kCAAkC"}
1
+ {"version":3,"file":"shader_probe_clipmap_want_hits.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.js"],"names":[],"mappings":"AAiCA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,6CAFU,aAAa,CA+CpB;8BA9F2B,kCAAkC"}
@@ -1,65 +1,54 @@
1
- import { chunk_uv_octahedral_unit_decode } from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
1
+ import {
2
+ chunk_uv_octahedral_unit_decode
3
+ } from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
2
4
  import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
3
5
  import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
4
6
  import { ComputeShader } from "../../../shader/ComputeShader.js";
5
7
  import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
6
- import { u32 } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
7
- import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
8
8
  import {
9
9
  chunk_probe_clipmap,
10
10
  chunk_probe_clipmap_ray_origin,
11
11
  PROBE_LEVELS_RESOURCE,
12
12
  PROBE_ORIGINS_READ_RESOURCE,
13
13
  PROBE_RAYS_READ_RESOURCE,
14
- PROBE_RECORDS_READ_RESOURCE,
15
14
  PROBE_TRACE_READ_RESOURCE,
16
15
  PROBE_WANTED_BITS_RESOURCE,
17
16
  PROBE_WANTED_WRITE_RESOURCE
18
17
  } from "./chunk_probe_clipmap.js";
19
18
  import { chunk_probe_clipmap_want } from "./chunk_probe_clipmap_want.js";
20
19
  import { PROBE_RECEIVER_BIAS_VIEW, PROBE_THREAD_WORKGROUP_SIZE } from "./PROBE_CLIPMAP.js";
21
-
22
- /**
23
- * @type {WebGPUStruct}
24
- */
25
- export const PROBE_WANT_HITS_SETTINGS = WebGPUStruct.from({
26
- cascade_count: u32,
27
- /** lattice points a cascade's window has a side */
28
- resolution: u32,
29
- /** keys over every cascade: what the wanted list holds at most */
30
- key_count: u32,
31
- }, "ProbeWantHitsSettings");
20
+ import { PROBE_WANT_SETTINGS } from "./shader_probe_clipmap_want.js";
32
21
 
33
22
  const resources = new ShaderResourceSetDescriptor();
34
23
 
35
- resources.setImmediate("settings", PROBE_WANT_HITS_SETTINGS);
24
+ resources.setImmediate("settings", PROBE_WANT_SETTINGS);
36
25
 
37
26
  resources.createGroup()
38
27
  .add(PROBE_TRACE_READ_RESOURCE)
39
28
  .add(PROBE_ORIGINS_READ_RESOURCE)
40
29
  .add(PROBE_RAYS_READ_RESOURCE)
41
- .add(PROBE_RECORDS_READ_RESOURCE)
42
30
  .add(PROBE_LEVELS_RESOURCE)
43
31
  .add(PROBE_WANTED_BITS_RESOURCE)
44
32
  .add(PROBE_WANTED_WRITE_RESOURCE);
45
33
 
46
34
  /**
47
- * The hits' wants (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.3, §8.7, D31): a thread a ray of the last
48
- * frame's updates, after want and before admit, through the launch those rays had,
49
- * `PROBE_DISPATCH_RAYS`, before the frame's trace command writes it over.
35
+ * The hits' wants (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.3, §8.7; WORLD_PROBE_CACHE_SCOPE_2026_11_01.md §1.3):
36
+ * a thread a ray of another clipmap's last-frame updates, through the launch those rays had,
37
+ * `PROBE_DISPATCH_RAYS` of that clipmap, before its frame's lifetime writes them over. The points go on this
38
+ * clipmap's wanted list, through its levels.
50
39
  *
51
- * A front-face hit that bounces anything wants the cages its pick reads, as a pixel does: the light pass
52
- * takes the hit's next bounce from those probes. So a probe a hit needs is admitted where nothing on
53
- * screen wanted one, and kept while hits read it. Until its first update a NEW probe weighs nothing and
54
- * the hit takes no bounce: light is lost for a frame or two, never invented.
40
+ * A front-face hit whose `row` the light passes left non-zero wants the cages its pick reads in this clipmap:
41
+ * the bounce pass clears the row of a hit whose first set held probes, so a hit wants only where that set
42
+ * had none, and this clipmap's probes are its fallback (`shader_probe_clipmap_bounce`). So a probe a hit needs
43
+ * is admitted where the first set has none, and kept while hits read it. Until its first update a NEW probe
44
+ * weighs nothing and the hit takes no bounce: light is lost for a frame or two, never invented.
55
45
  *
56
- * Only a probe a pixel wanted in the frame of its update has hits that want, so the probes hits wanted
57
- * want nothing in turn: the chain stops after one step, as Enshrouded's world-cache probes do. Unstopped,
58
- * hits would want a probe at every surface the windows hold, the dense lattice D31 turned down.
46
+ * Only the rays it binds want: this clipmap's own rays want nothing, so the chain stops after one step, as
47
+ * Enshrouded's world-cache probes do.
59
48
  *
60
- * It binds the last frame's trace list, origins and rays, which the frame's trace writes over later. A ray
61
- * names its probe, its place in that list, in its flags; a record of no ray (`PROBE_RAY_NONE`) is past
62
- * that frame's last.
49
+ * It binds the rays' trace list, origins and rays as their clipmap left them last frame. A ray names its
50
+ * probe, its place in that list, in its flags; a record of no ray (`PROBE_RAY_NONE`) is past that frame's
51
+ * last.
63
52
  *
64
53
  * @type {ComputeShader}
65
54
  */
@@ -86,19 +75,20 @@ fn main(
86
75
  let k = record.flags >> PROBE_RAY_PROBE_SHIFT;
87
76
  let slot = probe_trace.elements[k];
88
77
 
89
- // shade left a front-face hit's albedo in its row and zero in any other ray's: a ray that takes no
90
- // bounce, a black hit's among them, wants nothing
91
- wants = record.row != 0u && (probe_records[slot].flags & PROBE_RECORD_SCREEN) != 0u;
78
+ // shade left a front-face hit's albedo in its row and zero in any other ray's, and the bounce pass
79
+ // cleared the row of a hit its first set served: a ray that takes no bounce, a black hit's among them,
80
+ // or that had its probes, wants nothing
81
+ wants = record.row != 0u;
92
82
 
93
83
  let direction = uv_octahedral_unit_decode(unpack2x16unorm(record.direction));
94
84
  let normal = uv_octahedral_unit_decode(unpack2x16unorm(record.normal));
95
85
 
96
86
  position = probe_clipmap_ray_origin(probe_origins[k], slot, record.direction) + record.t * direction;
97
- // the view back along the ray, as the light pass's pick takes it
87
+ // the view back along the ray, as the bounce pass's pick takes it
98
88
  bias_direction = mix(normal, -direction, ${PROBE_RECEIVER_BIAS_VIEW});
99
89
  }
100
90
 
101
- probe_clipmap_want(wants, position, bias_direction, settings.cascade_count, settings.resolution, settings.key_count, 0u);
91
+ probe_clipmap_want(wants, position, bias_direction, settings.cascade_count, settings.resolution, settings.wanted_capacity);
102
92
  }
103
93
  `, [
104
94
  chunk_probe_clipmap,
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Bytes of a uniform buffer binding that **every** WebGPU device allows.
3
+ *
4
+ * `maxUniformBufferBindingSize` has this as its default, and a device may only report more, never
5
+ * less — so a uniform whose type is sized to it binds wherever it runs. A uniform's type is fixed when
6
+ * its shader is written, before any device is asked, which is why a fixed-length table that lives in a
7
+ * uniform takes its length from this rather than from the device's own figure.
8
+ *
9
+ * @see https://www.w3.org/TR/webgpu/#limits
10
+ * @type {number}
11
+ */
12
+ export const WEBGPU_GUARANTEED_MAX_UNIFORM_BUFFER_BINDING_SIZE: number;
13
+ //# sourceMappingURL=WEBGPU_GUARANTEED_MAX_UNIFORM_BUFFER_BINDING_SIZE.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WEBGPU_GUARANTEED_MAX_UNIFORM_BUFFER_BINDING_SIZE.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/gpu_primitive/WEBGPU_GUARANTEED_MAX_UNIFORM_BUFFER_BINDING_SIZE.js"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,gEAFU,MAAM,CAEuD"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Bytes of a uniform buffer binding that **every** WebGPU device allows.
3
+ *
4
+ * `maxUniformBufferBindingSize` has this as its default, and a device may only report more, never
5
+ * less — so a uniform whose type is sized to it binds wherever it runs. A uniform's type is fixed when
6
+ * its shader is written, before any device is asked, which is why a fixed-length table that lives in a
7
+ * uniform takes its length from this rather than from the device's own figure.
8
+ *
9
+ * @see https://www.w3.org/TR/webgpu/#limits
10
+ * @type {number}
11
+ */
12
+ export const WEBGPU_GUARANTEED_MAX_UNIFORM_BUFFER_BINDING_SIZE = 65536;
@@ -8,13 +8,38 @@
8
8
  export function cpu_hash_table_get(table: Uint32Array, offset: number, key: number): number;
9
9
  /**
10
10
  *
11
- * @param {Uint32Array} result
11
+ * @param {Uint32Array} result output; its `table_size` slots must be empty (zero)
12
12
  * @param {number} result_offset
13
13
  * @param {number} table_size table_size of the table
14
14
  * @param {number[]} inputs
15
15
  * @param {number} input_size
16
+ * @returns {boolean} false if some input could not be placed within the probe limit: the table is
17
+ * then incomplete, and has to be built again with a larger table_size. See {@link cpu_hash_table_create}
16
18
  */
17
- export function cpu_build_hash_table(result: Uint32Array, result_offset: number, table_size: number, inputs: number[], input_size: number): void;
19
+ export function cpu_build_hash_table(result: Uint32Array, result_offset: number, table_size: number, inputs: number[], input_size: number): boolean;
20
+ /**
21
+ * Length in words of the first table size {@link cpu_hash_table_create} tries for `input_size` keys.
22
+ *
23
+ * @param {number} input_size
24
+ * @returns {number}
25
+ */
26
+ export function cpu_hash_table_word_count(input_size: number): number;
27
+ /**
28
+ * Builds a table holding `inputs` into `table`, choosing its size.
29
+ *
30
+ * The size is the smallest power of two that is at most half full, places every input within the
31
+ * probe limit, and fits in `table`. Lookups read it from the header; words past it are left as they
32
+ * were.
33
+ *
34
+ * @param {Uint32Array} table output, header at word 0; any previous table in it is replaced
35
+ * @param {number[]} inputs keys; each maps to its index in `inputs`
36
+ * @param {number} input_size number of keys taken from `inputs`
37
+ * @returns {boolean} false if no such size fits in `table`, whose contents are then unspecified.
38
+ * Doubling the length of `table` offers the next size, and a large enough table always succeeds
39
+ * @see cpu_hash_table_word_count for the length of the first size tried
40
+ * @see cpu_build_hash_table to build at a given size
41
+ */
42
+ export function cpu_hash_table_create(table: Uint32Array, inputs: number[], input_size: number): boolean;
18
43
  /**
19
44
  * Sentinel returned on lookup miss.
20
45
  * Must match the WGSL twin ({@link chunk_hash_table_get}).
@@ -1 +1 @@
1
- {"version":3,"file":"cpu_build_hash_table.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.js"],"names":[],"mappings":"AAkEA;;;;;;GAMG;AACH,0CALW,WAAW,UACX,MAAM,OACN,MAAM,GACJ,MAAM,CAsClB;AAED;;;;;;;GAOG;AACH,6CANW,WAAW,iBACX,MAAM,cACN,MAAM,UACN,MAAM,EAAE,cACR,MAAM,QAuBhB;AA5HD;;;;GAIG;AACH,8BAFU,MAAM,CAE0B"}
1
+ {"version":3,"file":"cpu_build_hash_table.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.js"],"names":[],"mappings":"AAoEA;;;;;;GAMG;AACH,0CALW,WAAW,UACX,MAAM,OACN,MAAM,GACJ,MAAM,CAsClB;AAED;;;;;;;;;GASG;AACH,6CARW,WAAW,iBACX,MAAM,cACN,MAAM,UACN,MAAM,EAAE,cACR,MAAM,GACJ,OAAO,CA2BnB;AAWD;;;;;GAKG;AACH,sDAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;;;;;;;;;;;GAcG;AACH,6CARW,WAAW,UACX,MAAM,EAAE,cACR,MAAM,GACJ,OAAO,CAkBnB;AAnLD;;;;GAIG;AACH,8BAFU,MAAM,CAE0B"}
@@ -1,4 +1,5 @@
1
1
  import { assert } from "../../../../core/assert.js";
2
+ import { ceilPowerOfTwo } from "../../../../core/binary/operations/ceilPowerOfTwo.js";
2
3
  import {
3
4
  generate_next_linear_congruential_index
4
5
  } from "../../../../core/collection/map/generate_next_linear_congruential_index.js";
@@ -8,7 +9,7 @@ import { isPowerOfTwo } from "../../../../core/math/isPowerOfTwo.js";
8
9
  /**
9
10
  * Maximum number of slots visited per operation.
10
11
  * Must match the WGSL twin ({@link chunk_hash_table_get}): a lookup probes at most this many slots,
11
- * so an insert that cannot place a record within the limit must fail loudly — otherwise it would
12
+ * so an insert that cannot place a record within the limit must report it — otherwise it would
12
13
  * create an entry that lookups can never reach.
13
14
  * @type {number}
14
15
  */
@@ -28,6 +29,7 @@ export const HASH_TABLE_MISS = 0xFFFFFFFF;
28
29
  * @param {number} table_size
29
30
  * @param {number} key
30
31
  * @param {number} value
32
+ * @returns {boolean} false if the record could not be placed within {@link PROBE_LIMIT} slots
31
33
  */
32
34
  function insert(table, table_offset, table_size, key, value) {
33
35
 
@@ -49,19 +51,19 @@ function insert(table, table_offset, table_size, key, value) {
49
51
  // empty slot, claim it
50
52
  table[address] = encoded_key;
51
53
  table[address + 1] = value;
52
- return;
54
+ return true;
53
55
  }
54
56
 
55
57
  if (slot_key === encoded_key) {
56
58
  // replace
57
59
  table[address + 1] = value;
58
- return;
60
+ return true;
59
61
  }
60
62
 
61
63
  index = generate_next_linear_congruential_index(index, bin_mask);
62
64
  }
63
65
 
64
- throw new Error(`hash table insert exceeded probe limit (${PROBE_LIMIT}) for key=${key}; increase table_size to reduce collisions`);
66
+ return false;
65
67
  }
66
68
 
67
69
  /**
@@ -111,11 +113,13 @@ export function cpu_hash_table_get(table, offset, key) {
111
113
 
112
114
  /**
113
115
  *
114
- * @param {Uint32Array} result
116
+ * @param {Uint32Array} result output; its `table_size` slots must be empty (zero)
115
117
  * @param {number} result_offset
116
118
  * @param {number} table_size table_size of the table
117
119
  * @param {number[]} inputs
118
120
  * @param {number} input_size
121
+ * @returns {boolean} false if some input could not be placed within the probe limit: the table is
122
+ * then incomplete, and has to be built again with a larger table_size. See {@link cpu_hash_table_create}
119
123
  */
120
124
  export function cpu_build_hash_table(
121
125
  result, result_offset, table_size,
@@ -135,7 +139,59 @@ export function cpu_build_hash_table(
135
139
  // hash input
136
140
  const key = inputs[i];
137
141
 
138
- insert(result, data_offset, table_size, key, i);
142
+ if (!insert(result, data_offset, table_size, key, i)) {
143
+ return false;
144
+ }
145
+ }
146
+
147
+ return true;
148
+ }
149
+
150
+ /**
151
+ * Smallest power of two that holds `input_size` keys at most half full.
152
+ * @param {number} input_size
153
+ * @returns {number}
154
+ */
155
+ function initial_table_size(input_size) {
156
+ return ceilPowerOfTwo(Math.max(1, input_size * 2));
157
+ }
158
+
159
+ /**
160
+ * Length in words of the first table size {@link cpu_hash_table_create} tries for `input_size` keys.
161
+ *
162
+ * @param {number} input_size
163
+ * @returns {number}
164
+ */
165
+ export function cpu_hash_table_word_count(input_size) {
166
+ return initial_table_size(input_size) * 2 + 2;
167
+ }
168
+
169
+ /**
170
+ * Builds a table holding `inputs` into `table`, choosing its size.
171
+ *
172
+ * The size is the smallest power of two that is at most half full, places every input within the
173
+ * probe limit, and fits in `table`. Lookups read it from the header; words past it are left as they
174
+ * were.
175
+ *
176
+ * @param {Uint32Array} table output, header at word 0; any previous table in it is replaced
177
+ * @param {number[]} inputs keys; each maps to its index in `inputs`
178
+ * @param {number} input_size number of keys taken from `inputs`
179
+ * @returns {boolean} false if no such size fits in `table`, whose contents are then unspecified.
180
+ * Doubling the length of `table` offers the next size, and a large enough table always succeeds
181
+ * @see cpu_hash_table_word_count for the length of the first size tried
182
+ * @see cpu_build_hash_table to build at a given size
183
+ */
184
+ export function cpu_hash_table_create(table, inputs, input_size) {
185
+ const capacity = (table.length - 2) >> 1;
186
+
187
+ for (let table_size = initial_table_size(input_size); table_size <= capacity; table_size *= 2) {
188
+ // an occupied slot is never claimed, so whatever this size covers starts empty
189
+ table.fill(0, 2, table_size * 2 + 2);
190
+
191
+ if (cpu_build_hash_table(table, 0, table_size, inputs, input_size)) {
192
+ return true;
193
+ }
139
194
  }
140
195
 
196
+ return false;
141
197
  }
@@ -1 +1 @@
1
- {"version":3,"file":"IndirectComputeCommandBuildPass.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/gpu_primitive/indirect/IndirectComputeCommandBuildPass.js"],"names":[],"mappings":"AAgMA;;;;;;;;GAQG;AACH,sGAJW,MAAM,QACN,OAAO,GACL,yBAAyB,CAIrC;AACD;;;;;;;;;;;GAWG;AACH,gFAVW,MAAM,iFAGN,MAAM,oDAEN,MAAM,SACN,OAAO,QAqFjB;AAED;;;;;;;GAOG;AACH,gFALW,MAAM,mBACN,MAAM,SACN,OAAO,GACL,MAAM,CAkClB;AAzJD,2EAIE;0CAzLwC,mEAAmE;yCACpE,mDAAmD"}
1
+ {"version":3,"file":"IndirectComputeCommandBuildPass.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/gpu_primitive/indirect/IndirectComputeCommandBuildPass.js"],"names":[],"mappings":"AAuLA;;;;;;;;GAQG;AACH,sGAJW,MAAM,QACN,OAAO,GACL,yBAAyB,CAIrC;AACD;;;;;;;;;;;GAWG;AACH,gFAVW,MAAM,iFAGN,MAAM,oDAEN,MAAM,SACN,OAAO,QAqFjB;AAED;;;;;;;GAOG;AACH,gFALW,MAAM,mBACN,MAAM,SACN,OAAO,GACL,MAAM,CAkClB;AAzJD,2EAIE;0CAhLwC,mEAAmE;yCACpE,mDAAmD"}