@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
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_brick4_sh3_color_decode_from_storage.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_decode_from_storage.js"],"names":[],"mappings":"AAuBA,mEAuCE;0BA9DwB,6CAA6C"}
1
+ {"version":3,"file":"chunk_brick4_sh3_color_decode_from_storage.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_decode_from_storage.js"],"names":[],"mappings":"AAwBA,mEAiBE;0BAzCwB,6CAA6C"}
@@ -1,4 +1,5 @@
1
1
  import { CodeChunk } from "../../../../../shader/compiler/CodeChunk.js";
2
+ import { chunk_brick4_sh3_color_decode } from "./chunk_brick4_sh3_color_decode.js";
2
3
 
3
4
  /*
4
5
  * The v1 brick4 SH3 probe encoding: nine RGB coefficients as fourteen f16 pairs.
@@ -28,36 +29,14 @@ fn brick4_sh3_color_decode_from_storage_v1(
28
29
  storage_buf: ptr<storage, array<u32>>,
29
30
  offset: u32
30
31
  ) -> array<vec3<f32>, 9> {
31
- var sh: array<vec3<f32>, 9>;
32
-
33
- // Pre-fetch and unpack all 14 u32 slots into vec2<f16> pairs
34
- let v0 = unpack2x16float((*storage_buf)[offset + 0u]);
35
- let v1 = unpack2x16float((*storage_buf)[offset + 1u]);
36
- let v2 = unpack2x16float((*storage_buf)[offset + 2u]);
37
- let v3 = unpack2x16float((*storage_buf)[offset + 3u]);
38
- let v4 = unpack2x16float((*storage_buf)[offset + 4u]);
39
- let v5 = unpack2x16float((*storage_buf)[offset + 5u]);
40
- let v6 = unpack2x16float((*storage_buf)[offset + 6u]);
41
- let v7 = unpack2x16float((*storage_buf)[offset + 7u]);
42
- let v8 = unpack2x16float((*storage_buf)[offset + 8u]);
43
- let v9 = unpack2x16float((*storage_buf)[offset + 9u]);
44
- let v10 = unpack2x16float((*storage_buf)[offset + 10u]);
45
- let v11 = unpack2x16float((*storage_buf)[offset + 11u]);
46
- let v12 = unpack2x16float((*storage_buf)[offset + 12u]);
47
- let v13 = unpack2x16float((*storage_buf)[offset + 13u]);
48
-
49
- // Reconstruct the vec3s by bridging the u32 boundaries
50
- sh[0] = vec3<f32>(v0.x, v0.y, v1.x);
51
- sh[1] = vec3<f32>(v1.y, v2.x, v2.y);
52
- sh[2] = vec3<f32>(v3.x, v3.y, v4.x);
53
- sh[3] = vec3<f32>(v4.y, v5.x, v5.y);
54
- sh[4] = vec3<f32>(v6.x, v6.y, v7.x);
55
- sh[5] = vec3<f32>(v7.y, v8.x, v8.y);
56
- sh[6] = vec3<f32>(v9.x, v9.y, v10.x);
57
- sh[7] = vec3<f32>(v10.y, v11.x, v11.y);
58
- sh[8] = vec3<f32>(v12.x, v12.y, v13.x);
59
-
60
- return sh;
32
+ var packed: array<u32, 14>;
33
+ for (var i = 0u; i < 14u; i++) {
34
+ packed[i] = (*storage_buf)[offset + i];
35
+ }
36
+ return brick4_sh3_color_decode_v1(packed);
61
37
  }
62
- `
38
+ `,
39
+ [
40
+ chunk_brick4_sh3_color_decode,
41
+ ]
63
42
  );
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_brick4_sh3_color_encode_to_storage.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_encode_to_storage.js"],"names":[],"mappings":"AAuBA,iEAwBC;0BA/CyB,6CAA6C"}
1
+ {"version":3,"file":"chunk_brick4_sh3_color_encode_to_storage.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_encode_to_storage.js"],"names":[],"mappings":"AAwBA,iEAiBC;0BAzCyB,6CAA6C"}
@@ -1,4 +1,5 @@
1
1
  import { CodeChunk } from "../../../../../shader/compiler/CodeChunk.js";
2
+ import { chunk_brick4_sh3_color_encode } from "./chunk_brick4_sh3_color_encode.js";
2
3
 
3
4
  /*
4
5
  * The v1 brick4 SH3 probe encoding: nine RGB coefficients as fourteen f16 pairs.
@@ -29,20 +30,13 @@ fn brick4_sh3_color_encode_to_storage_v1(
29
30
  out_offset: u32,
30
31
  sh: array<vec3<f32>,9>
31
32
  ){
32
- (*out)[out_offset + 0u] = pack2x16float(vec2<f32>(sh[0].x, sh[0].y));
33
- (*out)[out_offset + 1u] = pack2x16float(vec2<f32>(sh[0].z, sh[1].x));
34
- (*out)[out_offset + 2u] = pack2x16float(vec2<f32>(sh[1].y, sh[1].z));
35
- (*out)[out_offset + 3u] = pack2x16float(vec2<f32>(sh[2].x, sh[2].y));
36
- (*out)[out_offset + 4u] = pack2x16float(vec2<f32>(sh[2].z, sh[3].x));
37
- (*out)[out_offset + 5u] = pack2x16float(vec2<f32>(sh[3].y, sh[3].z));
38
- (*out)[out_offset + 6u] = pack2x16float(vec2<f32>(sh[4].x, sh[4].y));
39
- (*out)[out_offset + 7u] = pack2x16float(vec2<f32>(sh[4].z, sh[5].x));
40
- (*out)[out_offset + 8u] = pack2x16float(vec2<f32>(sh[5].y, sh[5].z));
41
- (*out)[out_offset + 9u] = pack2x16float(vec2<f32>(sh[6].x, sh[6].y));
42
- (*out)[out_offset + 10u] = pack2x16float(vec2<f32>(sh[6].z, sh[7].x));
43
- (*out)[out_offset + 11u] = pack2x16float(vec2<f32>(sh[7].y, sh[7].z));
44
- (*out)[out_offset + 12u] = pack2x16float(vec2<f32>(sh[8].x, sh[8].y));
45
- (*out)[out_offset + 13u] = pack2x16float(vec2<f32>(sh[8].z, 0.0));
33
+ let packed = brick4_sh3_color_encode_v1(sh);
34
+ for (var i = 0u; i < 14u; i++) {
35
+ (*out)[out_offset + i] = packed[i];
36
+ }
46
37
  }
47
- `
38
+ `,
39
+ [
40
+ chunk_brick4_sh3_color_encode,
41
+ ]
48
42
  )
@@ -1,5 +1,6 @@
1
1
  /**
2
- * What the overlay draws: a clipmap's levels, finest first, and the width of their edge bands.
2
+ * How the overlay draws a clipmap: how many of its levels are in use, and the width of their edge
3
+ * bands. The levels themselves, finest first, are the uniform `clipmap_levels`, a {@link CLIPMAP_LEVEL_ARRAY}.
3
4
  * @type {WebGPUStruct}
4
5
  */
5
6
  export const CLIPMAP_DEBUG_STRUCT: WebGPUStruct;
@@ -1 +1 @@
1
- {"version":3,"file":"shader_debug_clipmap.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/clipmap/shader_debug_clipmap.js"],"names":[],"mappings":"AAaA;;;GAGG;AACH,mCAFU,YAAY,CAYH;AA6DnB;;;;;;;;GAQG;AACH,mCAFU,WAAW,CAWnB;6BA/F2B,mCAAmC;4BAJpC,6BAA6B"}
1
+ {"version":3,"file":"shader_debug_clipmap.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/clipmap/shader_debug_clipmap.js"],"names":[],"mappings":"AAaA;;;;GAIG;AACH,mCAFU,YAAY,CAWH;AA8DnB;;;;;;;;GAQG;AACH,mCAFU,WAAW,CAWnB;6BAhG2B,mCAAmC;4BAJpC,6BAA6B"}
@@ -12,25 +12,26 @@ import { f32, u32 } from "../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
12
12
  import { WebGPUStruct } from "../../shader/type/WebGPUStruct.js";
13
13
 
14
14
  /**
15
- * What the overlay draws: a clipmap's levels, finest first, and the width of their edge bands.
15
+ * How the overlay draws a clipmap: how many of its levels are in use, and the width of their edge
16
+ * bands. The levels themselves, finest first, are the uniform `clipmap_levels`, a {@link CLIPMAP_LEVEL_ARRAY}.
16
17
  * @type {WebGPUStruct}
17
18
  */
18
19
  export const CLIPMAP_DEBUG_STRUCT = WebGPUStruct.from({
19
20
  /**
20
- * Levels of {@link levels} in use.
21
+ * Levels of `clipmap_levels` in use.
21
22
  */
22
23
  level_count: u32,
23
24
  /**
24
25
  * Cells, positive: how far into a window its edge band reaches.
25
26
  */
26
27
  band_width: f32,
27
- levels: CLIPMAP_LEVEL_ARRAY,
28
28
  }, "ClipmapDebug");
29
29
 
30
30
  const resources = new ShaderResourceSetDescriptor();
31
31
  resources.createGroup()
32
32
  .addTexture("tDepth")
33
33
  .addUniform("clipmap", CLIPMAP_DEBUG_STRUCT)
34
+ .addUniform("clipmap_levels", CLIPMAP_LEVEL_ARRAY)
34
35
  .addUniform("camera", CAMERA_UNIFORM_STRUCT)
35
36
  ;
36
37
 
@@ -55,7 +56,7 @@ fn main(
55
56
 
56
57
  let position_ws = project_position_from_depth(uv, device_depth, camera.view_projection_matrix_inverse);
57
58
 
58
- let selection = clipmap_select_finest(&clipmap.levels, clipmap.level_count, position_ws, clipmap.band_width);
59
+ let selection = clipmap_select_finest(&clipmap_levels, clipmap.level_count, position_ws, clipmap.band_width);
59
60
 
60
61
  if(selection.level == CLIPMAP_LEVEL_NONE){
61
62
  discard;
@@ -69,7 +70,7 @@ fn main(
69
70
  var color = mix(own_color, next_color, selection.edge_weight);
70
71
 
71
72
  // lines on the level's cell faces, two centimetres wide in the world
72
- let cell_size = clipmap.levels[selection.level].cell_size;
73
+ let cell_size = clipmap_levels[selection.level].cell_size;
73
74
  let position_cells = position_ws / cell_size;
74
75
  let to_face = min(fract(position_cells), 1.0 - fract(position_cells));
75
76
  let nearest_face = min(to_face.x, min(to_face.y, to_face.z));
@@ -1 +1 @@
1
- {"version":3,"file":"graph_reduce_atlas_to_sh.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.js"],"names":[],"mappings":"AAgHA;;;;;;;;;;GAUG;AACH;IAR+B,KAAK;IACF,KAAK;IACH,KAAK;IACd,kBAAkB,EAAlC,MAAM;IACU,kBAAkB,EAAlC,MAAM;IACY,mBAAmB,EAArC,MAAM,EAAE;IACQ,SAAS,EAAzB,MAAM;WAwDhB;AA7ID,sCAaM;0BAxCoB,0CAA0C"}
1
+ {"version":3,"file":"graph_reduce_atlas_to_sh.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.js"],"names":[],"mappings":"AAiHA;;;;;;;;;;GAUG;AACH;IAR+B,KAAK;IACF,KAAK;IACH,KAAK;IACd,kBAAkB,EAAlC,MAAM;IACU,kBAAkB,EAAlC,MAAM;IACY,mBAAmB,EAArC,MAAM,EAAE;IACQ,SAAS,EAAzB,MAAM;WAwDhB;AA7ID,sCAaM;0BAzCoB,0CAA0C"}
@@ -13,6 +13,7 @@ import { graph_compute_pass } from "../../../../shader/graph/compute/graph_compu
13
13
  import { ShaderResourceSetDescriptor } from "../../../../shader/resource/ShaderResourceSetDescriptor.js";
14
14
  import { chunk_lpv_atlas_read_patch_texel } from "../sample/chunk_lpv_atlas_read_patch_texel.js";
15
15
  import { chunk_compute_coefficient_address } from "./chunk_compute_coefficient_address.js";
16
+ import { msb_32 } from "../../../../../../core/binary/msb_32.js";
16
17
 
17
18
  const PUSH_CONSTANTS = WebGPUStruct.from({
18
19
  probe_index_offset: u32,
@@ -145,7 +146,7 @@ export function graph_reduce_atlas_to_sh({
145
146
  const probes_per_row = g_buffer_resolution[0] / probe_resolution;
146
147
 
147
148
  // now convolve
148
- const mip_limit = Math.floor(Math.log2(probe_resolution));
149
+ const mip_limit = msb_32(probe_resolution);
149
150
 
150
151
  let coefficients = sh_buffer;
151
152
 
@@ -7,8 +7,10 @@
7
7
  */
8
8
  /**
9
9
  * {@link ShadeIndirectLightingMode.ProbeClipmap} for one view (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §5):
10
- * a {@link GPUBrickClipmap}, the world as rays see it, and a {@link GPUProbeClipmap}, what shading
11
- * samples, both around the view.
10
+ * a {@link GPUBrickClipmap}, the world as rays see it, and two {@link GPUProbeClipmap}s around the view
11
+ * (WORLD_PROBE_CACHE_SCOPE_2026_11_01.md): the frustum's probes, which the frame's pixels want and shading
12
+ * samples, and the world cache, which the frustum's hits want where the frustum has no probe and which only
13
+ * the probes' hits sample, in the frustum's windows at 2^k its lattice.
12
14
  *
13
15
  * The renderer holds one for its main view, as it holds the view's volumetrics, and hands it the view
14
16
  * and the settings on every frame the mode runs ({@link graph_update}). The clipmaps are made on the
@@ -26,6 +28,12 @@
26
28
  * Until its probes are traced (§13, S4) the mode lights as IBL.
27
29
  */
28
30
  export class GPUProbeClipmapGI {
31
+ /**
32
+ * @param {GPUProbeClipmap} world_cache
33
+ * @param {ProbeClipmapSettings} settings
34
+ * @returns {boolean} whether it is what the settings' world cache describes, in their frustum's windows
35
+ */
36
+ static "__#206@#world_cache_built_for"(world_cache: GPUProbeClipmap, settings: ProbeClipmapSettings): boolean;
29
37
  /**
30
38
  * @param {GraphicsContext} graphics
31
39
  */
@@ -35,9 +43,13 @@ export class GPUProbeClipmapGI {
35
43
  */
36
44
  get brick_clipmap(): GPUBrickClipmap;
37
45
  /**
38
- * @returns {GPUProbeClipmap|undefined} undefined while the mode is not running
46
+ * @returns {GPUProbeClipmap|undefined} the frustum's probes; undefined while the mode is not running
39
47
  */
40
48
  get probe_clipmap(): GPUProbeClipmap;
49
+ /**
50
+ * @returns {GPUProbeClipmap|undefined} the world cache's probes; undefined while the mode is not running
51
+ */
52
+ get world_cache(): GPUProbeClipmap;
41
53
  /**
42
54
  * @returns {ProbeClipmapSceneHolds|undefined} undefined while the mode is not running
43
55
  */
@@ -1 +1 @@
1
- {"version":3,"file":"GPUProbeClipmapGI.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js"],"names":[],"mappings":"AAeA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH;IA0DI;;OAEG;IACH,sBAFW,eAAe,EAMzB;IAED;;OAEG;IACH,qCAEC;IAED;;OAEG;IACH,qCAEC;IAED;;OAEG;IACH,oCAEC;IAED;;;;;;;;;;;;;;OAcG;IACH;QAT+B,KAAK,EAAzB,UAAU;QACc,IAAI,EAA5B,cAAc;QACgB,QAAQ,EAAtC,oBAAoB;QACJ,KAAK,EAArB,MAAM;QACU,MAAM,EAAtB,MAAM;QACK,IAAI;QACE,MAAM,GAAvB,MAAM;aA2FhB;IAED;;;OAGG;IACH,0BAEC;IAED;;;;;;;;;OASG;IACH,4CAUC;IAwDD;;;;;;;;;;OAUG;IACH;QAN+B,KAAK,EAAzB,UAAU;QACc,IAAI,EAA5B,cAAc;QACgB,QAAQ,EAAtC,oBAAoB;QACF,UAAU,EAA5B,MAAM,EAAE;QACN,MAAM,CAmBlB;IAED;;;;;OAKG;IACH,uBAFW,aAAa,QASvB;IAED;;;OAGG;IACH,0BAHW,aAAa,GACX,OAAO,CAanB;IAyCD;;;OAGG;IACH,gBAoBC;IAED,gBAcC;;CACJ;yBA9bY,OAAO,8DAA8D,EAAE,UAAU;8BACjF,OAAO,0BAA0B,EAAE,eAAe;6BAClD,OAAO,8BAA8B,EAAE,cAAc;mCACrD,OAAO,2BAA2B,EAAE,oBAAoB;4BACxD,OAAO,4BAA4B,EAAE,aAAa;gCAjB/B,4BAA4B;gCAQ5B,4BAA4B;uCAErB,6BAA6B"}
1
+ {"version":3,"file":"GPUProbeClipmapGI.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js"],"names":[],"mappings":"AAuBA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;IAoSI;;;;OAIG;IACH,oDAJW,eAAe,YACf,oBAAoB,GAClB,OAAO,CAUnB;IArOD;;OAEG;IACH,sBAFW,eAAe,EAMzB;IAED;;OAEG;IACH,qCAEC;IAED;;OAEG;IACH,qCAEC;IAED;;OAEG;IACH,mCAEC;IAED;;OAEG;IACH,oCAEC;IAED;;;;;;;;;;;;;;OAcG;IACH;QAT+B,KAAK,EAAzB,UAAU;QACc,IAAI,EAA5B,cAAc;QACgB,QAAQ,EAAtC,oBAAoB;QACJ,KAAK,EAArB,MAAM;QACU,MAAM,EAAtB,MAAM;QACK,IAAI;QACE,MAAM,GAAvB,MAAM;aAiIhB;IAqDD;;;OAGG;IACH,0BAEC;IAED;;;;;;;;;OASG;IACH,4CAUC;IAwDD;;;;;;;;;;OAUG;IACH;QAN+B,KAAK,EAAzB,UAAU;QACc,IAAI,EAA5B,cAAc;QACgB,QAAQ,EAAtC,oBAAoB;QACF,UAAU,EAA5B,MAAM,EAAE;QACN,MAAM,CAmBlB;IAED;;;;;OAKG;IACH,uBAFW,aAAa,QASvB;IAED;;;OAGG;IACH,0BAHW,aAAa,GACX,OAAO,CAanB;IAgED;;;OAGG;IACH,gBAuBC;IAED,gBAcC;;CACJ;yBA5kBY,OAAO,8DAA8D,EAAE,UAAU;8BACjF,OAAO,0BAA0B,EAAE,eAAe;6BAClD,OAAO,8BAA8B,EAAE,cAAc;mCACrD,OAAO,2BAA2B,EAAE,oBAAoB;4BACxD,OAAO,4BAA4B,EAAE,aAAa;gCAnB/B,4BAA4B;gCAQ5B,4BAA4B;uCAIrB,6BAA6B"}
@@ -1,6 +1,12 @@
1
1
  import { assert } from "../../../../core/assert.js";
2
+ import { ceilPowerOfTwo } from "../../../../core/binary/operations/ceilPowerOfTwo.js";
2
3
  import { BufferDescriptor } from "../../../descriptor/buffer/BufferDescriptor.js";
4
+ import {
5
+ graph_build_world_light_clusters,
6
+ world_light_clusters_data_size
7
+ } from "../../light/world_cluster/graph_build_world_light_clusters.js";
3
8
  import { CLIPMAP_LEVEL_ARRAY } from "../../shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.js";
9
+ import { graph_import_buffer } from "../../shader/graph/graph_import_buffer.js";
4
10
  import { GPUBrickClipmap } from "./brick/GPUBrickClipmap.js";
5
11
  import { MeshSDFBrickProvider } from "./brick/mesh/MeshSDFBrickProvider.js";
6
12
  import { graph_probe_clipmap_debug_brick_clipmap } from "./debug/graph_probe_clipmap_debug_brick_clipmap.js";
@@ -10,7 +16,9 @@ import { ProbeClipmapDebugView } from "./debug/ProbeClipmapDebugView.js";
10
16
  import { PROBE_RECORD_STRUCT } from "./probe/chunk_probe_clipmap.js";
11
17
  import { PROBE_SAMPLING_STRUCT } from "./probe/chunk_probe_clipmap_pick.js";
12
18
  import { GPUProbeClipmap } from "./probe/GPUProbeClipmap.js";
13
- import { PROBE_DEPTH_TEXEL_RAYS, PROBE_RAYS_PER_TEXEL_MAX, PROBE_RAYS_PER_TEXEL_MIN } from "./probe/PROBE_CLIPMAP.js";
19
+ import { PROBE_DEPTH_TEXEL_RAYS, PROBE_RAY_CASCADE_MASK, PROBE_TEXEL_RAYS } from "./probe/PROBE_CLIPMAP.js";
20
+ import { ProbeClipmapHitWants } from "./probe/ProbeClipmapHitWants.js";
21
+ import { ProbeClipmapScreenWants } from "./probe/ProbeClipmapScreenWants.js";
14
22
  import { ProbeClipmapSceneHolds } from "./ProbeClipmapSceneHolds.js";
15
23
 
16
24
  /**
@@ -23,8 +31,10 @@ import { ProbeClipmapSceneHolds } from "./ProbeClipmapSceneHolds.js";
23
31
 
24
32
  /**
25
33
  * {@link ShadeIndirectLightingMode.ProbeClipmap} for one view (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §5):
26
- * a {@link GPUBrickClipmap}, the world as rays see it, and a {@link GPUProbeClipmap}, what shading
27
- * samples, both around the view.
34
+ * a {@link GPUBrickClipmap}, the world as rays see it, and two {@link GPUProbeClipmap}s around the view
35
+ * (WORLD_PROBE_CACHE_SCOPE_2026_11_01.md): the frustum's probes, which the frame's pixels want and shading
36
+ * samples, and the world cache, which the frustum's hits want where the frustum has no probe and which only
37
+ * the probes' hits sample, in the frustum's windows at 2^k its lattice.
28
38
  *
29
39
  * The renderer holds one for its main view, as it holds the view's volumetrics, and hands it the view
30
40
  * and the settings on every frame the mode runs ({@link graph_update}). The clipmaps are made on the
@@ -53,10 +63,28 @@ export class GPUProbeClipmapGI {
53
63
  #brick_clipmap = undefined;
54
64
 
55
65
  /**
66
+ * The frustum's probes.
56
67
  * @type {GPUProbeClipmap|undefined}
57
68
  */
58
69
  #probe_clipmap = undefined;
59
70
 
71
+ /**
72
+ * The world cache's probes.
73
+ * @type {GPUProbeClipmap|undefined}
74
+ */
75
+ #world_cache = undefined;
76
+
77
+ /** The frustum's wants, the frame's pixels. */
78
+ #screen_wants = new ProbeClipmapScreenWants();
79
+
80
+ /** The world cache's wants, the frustum's hits. @type {ProbeClipmapHitWants|undefined} */
81
+ #hit_wants = undefined;
82
+
83
+ /** The coarsest brick window's box, metres, which the world light clusters cull lights against. */
84
+ #clusters_min = [0, 0, 0];
85
+ #clusters_max = [0, 0, 0];
86
+ #clusters = { lookup: -1, data: -1 };
87
+
60
88
  /**
61
89
  * {@link GPUViewContext#id} of the view the clipmaps were made for: they hold what is around that
62
90
  * view's camera, in that view's scene.
@@ -116,12 +144,19 @@ export class GPUProbeClipmapGI {
116
144
  }
117
145
 
118
146
  /**
119
- * @returns {GPUProbeClipmap|undefined} undefined while the mode is not running
147
+ * @returns {GPUProbeClipmap|undefined} the frustum's probes; undefined while the mode is not running
120
148
  */
121
149
  get probe_clipmap() {
122
150
  return this.#probe_clipmap;
123
151
  }
124
152
 
153
+ /**
154
+ * @returns {GPUProbeClipmap|undefined} the world cache's probes; undefined while the mode is not running
155
+ */
156
+ get world_cache() {
157
+ return this.#world_cache;
158
+ }
159
+
125
160
  /**
126
161
  * @returns {ProbeClipmapSceneHolds|undefined} undefined while the mode is not running
127
162
  */
@@ -153,10 +188,14 @@ export class GPUProbeClipmapGI {
153
188
  assert.notOk(this.#destroyed, 'destroyed');
154
189
 
155
190
  // the relations between fields, checked here because each setter sees only its own field
156
- assert.greaterThanOrEqual(settings.rays_per_probe, PROBE_RAYS_PER_TEXEL_MIN * settings.radiance_resolution * settings.radiance_resolution, 'rays_per_probe must be at least radiance_resolution² / 4');
157
- assert.lessThanOrEqual(settings.rays_per_probe, PROBE_RAYS_PER_TEXEL_MAX * settings.radiance_resolution * settings.radiance_resolution, 'rays_per_probe must be at most 4·radiance_resolution²');
158
- assert.greaterThanOrEqual(settings.ray_budget, settings.rays_per_probe, 'ray_budget must be at least rays_per_probe');
191
+ assert.lessThanOrEqual(settings.rays_per_probe, PROBE_TEXEL_RAYS * settings.radiance_resolution * settings.radiance_resolution, 'rays_per_probe must be at most 64·radiance_resolution², the rays a radiance texel gathers');
192
+ assert.greaterThanOrEqual(settings.frustum_ray_budget, settings.rays_per_probe, 'frustum_ray_budget, FRUSTUM_RAY_BUDGET_FRACTION of ray_budget, must be at least rays_per_probe');
193
+ assert.lessThanOrEqual(settings.brick_cascade_count, PROBE_RAY_CASCADE_MASK + 1, "brick_cascade_count, the ray's cascade field");
194
+ assert.lessThanOrEqual(world_light_clusters_data_size(settings.brick_cascade_count), this.#graphics.device.limits.maxStorageBufferBindingSize, "brick_cascade_count, the world light clusters' data past maxStorageBufferBindingSize");
159
195
  assert.lessThanOrEqual(settings.rays_per_probe, PROBE_DEPTH_TEXEL_RAYS * settings.depth_resolution * settings.depth_resolution, 'rays_per_probe must be at most 64·depth_resolution², the rays a depth texel gathers');
196
+ assert.lessThanOrEqual(settings.world_cache_rays_per_probe, PROBE_TEXEL_RAYS * settings.world_cache_radiance_resolution ** 2, 'world_cache_rays_per_probe must be at most 64·world_cache_radiance_resolution², the rays a radiance texel gathers');
197
+ assert.lessThanOrEqual(settings.world_cache_rays_per_probe, PROBE_DEPTH_TEXEL_RAYS * settings.world_cache_depth_resolution ** 2, 'world_cache_rays_per_probe must be at most 64·world_cache_depth_resolution², the rays a depth texel gathers');
198
+ assert.greaterThanOrEqual(settings.world_ray_budget, settings.world_cache_rays_per_probe, 'world_ray_budget, the rest of ray_budget, must be at least world_cache_rays_per_probe');
160
199
 
161
200
  if (
162
201
  this.#brick_clipmap !== undefined
@@ -164,6 +203,7 @@ export class GPUProbeClipmapGI {
164
203
  view.id !== this.#view_id
165
204
  || !this.#brick_clipmap.built_for(settings)
166
205
  || !this.#probe_clipmap.built_for(settings)
206
+ || !GPUProbeClipmapGI.#world_cache_built_for(this.#world_cache, settings)
167
207
  )
168
208
  ) {
169
209
  this.release();
@@ -212,26 +252,110 @@ export class GPUProbeClipmapGI {
212
252
  movers,
213
253
  });
214
254
 
215
- // the probes the frame's pixels want, around the same anchor, updated through the bricks (§8)
216
- this.#probe_clipmap.graph_update({
255
+ const clusters = this.#graph_clusters(graph, scene);
256
+
257
+ // the probes around the same anchor, updated through the bricks (§8): the frustum's windows, and the
258
+ // world cache's in them
259
+ const frustum = this.#probe_clipmap;
260
+ const world = this.#world_cache;
261
+
262
+ frustum.place(transform[12], transform[13], transform[14]);
263
+ world.place_within(frustum);
264
+
265
+ // the world cache first: its wants read the frustum's last-frame rays, which the frustum's lifetime
266
+ // writes over
267
+ this.#hit_wants.set({ ray_budget: settings.frustum_ray_budget });
268
+
269
+ world.graph_update({
217
270
  graph,
218
- x: transform[12],
219
- y: transform[13],
220
- z: transform[14],
221
- depth,
222
- normal,
223
- camera: view.camera.buffer,
271
+ wants: this.#hit_wants,
272
+ stbn,
273
+ response_frames: settings.response_frames,
274
+ ray_budget: settings.world_ray_budget,
275
+ rays_per_probe: settings.world_cache_rays_per_probe,
276
+ brick_clipmap: this.#brick_clipmap,
277
+ bricks,
278
+ scene,
279
+ card_rows: this.#holds.rows_buffer,
280
+ // a world cache probe re-samples nothing: its radiance has no skirt for the history's taps, and the
281
+ // rays are the frustum's switch
282
+ history_resampling: false,
283
+ ray_resampling: false,
284
+ clusters,
285
+ bounce_first: frustum,
286
+ bounce_fallback: world,
287
+ });
288
+
289
+ this.#screen_wants.set({ depth, normal, camera: view.camera.buffer, stbn, resolution: view.resolution });
290
+
291
+ frustum.graph_update({
292
+ graph,
293
+ wants: this.#screen_wants,
224
294
  stbn,
225
- resolution: view.resolution,
226
295
  response_frames: settings.response_frames,
227
- ray_budget: settings.ray_budget,
296
+ ray_budget: settings.frustum_ray_budget,
228
297
  rays_per_probe: settings.rays_per_probe,
229
298
  brick_clipmap: this.#brick_clipmap,
230
299
  bricks,
231
300
  scene,
232
301
  card_rows: this.#holds.rows_buffer,
233
- resampling: settings.resampling,
302
+ history_resampling: settings.history_resampling,
303
+ ray_resampling: settings.ray_resampling,
304
+ clusters,
305
+ bounce_first: frustum,
306
+ bounce_fallback: world,
307
+ });
308
+ }
309
+
310
+ /**
311
+ * The world light clusters over the bricks' cascades, where every hit is, which both clipmaps' hits take
312
+ * their local lights from (§8.7).
313
+ *
314
+ * @param {FrameGraph} graph
315
+ * @param {import("../../scene/GPUSceneContext.js").GPUSceneContext} scene
316
+ * @returns {{lookup: number, data: number}} graph handles, held until the next call
317
+ */
318
+ #graph_clusters(graph, scene) {
319
+ const brick_clipmap = this.#brick_clipmap;
320
+ const coarsest = brick_clipmap.cascade_count - 1;
321
+ const coarsest_cell = brick_clipmap.cell_size(coarsest);
322
+
323
+ for (let axis = 0; axis < 3; axis++) {
324
+ const corner = brick_clipmap.corner(coarsest, axis);
325
+
326
+ this.#clusters_min[axis] = corner * coarsest_cell;
327
+ this.#clusters_max[axis] = (corner + brick_clipmap.resolution) * coarsest_cell;
328
+ }
329
+
330
+ const built = graph_build_world_light_clusters({
331
+ graph,
332
+ lights: scene.lights,
333
+ levels: graph_import_buffer(graph, brick_clipmap.levels, "probe_brick_levels"),
334
+ cascade_count: brick_clipmap.cascade_count,
335
+ border: 0,
336
+ coarsest_min: this.#clusters_min,
337
+ coarsest_max: this.#clusters_max,
234
338
  });
339
+
340
+ this.#clusters.lookup = built.lookup;
341
+ this.#clusters.data = built.data;
342
+
343
+ return this.#clusters;
344
+ }
345
+
346
+ /**
347
+ * @param {GPUProbeClipmap} world_cache
348
+ * @param {ProbeClipmapSettings} settings
349
+ * @returns {boolean} whether it is what the settings' world cache describes, in their frustum's windows
350
+ */
351
+ static #world_cache_built_for(world_cache, settings) {
352
+ const ratio = 2 ** settings.world_cache_spacing_shift;
353
+
354
+ return world_cache.cascade_count === settings.probe_cascade_count
355
+ && world_cache.resolution === settings.probe_cascade_resolution * ratio
356
+ && world_cache.spacing === settings.probe_spacing / ratio
357
+ && world_cache.radiance_resolution === settings.world_cache_radiance_resolution
358
+ && world_cache.depth_resolution === settings.world_cache_depth_resolution;
235
359
  }
236
360
 
237
361
  /**
@@ -408,14 +532,37 @@ export class GPUProbeClipmapGI {
408
532
  voxel_size: settings.brick_voxel_size,
409
533
  });
410
534
 
535
+ // the frustum's slots start at 2·N²·C, a power of two: a visible surface crosses each cascade as a shell a
536
+ // cell thick, doubled for the cage. The world cache's start there too: the surfaces that want it are the
537
+ // frustum's hits', not the screen's, so its own lattice says nothing of how many there are
538
+ const capacity = ceilPowerOfTwo(2 * settings.probe_cascade_resolution ** 2 * settings.probe_cascade_count);
539
+
411
540
  this.#probe_clipmap = new GPUProbeClipmap(device, {
412
541
  cascade_count: settings.probe_cascade_count,
413
542
  resolution: settings.probe_cascade_resolution,
414
543
  spacing: settings.probe_spacing,
415
544
  radiance_resolution: settings.radiance_resolution,
416
545
  depth_resolution: settings.depth_resolution,
546
+ radiance_skirt: true,
547
+ label: 'Probe clipmap',
548
+ capacity,
549
+ });
550
+
551
+ const ratio = 2 ** settings.world_cache_spacing_shift;
552
+
553
+ this.#world_cache = new GPUProbeClipmap(device, {
554
+ cascade_count: settings.probe_cascade_count,
555
+ resolution: settings.probe_cascade_resolution * ratio,
556
+ spacing: settings.probe_spacing / ratio,
557
+ radiance_resolution: settings.world_cache_radiance_resolution,
558
+ depth_resolution: settings.world_cache_depth_resolution,
559
+ radiance_skirt: false,
560
+ label: 'Probe world cache',
561
+ capacity,
417
562
  });
418
563
 
564
+ this.#hit_wants = new ProbeClipmapHitWants(this.#probe_clipmap);
565
+
419
566
  this.#view_id = view.id;
420
567
  }
421
568
 
@@ -435,6 +582,7 @@ export class GPUProbeClipmapGI {
435
582
 
436
583
  this.#brick_clipmap.destroy();
437
584
  this.#probe_clipmap.destroy();
585
+ this.#world_cache.destroy();
438
586
  this.#mesh_provider.destroy();
439
587
 
440
588
  this.#mesh_provider = undefined;
@@ -442,6 +590,8 @@ export class GPUProbeClipmapGI {
442
590
 
443
591
  this.#brick_clipmap = undefined;
444
592
  this.#probe_clipmap = undefined;
593
+ this.#world_cache = undefined;
594
+ this.#hit_wants = undefined;
445
595
  this.#view_id = -1;
446
596
  }
447
597
 
@@ -9,7 +9,8 @@
9
9
  * `GPU_DATABASE_NULL` until then and for a row out of the SDF world.
10
10
  *
11
11
  * A row is in the SDF world when its `flags` carry `MESH_FLAG_SDF_WORLD`, whatever its geometry: a
12
- * virtual geometry's cache is held as a mesh's is, and comes from its own source (`VGeoSDFProxies`).
12
+ * virtual geometry's cache is held as a mesh's is, and is its proxy's once `VGeoSDFProxies` aliases it: the
13
+ * hold and its side move to the proxy, and the pair's card set captures the proxy's layout.
13
14
  * A skinned row draws a clone: the hold and the pair are its source's,
14
15
  * whose unskinned field and cards the clone's header is aliased to (§6.3). A row written again moves
15
16
  * its hold and its pair, the new ones taken before the old ones go, so a cache or card set a row keeps
@@ -1 +1 @@
1
- {"version":3,"file":"ProbeClipmapSceneHolds.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.js"],"names":[],"mappings":"AAwDA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH;IAwEI;;;OAGG;IACH,mBAHW,eAAe,YACf,eAAe,EASzB;IAED;;OAEG;IACH,sEAEC;IAED;;;OAGG;IACH,yBAEC;IAED;;;OAGG;IACH,yBAEC;IAED;;;OAGG;IACH,mCAEC;IAED;;;OAGG;IACH,qCAEC;IAED,0BAEC;IAED;;;;;;OAMG;IACH,oBAJW,mBAAmB,YACnB,aAAa,GACX,MAAM,GAAC,SAAS,CAI5B;IAED;;;;OAIG;IACH,6BAIC;IAED,eAiBC;IAED,eAuCC;IAED;;OAEG;IACH,cAiBC;;CA4TJ;8BA1mBY,OAAO,gCAAgC,EAAE,eAAe;8BACxD,OAAO,mCAAmC,EAAE,eAAe;kCAC3D,OAAO,uCAAuC,EAAE,mBAAmB;4BACnE,OAAO,iCAAiC,EAAE,aAAa;iCACvD,OAAO,sCAAsC,EAAE,kBAAkB;8BACjE,OAAO,0BAA0B,EAAE,eAAe"}
1
+ {"version":3,"file":"ProbeClipmapSceneHolds.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.js"],"names":[],"mappings":"AAwDA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH;IAwEI;;;OAGG;IACH,mBAHW,eAAe,YACf,eAAe,EASzB;IAED;;OAEG;IACH,sEAEC;IAED;;;OAGG;IACH,yBAEC;IAED;;;OAGG;IACH,yBAEC;IAED;;;OAGG;IACH,mCAEC;IAED;;;OAGG;IACH,qCAEC;IAED,0BAEC;IAED;;;;;;OAMG;IACH,oBAJW,mBAAmB,YACnB,aAAa,GACX,MAAM,GAAC,SAAS,CAI5B;IAED;;;;OAIG;IACH,6BAIC;IAED,eAiBC;IAED,eAuCC;IAED;;OAEG;IACH,cAiBC;;CA4TJ;8BA3mBY,OAAO,gCAAgC,EAAE,eAAe;8BACxD,OAAO,mCAAmC,EAAE,eAAe;kCAC3D,OAAO,uCAAuC,EAAE,mBAAmB;4BACnE,OAAO,iCAAiC,EAAE,aAAa;iCACvD,OAAO,sCAAsC,EAAE,kBAAkB;8BACjE,OAAO,0BAA0B,EAAE,eAAe"}
@@ -65,7 +65,8 @@ class Pair {
65
65
  * `GPU_DATABASE_NULL` until then and for a row out of the SDF world.
66
66
  *
67
67
  * A row is in the SDF world when its `flags` carry `MESH_FLAG_SDF_WORLD`, whatever its geometry: a
68
- * virtual geometry's cache is held as a mesh's is, and comes from its own source (`VGeoSDFProxies`).
68
+ * virtual geometry's cache is held as a mesh's is, and is its proxy's once `VGeoSDFProxies` aliases it: the
69
+ * hold and its side move to the proxy, and the pair's card set captures the proxy's layout.
69
70
  * A skinned row draws a clone: the hold and the pair are its source's,
70
71
  * whose unskinned field and cards the clone's header is aliased to (§6.3). A row written again moves
71
72
  * its hold and its pair, the new ones taken before the old ones go, so a cache or card set a row keeps