@woosh/meep-engine 3.60.6 → 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 (326) hide show
  1. package/build/bundle-worker-terrain.js +1 -1
  2. package/package.json +1 -1
  3. package/src/core/binary/BitSet.d.ts.map +1 -1
  4. package/src/core/binary/BitSet.js +2 -1
  5. package/src/{format/image/avif/av1/util → core/binary/operations}/ceil_log2.d.ts +2 -2
  6. package/src/core/binary/operations/ceil_log2.d.ts.map +1 -0
  7. package/src/{format/image/avif/av1/util → core/binary/operations}/ceil_log2.js +18 -18
  8. package/src/core/binary/zstd/ZstdReverseBitReader.d.ts.map +1 -1
  9. package/src/core/binary/zstd/ZstdReverseBitReader.js +225 -223
  10. package/src/core/binary/zstd/zstd_fse.d.ts.map +1 -1
  11. package/src/core/binary/zstd/zstd_fse.js +267 -265
  12. package/src/core/binary/zstd/zstd_huffman.d.ts.map +1 -1
  13. package/src/core/binary/zstd/zstd_huffman.js +246 -244
  14. package/src/core/bvh2/binary/2/BinaryUint32BVH.d.ts.map +1 -1
  15. package/src/core/bvh2/binary/2/BinaryUint32BVH.js +8 -2
  16. package/src/core/bvh2/bvh3/ebvh_optimize_treelet.d.ts.map +1 -1
  17. package/src/core/bvh2/bvh3/ebvh_optimize_treelet.js +8 -7
  18. package/src/core/collection/PairUint32Map.d.ts.map +1 -1
  19. package/src/core/collection/PairUint32Map.js +2 -2
  20. package/src/core/collection/Uint32Map.d.ts.map +1 -1
  21. package/src/core/collection/Uint32Map.js +2 -4
  22. package/src/core/collection/heap/FibonacciHeap.d.ts.map +1 -1
  23. package/src/core/collection/heap/FibonacciHeap.js +2 -1
  24. package/src/core/geom/2d/r-tree/StaticR2Tree.d.ts.map +1 -1
  25. package/src/core/geom/2d/r-tree/StaticR2Tree.js +8 -2
  26. package/src/core/geom/3d/shape/util/mesh_compute_triangle_edge_flags.d.ts.map +1 -1
  27. package/src/core/geom/3d/shape/util/mesh_compute_triangle_edge_flags.js +2 -3
  28. package/src/engine/graphics/texture/atlas/TextureAtlas.d.ts.map +1 -1
  29. package/src/engine/graphics/texture/atlas/TextureAtlas.js +13 -14
  30. package/src/engine/graphics/texture/atlas/sprite_atlas_border.d.ts.map +1 -1
  31. package/src/engine/graphics/texture/atlas/sprite_atlas_border.js +70 -69
  32. package/src/engine/graphics/texture/reflection/convolve_equirectangular_reflection.d.ts.map +1 -1
  33. package/src/engine/graphics/texture/reflection/convolve_equirectangular_reflection.js +2 -1
  34. package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts.map +1 -1
  35. package/src/engine/graphics3/GPUParticleEmitterSystem.js +2 -1
  36. package/src/engine/graphics3/decal/GPUDecalRenderer.d.ts.map +1 -1
  37. package/src/engine/graphics3/decal/GPUDecalRenderer.js +2 -1
  38. package/src/engine/graphics3/decal/chunk_decal_record.d.ts +14 -0
  39. package/src/engine/graphics3/decal/chunk_decal_record.d.ts.map +1 -0
  40. package/src/engine/graphics3/decal/chunk_decal_record.js +44 -0
  41. package/src/engine/graphics3/decal/shader_cluster_assign_decals.d.ts.map +1 -1
  42. package/src/engine/graphics3/decal/shader_cluster_assign_decals.js +2 -15
  43. package/src/engine/graphics3/decal/shader_cull_decals_frustum.d.ts.map +1 -1
  44. package/src/engine/graphics3/decal/shader_cull_decals_frustum.js +3 -16
  45. package/src/engine/graphics3/decal/shader_decal_composite.d.ts.map +1 -1
  46. package/src/engine/graphics3/decal/shader_decal_composite.js +3 -23
  47. package/src/engine/graphics3/terrain/TERRAIN_MATERIAL_TEMPLATE.d.ts.map +1 -1
  48. package/src/engine/graphics3/terrain/TERRAIN_MATERIAL_TEMPLATE.js +2 -1
  49. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  50. package/src/engine/physics/queries/shape_cast.js +2 -2
  51. package/src/format/image/avif/av1/decode/decode_palette.js +442 -442
  52. package/src/format/image/avif/av1/entropy/SymbolWriter.d.ts.map +1 -1
  53. package/src/format/image/avif/av1/entropy/SymbolWriter.js +2 -1
  54. package/src/generation/foliage/material/foliage_tile.d.ts.map +1 -1
  55. package/src/generation/foliage/material/foliage_tile.js +2 -1
  56. package/src/shade/device/mock/SoftwareGPUDevice.d.ts.map +1 -1
  57. package/src/shade/device/mock/SoftwareGPUDevice.js +6 -13
  58. package/src/shade/playground/caldera/main.js +3 -2
  59. package/src/shade/playground/probe_clipmap/README.md +2 -1
  60. package/src/shade/playground/probe_clipmap/index.html +7 -2
  61. package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -1
  62. package/src/shade/playground/probe_clipmap/main.js +17 -7
  63. package/src/shade/playground/sh_exponential/sh_exp_playground_shaders.d.ts.map +1 -1
  64. package/src/shade/playground/sh_exponential/sh_exp_playground_shaders.js +7 -13
  65. package/src/shade/playground/vgeo_scene/main.js +2 -1
  66. package/src/shade/playground/vsm/VSMDebugOverlay.d.ts.map +1 -1
  67. package/src/shade/playground/vsm/VSMDebugOverlay.js +3 -1
  68. package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
  69. package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
  70. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +6 -6
  71. package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
  72. package/src/shade/renderer/fluid/pressure/shader_fluid_mg_coarsest.d.ts.map +1 -1
  73. package/src/shade/renderer/fluid/pressure/shader_fluid_mg_coarsest.js +5 -4
  74. package/src/shade/renderer/fluid/pressure/shader_fluid_mg_residual_restrict.d.ts.map +1 -1
  75. package/src/shade/renderer/fluid/pressure/shader_fluid_mg_residual_restrict.js +168 -166
  76. package/src/shade/renderer/fluid/pressure/shader_fluid_mg_smooth.d.ts.map +1 -1
  77. package/src/shade/renderer/fluid/pressure/shader_fluid_mg_smooth.js +221 -219
  78. package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
  79. package/src/shade/renderer/fow/shader_fog_of_war.d.ts.map +1 -1
  80. package/src/shade/renderer/fow/shader_fog_of_war.js +8 -19
  81. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts.map +1 -1
  82. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +6 -6
  83. package/src/shade/renderer/geometry/sdf/MeshSDFLayout.d.ts.map +1 -1
  84. package/src/shade/renderer/geometry/sdf/MeshSDFLayout.js +2 -1
  85. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts.map +1 -1
  86. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.js +2 -1
  87. package/src/shade/renderer/geometry/virtual/runtime/VGeoResidency.d.ts.map +1 -1
  88. package/src/shade/renderer/geometry/virtual/runtime/VGeoResidency.js +2 -1
  89. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_decode_from_storage.d.ts.map +1 -1
  90. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_decode_from_storage.js +10 -31
  91. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_encode_to_storage.d.ts.map +1 -1
  92. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v1/chunk_brick4_sh3_color_encode_to_storage.js +9 -15
  93. package/src/shade/renderer/global_illumination/clipmap/shader_debug_clipmap.d.ts +2 -1
  94. package/src/shade/renderer/global_illumination/clipmap/shader_debug_clipmap.d.ts.map +1 -1
  95. package/src/shade/renderer/global_illumination/clipmap/shader_debug_clipmap.js +6 -5
  96. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.d.ts.map +1 -1
  97. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.js +2 -1
  98. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +15 -3
  99. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
  100. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +168 -18
  101. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +98 -57
  102. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
  103. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +168 -77
  104. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts +4 -2
  105. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts.map +1 -1
  106. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.js +27 -12
  107. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.d.ts.map +1 -1
  108. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.js +12 -7
  109. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts.map +1 -1
  110. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +8 -2
  111. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.d.ts.map +1 -1
  112. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.js +5 -2
  113. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.js +1 -1
  114. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.d.ts.map +1 -1
  115. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.js +5 -3
  116. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.js +1 -1
  117. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_free.d.ts.map +1 -1
  118. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_free.js +1 -1
  119. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_movers_command.d.ts.map +1 -1
  120. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_movers_command.js +4 -2
  121. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_scroll.d.ts.map +1 -1
  122. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_scroll.js +1 -1
  123. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_store.d.ts.map +1 -1
  124. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_store.js +1 -1
  125. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_take.d.ts.map +1 -1
  126. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_take.js +3 -1
  127. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_cards.js +2 -2
  128. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts +114 -41
  129. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts.map +1 -1
  130. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js +424 -207
  131. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts +34 -25
  132. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts.map +1 -1
  133. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.js +41 -31
  134. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_RESAMPLING.d.ts +7 -5
  135. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_RESAMPLING.d.ts.map +1 -1
  136. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_RESAMPLING.js +7 -5
  137. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.d.ts +47 -0
  138. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.d.ts.map +1 -0
  139. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.js +84 -0
  140. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts +48 -0
  141. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts.map +1 -0
  142. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.js +101 -0
  143. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts +58 -4
  144. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts.map +1 -1
  145. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.js +127 -30
  146. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_cage.d.ts +18 -7
  147. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_cage.d.ts.map +1 -1
  148. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_cage.js +39 -13
  149. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.d.ts +29 -8
  150. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.d.ts.map +1 -1
  151. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.js +112 -56
  152. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_resample.d.ts +19 -0
  153. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_resample.d.ts.map +1 -0
  154. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_resample.js +35 -0
  155. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.d.ts.map +1 -1
  156. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.js +9 -3
  157. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.d.ts +3 -3
  158. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.js +5 -5
  159. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts +8 -12
  160. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts.map +1 -1
  161. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.js +23 -56
  162. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.d.ts +0 -3
  163. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.d.ts.map +1 -1
  164. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.js +11 -15
  165. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.d.ts +26 -0
  166. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.d.ts.map +1 -0
  167. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.js +173 -0
  168. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.d.ts +32 -0
  169. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.d.ts.map +1 -0
  170. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.js +166 -0
  171. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.d.ts +3 -4
  172. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.d.ts.map +1 -1
  173. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_due.js +3 -4
  174. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.d.ts.map +1 -1
  175. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_guide.js +3 -1
  176. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts +6 -12
  177. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts.map +1 -1
  178. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.js +15 -65
  179. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.d.ts.map +1 -1
  180. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_order.js +7 -2
  181. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts +4 -4
  182. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts.map +1 -1
  183. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.js +24 -17
  184. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_publish.d.ts +7 -5
  185. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_publish.d.ts.map +1 -1
  186. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_publish.js +18 -10
  187. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.d.ts +2 -2
  188. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.d.ts.map +1 -1
  189. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_ray_layout.js +9 -5
  190. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_relocate.d.ts +3 -0
  191. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_relocate.d.ts.map +1 -1
  192. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_relocate.js +9 -6
  193. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample.d.ts +1 -1
  194. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample.d.ts.map +1 -1
  195. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample.js +16 -16
  196. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample_rays.d.ts +36 -0
  197. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample_rays.d.ts.map +1 -0
  198. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_resample_rays.js +233 -0
  199. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.d.ts.map +1 -1
  200. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_schedule.js +7 -5
  201. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.d.ts.map +1 -1
  202. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.js +5 -3
  203. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts.map +1 -1
  204. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.js +10 -4
  205. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.d.ts +2 -1
  206. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.d.ts.map +1 -1
  207. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace_command.js +12 -6
  208. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.d.ts +1 -2
  209. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.d.ts.map +1 -1
  210. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.js +5 -6
  211. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.d.ts +14 -18
  212. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.d.ts.map +1 -1
  213. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.js +25 -35
  214. package/src/shade/renderer/gpu_primitive/WEBGPU_GUARANTEED_MAX_UNIFORM_BUFFER_BINDING_SIZE.d.ts +13 -0
  215. package/src/shade/renderer/gpu_primitive/WEBGPU_GUARANTEED_MAX_UNIFORM_BUFFER_BINDING_SIZE.d.ts.map +1 -0
  216. package/src/shade/renderer/gpu_primitive/WEBGPU_GUARANTEED_MAX_UNIFORM_BUFFER_BINDING_SIZE.js +12 -0
  217. package/src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.d.ts +27 -2
  218. package/src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.d.ts.map +1 -1
  219. package/src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.js +62 -6
  220. package/src/shade/renderer/gpu_primitive/indirect/IndirectComputeCommandBuildPass.d.ts.map +1 -1
  221. package/src/shade/renderer/gpu_primitive/indirect/IndirectComputeCommandBuildPass.js +10 -19
  222. package/src/shade/renderer/gpu_primitive/indirect/chunk_folded_dispatch.d.ts.map +1 -1
  223. package/src/shade/renderer/gpu_primitive/indirect/chunk_folded_dispatch.js +6 -3
  224. package/src/shade/renderer/hiz/hzb_pick_alignment.d.ts.map +1 -1
  225. package/src/shade/renderer/hiz/hzb_pick_alignment.js +149 -148
  226. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_environment_cells.d.ts.map +1 -1
  227. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_environment_cells.js +4 -2
  228. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_log_floor.d.ts.map +1 -1
  229. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_log_floor.js +6 -5
  230. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_project.d.ts.map +1 -1
  231. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_project.js +3 -1
  232. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_reference_reflectance.d.ts.map +1 -1
  233. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_reference_reflectance.js +3 -1
  234. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_solve.d.ts.map +1 -1
  235. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_solve.js +3 -1
  236. package/src/shade/renderer/light/world_cluster/WORLD_LIGHT_CLUSTER.d.ts +0 -5
  237. package/src/shade/renderer/light/world_cluster/WORLD_LIGHT_CLUSTER.d.ts.map +1 -1
  238. package/src/shade/renderer/light/world_cluster/WORLD_LIGHT_CLUSTER.js +0 -7
  239. package/src/shade/renderer/light/world_cluster/graph_build_world_light_clusters.d.ts +15 -2
  240. package/src/shade/renderer/light/world_cluster/graph_build_world_light_clusters.d.ts.map +1 -1
  241. package/src/shade/renderer/light/world_cluster/graph_build_world_light_clusters.js +51 -16
  242. package/src/shade/renderer/light/world_cluster/shader_world_cluster_assign_lights.d.ts.map +1 -1
  243. package/src/shade/renderer/light/world_cluster/shader_world_cluster_assign_lights.js +3 -2
  244. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  245. package/src/shade/renderer/postprocess/dof/raymarch/chunk_dof_lds_coc_cache.d.ts +17 -0
  246. package/src/shade/renderer/postprocess/dof/raymarch/chunk_dof_lds_coc_cache.d.ts.map +1 -0
  247. package/src/shade/renderer/postprocess/dof/raymarch/chunk_dof_lds_coc_cache.js +81 -0
  248. package/src/shade/renderer/postprocess/dof/raymarch/shader_dof_raymarch_compute.d.ts.map +1 -1
  249. package/src/shade/renderer/postprocess/dof/raymarch/shader_dof_raymarch_compute.js +5 -48
  250. package/src/shade/renderer/postprocess/dof/raymarch/shader_dof_slice_compute.d.ts.map +1 -1
  251. package/src/shade/renderer/postprocess/dof/raymarch/shader_dof_slice_compute.js +4 -44
  252. package/src/shade/renderer/postprocess/gtao/chunk_integrate_lighting_sample.d.ts.map +1 -1
  253. package/src/shade/renderer/postprocess/gtao/chunk_integrate_lighting_sample.js +4 -1
  254. package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao_with_irradiance.d.ts.map +1 -1
  255. package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao_with_irradiance.js +8 -7
  256. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  257. package/src/shade/renderer/postprocess/nss/chunk_nss_luma_derivative.d.ts.map +1 -1
  258. package/src/shade/renderer/postprocess/nss/chunk_nss_luma_derivative.js +5 -7
  259. package/src/shade/renderer/postprocess/nss/chunk_nss_tonemap.d.ts +17 -0
  260. package/src/shade/renderer/postprocess/nss/chunk_nss_tonemap.d.ts.map +1 -0
  261. package/src/shade/renderer/postprocess/nss/chunk_nss_tonemap.js +56 -0
  262. package/src/shade/renderer/postprocess/nss/shader_nss_postprocess.d.ts.map +1 -1
  263. package/src/shade/renderer/postprocess/nss/shader_nss_postprocess.js +2 -22
  264. package/src/shade/renderer/postprocess/nss/shader_nss_preprocess.d.ts.map +1 -1
  265. package/src/shade/renderer/postprocess/nss/shader_nss_preprocess.js +2 -13
  266. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
  267. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +10 -13
  268. package/src/shade/renderer/rasterize/expand/bucket/RASTERIZATION_BUCKET_LIMIT.d.ts.map +1 -1
  269. package/src/shade/renderer/rasterize/expand/bucket/RASTERIZATION_BUCKET_LIMIT.js +39 -38
  270. package/src/shade/renderer/rasterize/expand/mesh/shader_prefix_sum_to_command.d.ts.map +1 -1
  271. package/src/shade/renderer/rasterize/expand/mesh/shader_prefix_sum_to_command.js +7 -12
  272. package/src/shade/renderer/shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.d.ts +8 -6
  273. package/src/shade/renderer/shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.d.ts.map +1 -1
  274. package/src/shade/renderer/shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.js +10 -7
  275. package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_key.d.ts +16 -0
  276. package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_key.d.ts.map +1 -0
  277. package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_key.js +35 -0
  278. package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_select_finest.d.ts +5 -2
  279. package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_select_finest.d.ts.map +1 -1
  280. package/src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_select_finest.js +27 -18
  281. package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh2_color_get_irradiance_at.d.ts.map +1 -1
  282. package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh2_color_get_irradiance_at.js +5 -15
  283. package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh3_convolve_with_cosine_kernel.d.ts.map +1 -1
  284. package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh3_convolve_with_cosine_kernel.js +5 -19
  285. package/src/shade/renderer/shader/chunk/spherical_harmonics/dering/chunk_sh3_windowing.d.ts.map +1 -1
  286. package/src/shade/renderer/shader/chunk/spherical_harmonics/dering/chunk_sh3_windowing.js +3 -22
  287. package/src/shade/renderer/shadow/map/ShadowmapDrawSelector.d.ts.map +1 -1
  288. package/src/shade/renderer/shadow/map/ShadowmapDrawSelector.js +2 -1
  289. package/src/shade/renderer/volumetrics/chunk_volumetrics_sun_shadow_group_list.d.ts.map +1 -1
  290. package/src/shade/renderer/volumetrics/chunk_volumetrics_sun_shadow_group_list.js +154 -152
  291. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts.map +1 -1
  292. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.js +2 -1
  293. package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP.d.ts +3 -1
  294. package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP.d.ts.map +1 -1
  295. package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP.js +4 -3
  296. package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP_STRUCT.d.ts +7 -1
  297. package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP_STRUCT.d.ts.map +1 -1
  298. package/src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP_STRUCT.js +54 -47
  299. package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_sample.d.ts.map +1 -1
  300. package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_sample.js +371 -370
  301. package/src/shade/renderer/water/GPUWaterRenderer.d.ts.map +1 -1
  302. package/src/shade/renderer/water/GPUWaterRenderer.js +2 -1
  303. package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
  304. package/src/shade/renderer/water/surface/lod/shader_water_lod.d.ts.map +1 -1
  305. package/src/shade/renderer/water/surface/lod/shader_water_lod.js +12 -14
  306. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -1
  307. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +2 -9
  308. package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts.map +1 -1
  309. package/src/shade/renderer/water/surface/particles/chunk_water_particle.js +2 -1
  310. package/src/shade/renderer/wind/WIND_FIELD.d.ts +3 -1
  311. package/src/shade/renderer/wind/WIND_FIELD.d.ts.map +1 -1
  312. package/src/shade/renderer/wind/WIND_FIELD.js +4 -3
  313. package/src/shade/renderer/wind/WIND_FIELD_STRUCT.d.ts +8 -2
  314. package/src/shade/renderer/wind/WIND_FIELD_STRUCT.d.ts.map +1 -1
  315. package/src/shade/renderer/wind/WIND_FIELD_STRUCT.js +11 -4
  316. package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.d.ts +2 -2
  317. package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.d.ts.map +1 -1
  318. package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.js +13 -4
  319. package/src/shade/util/texture_mip_extent.d.ts.map +1 -1
  320. package/src/shade/util/texture_mip_extent.js +88 -87
  321. package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
  322. package/src/shade/wgsl/emulator/WGSLLanguageCore.js +9 -7
  323. package/src/format/image/avif/av1/util/ceil_log2.d.ts.map +0 -1
  324. package/src/shade/renderer/shader/chunk/color/chunk_hash_squirrel3.d.ts +0 -1
  325. package/src/shade/renderer/shader/chunk/color/chunk_hash_squirrel3.d.ts.map +0 -1
  326. package/src/shade/renderer/shader/chunk/color/chunk_hash_squirrel3.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_volumetrics_sun_shadow_group_list.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/volumetrics/chunk_volumetrics_sun_shadow_group_list.js"],"names":[],"mappings":"AAQA;;;;;;;GAOG;AACH,oDAFU,YAAY,CAKkB;AAExC;;;;;GAKG;AACH,kDAFU,YAAY,CAKgB;AAEtC;;;;;;;;;;GAUG;AACH,6CAFU,MAAM,CAEgC;AAEhD;;;;;;;;;;GAUG;AACH,2DAFU,MAAM,CAE+C;AAE/D;;;;;GAKG;AACH,uDAFU,MAAM,CAE0C;AAE1D;;;;;;;GAOG;AACH,sDAFU,SAAS,CA8EjB;6BAnJ2B,gCAAgC;0BAFnC,iCAAiC"}
1
+ {"version":3,"file":"chunk_volumetrics_sun_shadow_group_list.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/volumetrics/chunk_volumetrics_sun_shadow_group_list.js"],"names":[],"mappings":"AASA;;;;;;;GAOG;AACH,oDAFU,YAAY,CAKkB;AAExC;;;;;GAKG;AACH,kDAFU,YAAY,CAKgB;AAEtC;;;;;;;;;;GAUG;AACH,6CAFU,MAAM,CAEgC;AAEhD;;;;;;;;;;GAUG;AACH,2DAFU,MAAM,CAE+C;AAE/D;;;;;GAKG;AACH,uDAFU,MAAM,CAE0C;AAE1D;;;;;;;GAOG;AACH,sDAFU,SAAS,CA+EjB;6BApJ2B,gCAAgC;0BAFnC,iCAAiC"}
@@ -1,152 +1,154 @@
1
- import { chunk_grid3d_to_index } from "../shader/chunk/grid/chunk_grid3d_to_index.js";
2
- import { CodeChunk } from "../shader/compiler/CodeChunk.js";
3
- import { u32, vec3u } from "../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
4
- import { WebGPUStruct } from "../shader/type/WebGPUStruct.js";
5
- import { PARTICIPATING_MEDIA_VOLUME_STRUCT } from "./PARTICIPATING_MEDIA_VOLUME_STRUCT.js";
6
- import { VOLUMETRICS_MEDIA_GROUP_VOLUME_BUDGET } from "./chunk_volumetrics_media_group_list.js";
7
- import { VOLUMETRICS_SUN_SHADOW_WORKGROUP_RESOLUTION } from "./VOLUMETRICS_SUN_SHADOW_RESOLUTION.js";
8
-
9
- /**
10
- * Which cascade a sun-shadow build dispatch is operating on.
11
- *
12
- * Per-dispatch, uniform, read-only and eight bytes, which is the shape immediate data exists for:
13
- * no pooled buffer, no staging copy, no bind group.
14
- *
15
- * @type {WebGPUStruct}
16
- */
17
- export const VOLUMETRICS_SUN_SHADOW_BUILD_SETTINGS = WebGPUStruct.from({
18
- cascade: u32,
19
- sub_steps: u32,
20
- }, "VolumetricsSunShadowBuildSettings");
21
-
22
- /**
23
- * Which cascade and cascade voxel resolution a sun-shadow cull or brick-bin dispatch is operating on.
24
- * Packed into 16 bytes of immediate data (`vec3<u32>` + `u32`).
25
- *
26
- * @type {WebGPUStruct}
27
- */
28
- export const VOLUMETRICS_SUN_SHADOW_BIN_SETTINGS = WebGPUStruct.from({
29
- resolution: vec3u,
30
- cascade: u32,
31
- }, "VolumetricsSunShadowBinSettings");
32
-
33
- /**
34
- * Depth of one 3D brick of a sun optical-depth cascade along the sun axis, in voxels.
35
- *
36
- * Paired with {@link VOLUMETRICS_SUN_SHADOW_WORKGROUP_RESOLUTION} (`[8, 8]` in xy), each brick is an
37
- * `8x8x8` cube of cascade voxels. The bin pre-culls the cascade's participating-media volumes into a
38
- * bitmask per brick, and the column scan walks its column stack brick by brick: an empty brick skips
39
- * all eight slices in O(1), and a populated brick amortizes each volume's `scene_database` load,
40
- * local-basis projection and 4-ray slab setup across all eight slices.
41
- *
42
- * @type {number}
43
- */
44
- export const VOLUMETRICS_SUN_SHADOW_BRICK_Z = 8;
45
-
46
- /**
47
- * Maximum integer-lattice slices immediately upwind of the outermost cascade's `w = 0` entry face
48
- * (`s in [-VOLUMETRICS_SUN_SHADOW_UPWIND_LATTICE_SLICES, 0)`) integrated at the cascade's own voxel
49
- * step. Because these slices sit on the exact same world-space voxel lattice as the interior slices
50
- * `s >= 0`, snapping the cascade origin by whole voxels moves a slice across `s = 0` (`s = 0` <->
51
- * `s = -1`) without changing its coverage, fade or noise sample point. Any volume extending further
52
- * upwind (`s < -16`) integrates its deep upwind tail in at most
53
- * `VOLUMETRICS_SUN_SHADOW_UPWIND_TAIL_STEPS` steps.
54
- *
55
- * @type {number}
56
- */
57
- export const VOLUMETRICS_SUN_SHADOW_UPWIND_LATTICE_SLICES = 16;
58
-
59
- /**
60
- * Quadrature steps for the deep upwind tail (`s < -VOLUMETRICS_SUN_SHADOW_UPWIND_LATTICE_SLICES`)
61
- * ahead of the outermost cascade.
62
- *
63
- * @type {number}
64
- */
65
- export const VOLUMETRICS_SUN_SHADOW_UPWIND_TAIL_STEPS = 8;
66
-
67
- /**
68
- * Brick-grid addressing and 6-axis OBB-vs-cascade-box culling for the sun optical-depth cascades,
69
- * shared by {@link shader_volumetrics_cull_sun_shadow_media},
70
- * {@link shader_volumetrics_bin_sun_shadow_media} and
71
- * {@link shader_volumetrics_build_sun_shadow_volume_outermost}.
72
- *
73
- * @type {CodeChunk}
74
- */
75
- export const chunk_volumetrics_sun_shadow_group_list = CodeChunk.from(
76
- //language=WGSL
77
- `
78
- const VOLUMETRICS_SUN_SHADOW_GROUP_XY = vec2<u32>(${VOLUMETRICS_SUN_SHADOW_WORKGROUP_RESOLUTION[0]}u, ${VOLUMETRICS_SUN_SHADOW_WORKGROUP_RESOLUTION[1]}u);
79
- const VOLUMETRICS_SUN_SHADOW_BRICK_Z: u32 = ${VOLUMETRICS_SUN_SHADOW_BRICK_Z}u;
80
- const VOLUMETRICS_SUN_SHADOW_VOLUME_BUDGET: u32 = ${VOLUMETRICS_MEDIA_GROUP_VOLUME_BUDGET}u;
81
-
82
- fn volumetrics_sun_shadow_interior_bricks_z(resolution_z: u32) -> u32 {
83
- return (resolution_z + VOLUMETRICS_SUN_SHADOW_BRICK_Z - 1u) / VOLUMETRICS_SUN_SHADOW_BRICK_Z;
84
- }
85
-
86
- // Brick grid of one cascade: interior bricks in 0 .. interior_z - 1, plus one upwind layer at
87
- // z = interior_z for volumes between the sun and the outermost cascade's w = 0 entry face.
88
- fn volumetrics_sun_shadow_groups(resolution: vec3<u32>) -> vec3<u32> {
89
- let xy = (resolution.xy + VOLUMETRICS_SUN_SHADOW_GROUP_XY - vec2<u32>(1u)) / VOLUMETRICS_SUN_SHADOW_GROUP_XY;
90
- let z = volumetrics_sun_shadow_interior_bricks_z(resolution.z) + 1u;
91
- return vec3<u32>(xy, z);
92
- }
93
-
94
- fn volumetrics_sun_shadow_list_words(volume_count: u32, buffer_words: u32, groups: vec3<u32>) -> u32 {
95
- let total_groups = max(1u, groups.x * groups.y * groups.z);
96
- return min((volume_count + 31u) / 32u, buffer_words / total_groups);
97
- }
98
-
99
- fn volumetrics_sun_shadow_list_offset(group: vec3<u32>, groups: vec3<u32>, list_words: u32) -> u32 {
100
- return grid3d_to_index(group, groups.xy) * list_words;
101
- }
102
-
103
- // 6-axis separating-axis test between an axis-aligned box [uvw_min, uvw_max] in sun-cascade UVW
104
- // space and a volume's unit box [-0.5, +0.5]^3 in its own local space.
105
- //
106
- // First projects the volume's unit box into cascade UVW space to test the 3 sun-cascade axes and
107
- // clamp [uvw_min, uvw_max] to the volume's own UVW bounds [vol_uvw_min, vol_uvw_max]. That clamp is
108
- // what keeps a semi-infinite upwind prism (uvw_min.z = -F32_MAX) finite and tight before mapping the
109
- // intersection box into volume-local space to test the volume's 3 OBB face axes.
110
- fn volumetrics_volume_in_sun_box(
111
- uvw_min: vec3<f32>,
112
- uvw_max: vec3<f32>,
113
- ws_to_uvw: mat4x4<f32>,
114
- uvw_to_ws: mat4x4<f32>,
115
- volume: ${PARTICIPATING_MEDIA_VOLUME_STRUCT.wgsl_ref},
116
- ) -> bool {
117
- let local_to_uvw = ws_to_uvw * volume.transform;
118
- let vol_uvw_center = local_to_uvw[3].xyz;
119
- let vol_uvw_half = 0.5 * (
120
- abs(local_to_uvw[0].xyz) +
121
- abs(local_to_uvw[1].xyz) +
122
- abs(local_to_uvw[2].xyz)
123
- );
124
-
125
- let vol_uvw_min = vol_uvw_center - vol_uvw_half;
126
- let vol_uvw_max = vol_uvw_center + vol_uvw_half;
127
-
128
- let b_min = max(uvw_min, vol_uvw_min);
129
- let b_max = min(uvw_max, vol_uvw_max);
130
-
131
- if (any(b_max < b_min)) {
132
- return false;
133
- }
134
-
135
- let uvw_to_local = volume.transform_inverse * uvw_to_ws;
136
- let b_center = (b_min + b_max) * 0.5;
137
- let b_half = (b_max - b_min) * 0.5;
138
-
139
- let local_center = (uvw_to_local * vec4<f32>(b_center, 1.0)).xyz;
140
- let local_half = abs(uvw_to_local[0].xyz) * b_half.x
141
- + abs(uvw_to_local[1].xyz) * b_half.y
142
- + abs(uvw_to_local[2].xyz) * b_half.z;
143
-
144
- return all(abs(local_center) <= vec3<f32>(0.5005) + local_half);
145
- }
146
- `,
147
- [
148
- PARTICIPATING_MEDIA_VOLUME_STRUCT.declaration_chunk,
149
- chunk_grid3d_to_index,
150
- ]
151
- );
152
-
1
+ import { chunk_grid3d_to_index } from "../shader/chunk/grid/chunk_grid3d_to_index.js";
2
+ import { chunk_divide_round_up_u32 } from "../shader/chunk/math/chunk_divide_round_up_u32.js";
3
+ import { CodeChunk } from "../shader/compiler/CodeChunk.js";
4
+ import { u32, vec3u } from "../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
5
+ import { WebGPUStruct } from "../shader/type/WebGPUStruct.js";
6
+ import { PARTICIPATING_MEDIA_VOLUME_STRUCT } from "./PARTICIPATING_MEDIA_VOLUME_STRUCT.js";
7
+ import { VOLUMETRICS_MEDIA_GROUP_VOLUME_BUDGET } from "./chunk_volumetrics_media_group_list.js";
8
+ import { VOLUMETRICS_SUN_SHADOW_WORKGROUP_RESOLUTION } from "./VOLUMETRICS_SUN_SHADOW_RESOLUTION.js";
9
+
10
+ /**
11
+ * Which cascade a sun-shadow build dispatch is operating on.
12
+ *
13
+ * Per-dispatch, uniform, read-only and eight bytes, which is the shape immediate data exists for:
14
+ * no pooled buffer, no staging copy, no bind group.
15
+ *
16
+ * @type {WebGPUStruct}
17
+ */
18
+ export const VOLUMETRICS_SUN_SHADOW_BUILD_SETTINGS = WebGPUStruct.from({
19
+ cascade: u32,
20
+ sub_steps: u32,
21
+ }, "VolumetricsSunShadowBuildSettings");
22
+
23
+ /**
24
+ * Which cascade and cascade voxel resolution a sun-shadow cull or brick-bin dispatch is operating on.
25
+ * Packed into 16 bytes of immediate data (`vec3<u32>` + `u32`).
26
+ *
27
+ * @type {WebGPUStruct}
28
+ */
29
+ export const VOLUMETRICS_SUN_SHADOW_BIN_SETTINGS = WebGPUStruct.from({
30
+ resolution: vec3u,
31
+ cascade: u32,
32
+ }, "VolumetricsSunShadowBinSettings");
33
+
34
+ /**
35
+ * Depth of one 3D brick of a sun optical-depth cascade along the sun axis, in voxels.
36
+ *
37
+ * Paired with {@link VOLUMETRICS_SUN_SHADOW_WORKGROUP_RESOLUTION} (`[8, 8]` in xy), each brick is an
38
+ * `8x8x8` cube of cascade voxels. The bin pre-culls the cascade's participating-media volumes into a
39
+ * bitmask per brick, and the column scan walks its column stack brick by brick: an empty brick skips
40
+ * all eight slices in O(1), and a populated brick amortizes each volume's `scene_database` load,
41
+ * local-basis projection and 4-ray slab setup across all eight slices.
42
+ *
43
+ * @type {number}
44
+ */
45
+ export const VOLUMETRICS_SUN_SHADOW_BRICK_Z = 8;
46
+
47
+ /**
48
+ * Maximum integer-lattice slices immediately upwind of the outermost cascade's `w = 0` entry face
49
+ * (`s in [-VOLUMETRICS_SUN_SHADOW_UPWIND_LATTICE_SLICES, 0)`) integrated at the cascade's own voxel
50
+ * step. Because these slices sit on the exact same world-space voxel lattice as the interior slices
51
+ * `s >= 0`, snapping the cascade origin by whole voxels moves a slice across `s = 0` (`s = 0` <->
52
+ * `s = -1`) without changing its coverage, fade or noise sample point. Any volume extending further
53
+ * upwind (`s < -16`) integrates its deep upwind tail in at most
54
+ * `VOLUMETRICS_SUN_SHADOW_UPWIND_TAIL_STEPS` steps.
55
+ *
56
+ * @type {number}
57
+ */
58
+ export const VOLUMETRICS_SUN_SHADOW_UPWIND_LATTICE_SLICES = 16;
59
+
60
+ /**
61
+ * Quadrature steps for the deep upwind tail (`s < -VOLUMETRICS_SUN_SHADOW_UPWIND_LATTICE_SLICES`)
62
+ * ahead of the outermost cascade.
63
+ *
64
+ * @type {number}
65
+ */
66
+ export const VOLUMETRICS_SUN_SHADOW_UPWIND_TAIL_STEPS = 8;
67
+
68
+ /**
69
+ * Brick-grid addressing and 6-axis OBB-vs-cascade-box culling for the sun optical-depth cascades,
70
+ * shared by {@link shader_volumetrics_cull_sun_shadow_media},
71
+ * {@link shader_volumetrics_bin_sun_shadow_media} and
72
+ * {@link shader_volumetrics_build_sun_shadow_volume_outermost}.
73
+ *
74
+ * @type {CodeChunk}
75
+ */
76
+ export const chunk_volumetrics_sun_shadow_group_list = CodeChunk.from(
77
+ //language=WGSL
78
+ `
79
+ const VOLUMETRICS_SUN_SHADOW_GROUP_XY = vec2<u32>(${VOLUMETRICS_SUN_SHADOW_WORKGROUP_RESOLUTION[0]}u, ${VOLUMETRICS_SUN_SHADOW_WORKGROUP_RESOLUTION[1]}u);
80
+ const VOLUMETRICS_SUN_SHADOW_BRICK_Z: u32 = ${VOLUMETRICS_SUN_SHADOW_BRICK_Z}u;
81
+ const VOLUMETRICS_SUN_SHADOW_VOLUME_BUDGET: u32 = ${VOLUMETRICS_MEDIA_GROUP_VOLUME_BUDGET}u;
82
+
83
+ fn volumetrics_sun_shadow_interior_bricks_z(resolution_z: u32) -> u32 {
84
+ return divide_round_up_u32(resolution_z, VOLUMETRICS_SUN_SHADOW_BRICK_Z);
85
+ }
86
+
87
+ // Brick grid of one cascade: interior bricks in 0 .. interior_z - 1, plus one upwind layer at
88
+ // z = interior_z for volumes between the sun and the outermost cascade's w = 0 entry face.
89
+ fn volumetrics_sun_shadow_groups(resolution: vec3<u32>) -> vec3<u32> {
90
+ let xy = (resolution.xy + VOLUMETRICS_SUN_SHADOW_GROUP_XY - vec2<u32>(1u)) / VOLUMETRICS_SUN_SHADOW_GROUP_XY;
91
+ let z = volumetrics_sun_shadow_interior_bricks_z(resolution.z) + 1u;
92
+ return vec3<u32>(xy, z);
93
+ }
94
+
95
+ fn volumetrics_sun_shadow_list_words(volume_count: u32, buffer_words: u32, groups: vec3<u32>) -> u32 {
96
+ let total_groups = max(1u, groups.x * groups.y * groups.z);
97
+ return min((volume_count + 31u) / 32u, buffer_words / total_groups);
98
+ }
99
+
100
+ fn volumetrics_sun_shadow_list_offset(group: vec3<u32>, groups: vec3<u32>, list_words: u32) -> u32 {
101
+ return grid3d_to_index(group, groups.xy) * list_words;
102
+ }
103
+
104
+ // 6-axis separating-axis test between an axis-aligned box [uvw_min, uvw_max] in sun-cascade UVW
105
+ // space and a volume's unit box [-0.5, +0.5]^3 in its own local space.
106
+ //
107
+ // First projects the volume's unit box into cascade UVW space to test the 3 sun-cascade axes and
108
+ // clamp [uvw_min, uvw_max] to the volume's own UVW bounds [vol_uvw_min, vol_uvw_max]. That clamp is
109
+ // what keeps a semi-infinite upwind prism (uvw_min.z = -F32_MAX) finite and tight before mapping the
110
+ // intersection box into volume-local space to test the volume's 3 OBB face axes.
111
+ fn volumetrics_volume_in_sun_box(
112
+ uvw_min: vec3<f32>,
113
+ uvw_max: vec3<f32>,
114
+ ws_to_uvw: mat4x4<f32>,
115
+ uvw_to_ws: mat4x4<f32>,
116
+ volume: ${PARTICIPATING_MEDIA_VOLUME_STRUCT.wgsl_ref},
117
+ ) -> bool {
118
+ let local_to_uvw = ws_to_uvw * volume.transform;
119
+ let vol_uvw_center = local_to_uvw[3].xyz;
120
+ let vol_uvw_half = 0.5 * (
121
+ abs(local_to_uvw[0].xyz) +
122
+ abs(local_to_uvw[1].xyz) +
123
+ abs(local_to_uvw[2].xyz)
124
+ );
125
+
126
+ let vol_uvw_min = vol_uvw_center - vol_uvw_half;
127
+ let vol_uvw_max = vol_uvw_center + vol_uvw_half;
128
+
129
+ let b_min = max(uvw_min, vol_uvw_min);
130
+ let b_max = min(uvw_max, vol_uvw_max);
131
+
132
+ if (any(b_max < b_min)) {
133
+ return false;
134
+ }
135
+
136
+ let uvw_to_local = volume.transform_inverse * uvw_to_ws;
137
+ let b_center = (b_min + b_max) * 0.5;
138
+ let b_half = (b_max - b_min) * 0.5;
139
+
140
+ let local_center = (uvw_to_local * vec4<f32>(b_center, 1.0)).xyz;
141
+ let local_half = abs(uvw_to_local[0].xyz) * b_half.x
142
+ + abs(uvw_to_local[1].xyz) * b_half.y
143
+ + abs(uvw_to_local[2].xyz) * b_half.z;
144
+
145
+ return all(abs(local_center) <= vec3<f32>(0.5005) + local_half);
146
+ }
147
+ `,
148
+ [
149
+ PARTICIPATING_MEDIA_VOLUME_STRUCT.declaration_chunk,
150
+ chunk_divide_round_up_u32,
151
+ chunk_grid3d_to_index,
152
+ ]
153
+ );
154
+
@@ -1 +1 @@
1
- {"version":3,"file":"GPUIrradianceClipmap.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.js"],"names":[],"mappings":"AA6CA;;;;;;;;;;;;;GAaG;AACH;IA2CI;;;;;;;OAOG;IACH;QAL4B,aAAa,GAA9B,MAAM;QAC6B,UAAU,GAA7C,MAAM,GAAC,UAAU,MAAM,CAAC;QACP,SAAS,GAA1B,MAAM;QACW,WAAW,GAA5B,MAAM;OA8DhB;IAED;;OAEG;IACH,4BAEC;IAED;;OAEG;IACH,mCAEC;IAED;;OAEG;IACH,sCAEC;IAED;;OAEG;IACH,yBAEC;IAED;;OAEG;IACH,4BAEC;IAED;;;OAGG;IACH,0BAEC;IAED;;OAEG;IACH,4CAEC;IAED;;OAEG;IACH,uBAEC;IAED;;;;;;;;OAQG;IACH,oBALW,MAAM,KACN,MAAM,KACN,MAAM,oBACN,eAAe,QAgFzB;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH;QAZsG,KAAK,EAAhG,OAAO,8DAA8D,EAAE,UAAU;QACZ,MAAM,EAA3E,OAAO,kCAAkC,EAAE,gBAAgB;QACO,SAAS,EAA3E,OAAO,gCAAgC,EAAE,eAAe;QACxC,eAAe,EAA/B,MAAM;QACoB,eAAe,GAAzC,eAAe;QACuE,MAAM,GAA5F,OAAO,oDAAoD,EAAE,cAAc;QACkB,GAAG,GAAhG,OAAO,sDAAsD,EAAE,mBAAmB;QACgB,MAAM,EAAxG,OAAO,8DAA8D,EAAE,iBAAiB;QAErE,YAAY;QAC7B;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,CAkJtD;IAED;;OAEG;IACH,gBAQC;;CACJ;+BAve8B,uCAAuC;2CAe3B,iCAAiC;gCApB5C,0CAA0C"}
1
+ {"version":3,"file":"GPUIrradianceClipmap.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.js"],"names":[],"mappings":"AA6CA;;;;;;;;;;;;;GAaG;AACH;IA2CI;;;;;;;OAOG;IACH;QAL4B,aAAa,GAA9B,MAAM;QAC6B,UAAU,GAA7C,MAAM,GAAC,UAAU,MAAM,CAAC;QACP,SAAS,GAA1B,MAAM;QACW,WAAW,GAA5B,MAAM;OA+DhB;IAED;;OAEG;IACH,4BAEC;IAED;;OAEG;IACH,mCAEC;IAED;;OAEG;IACH,sCAEC;IAED;;OAEG;IACH,yBAEC;IAED;;OAEG;IACH,4BAEC;IAED;;;OAGG;IACH,0BAEC;IAED;;OAEG;IACH,4CAEC;IAED;;OAEG;IACH,uBAEC;IAED;;;;;;;;OAQG;IACH,oBALW,MAAM,KACN,MAAM,KACN,MAAM,oBACN,eAAe,QAgFzB;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH;QAZsG,KAAK,EAAhG,OAAO,8DAA8D,EAAE,UAAU;QACZ,MAAM,EAA3E,OAAO,kCAAkC,EAAE,gBAAgB;QACO,SAAS,EAA3E,OAAO,gCAAgC,EAAE,eAAe;QACxC,eAAe,EAA/B,MAAM;QACoB,eAAe,GAAzC,eAAe;QACuE,MAAM,GAA5F,OAAO,oDAAoD,EAAE,cAAc;QACkB,GAAG,GAAhG,OAAO,sDAAsD,EAAE,mBAAmB;QACgB,MAAM,EAAxG,OAAO,8DAA8D,EAAE,iBAAiB;QAErE,YAAY;QAC7B;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,CAkJtD;IAED;;OAEG;IACH,gBAQC;;CACJ;+BAxe8B,uCAAuC;2CAe3B,iCAAiC;gCApB5C,0CAA0C"}
@@ -166,7 +166,8 @@ export class GPUIrradianceClipmap {
166
166
  this.#uniform = device.createBuffer({
167
167
  label: "GPUIrradianceClipmap/table",
168
168
  size: IRRADIANCE_CLIPMAP_STRUCT.size,
169
- usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,
169
+ // the world light clusters read the windows from its front as storage
170
+ usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,
170
171
  });
171
172
  }
172
173
 
@@ -5,7 +5,9 @@
5
5
  */
6
6
  export const IRRADIANCE_CLIPMAP_DEFAULT_CASCADE_COUNT: number;
7
7
  /**
8
- * Maximum number of cascades supported by the irradiance clipmap table.
8
+ * Cascades the irradiance clipmap holds at most: the rows of its windows and its atlas records, which
9
+ * sit in `IRRADIANCE_CLIPMAP_STRUCT`, the one uniform its readers bind and it writes whole each frame.
10
+ * The irradiance clipmap's own figure, not the shared clipmap table's, which is a uniform of its own.
9
11
  * @type {number}
10
12
  */
11
13
  export const IRRADIANCE_CLIPMAP_CASCADE_LIMIT: number;
@@ -1 +1 @@
1
- {"version":3,"file":"IRRADIANCE_CLIPMAP.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,uDAFU,MAAM,CAE0C;AAE1D;;;GAGG;AACH,+CAFU,MAAM,CAEoD;AAEpE;;;GAGG;AACH,oDAFU,MAAM,CAEwC;AAExD;;;GAGG;AACH,mDAFU,MAAM,CAEyC;AAEzD;;;;GAIG;AACH,6CAFU,MAAM,CAEgC;AAEhD;;;;;;GAMG;AACH,qDAFU,MAAM,CAEwC;AAExD;;;GAGG;AACH,8DAA4D;AAE5D;;GAEG;AACH,2IAA4E;AAE5E;;;GAGG;AACH,8CAFU,MAAM,CAEkC"}
1
+ {"version":3,"file":"IRRADIANCE_CLIPMAP.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,uDAFU,MAAM,CAE0C;AAE1D;;;;;GAKG;AACH,+CAFU,MAAM,CAEmC;AAEnD;;;GAGG;AACH,oDAFU,MAAM,CAEwC;AAExD;;;GAGG;AACH,mDAFU,MAAM,CAEyC;AAEzD;;;;GAIG;AACH,6CAFU,MAAM,CAEgC;AAEhD;;;;;;GAMG;AACH,qDAFU,MAAM,CAEwC;AAExD;;;GAGG;AACH,8DAA4D;AAE5D;;GAEG;AACH,2IAA4E;AAE5E;;;GAGG;AACH,8CAFU,MAAM,CAEkC"}
@@ -1,4 +1,3 @@
1
- import { CLIPMAP_LEVEL_LIMIT } from "../../shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.js";
2
1
  import { SAMPLER_LINEAR_UPSCALE } from "../../texture/SAMPLER_LINEAR_UPSCALE.js";
3
2
 
4
3
  /**
@@ -9,10 +8,12 @@ import { SAMPLER_LINEAR_UPSCALE } from "../../texture/SAMPLER_LINEAR_UPSCALE.js"
9
8
  export const IRRADIANCE_CLIPMAP_DEFAULT_CASCADE_COUNT = 6;
10
9
 
11
10
  /**
12
- * Maximum number of cascades supported by the irradiance clipmap table.
11
+ * Cascades the irradiance clipmap holds at most: the rows of its windows and its atlas records, which
12
+ * sit in `IRRADIANCE_CLIPMAP_STRUCT`, the one uniform its readers bind and it writes whole each frame.
13
+ * The irradiance clipmap's own figure, not the shared clipmap table's, which is a uniform of its own.
13
14
  * @type {number}
14
15
  */
15
- export const IRRADIANCE_CLIPMAP_CASCADE_LIMIT = CLIPMAP_LEVEL_LIMIT;
16
+ export const IRRADIANCE_CLIPMAP_CASCADE_LIMIT = 16;
16
17
 
17
18
  /**
18
19
  * Default resolution (cells per axis) of each irradiance clipmap cascade (Decision 6.3).
@@ -3,13 +3,19 @@
3
3
  * @type {WebGPUStruct}
4
4
  */
5
5
  export const IRRADIANCE_CASCADE_STRUCT: WebGPUStruct;
6
+ /**
7
+ * The cascades' windows, finest first, as a field of {@link IRRADIANCE_CLIPMAP_STRUCT}: clipmap levels.
8
+ * @type {WebGPUArray}
9
+ */
10
+ export const IRRADIANCE_LEVEL_ARRAY: WebGPUArray;
6
11
  /**
7
12
  * @type {WebGPUArray}
8
13
  */
9
14
  export const IRRADIANCE_CASCADE_ARRAY: WebGPUArray;
10
15
  /**
11
16
  * Uniform buffer layout for the world-space irradiance clipmap (`irradiance_clipmap`).
12
- * Mirrors {@link WIND_FIELD_STRUCT} so `clipmap_select_finest` operates directly on `levels`.
17
+ * Mirrors {@link WIND_FIELD_STRUCT}: `levels` first, so the world light clusters read its windows from
18
+ * the front of the buffer.
13
19
  *
14
20
  * - `anchor`: continuous world-space camera/placement anchor (`[x, y, z]` in metres), used for
15
21
  * continuous spherical cascade selection so blend weights never stair-step when integer cascade
@@ -1 +1 @@
1
- {"version":3,"file":"IRRADIANCE_CLIPMAP_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP_STRUCT.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wCAFU,YAAY,CASE;AAExB;;GAEG;AACH,uCAFU,WAAW,CAKnB;AAEF;;;;;;;;;;;GAWG;AACH,wCAFU,YAAY,CASE;6BA3CK,mCAAmC;4BADpC,kCAAkC"}
1
+ {"version":3,"file":"IRRADIANCE_CLIPMAP_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/volumetrics/irradiance_clipmap/IRRADIANCE_CLIPMAP_STRUCT.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wCAFU,YAAY,CASE;AAExB;;;GAGG;AACH,qCAFU,WAAW,CAE0F;AAE/G;;GAEG;AACH,uCAFU,WAAW,CAKnB;AAEF;;;;;;;;;;;;GAYG;AACH,wCAFU,YAAY,CASE;6BAlDK,mCAAmC;4BADpC,kCAAkC"}
@@ -1,47 +1,54 @@
1
- import { CLIPMAP_LEVEL_ARRAY } from "../../shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.js";
2
- import { f32, u32, vec3f } from "../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
3
- import { WebGPUArray } from "../../shader/type/WebGPUArray.js";
4
- import { WebGPUStruct } from "../../shader/type/WebGPUStruct.js";
5
- import { IRRADIANCE_CLIPMAP_CASCADE_LIMIT } from "./IRRADIANCE_CLIPMAP.js";
6
-
7
- /**
8
- * Per-cascade atlas placement metadata for the world-space irradiance clipmap. 16 bytes.
9
- * @type {WebGPUStruct}
10
- */
11
- export const IRRADIANCE_CASCADE_STRUCT = WebGPUStruct.from({
12
- /**
13
- * The atlas texel coordinate of window-local cell 0 (`slot_origin + border`). Window-local
14
- * cell `c` has its centre at `content_origin + c + 0.5`.
15
- */
16
- content_origin: vec3f,
17
- pad0: f32,
18
- }, "IrradianceCascade");
19
-
20
- /**
21
- * @type {WebGPUArray}
22
- */
23
- export const IRRADIANCE_CASCADE_ARRAY = WebGPUArray.from(
24
- IRRADIANCE_CASCADE_STRUCT,
25
- IRRADIANCE_CLIPMAP_CASCADE_LIMIT
26
- );
27
-
28
- /**
29
- * Uniform buffer layout for the world-space irradiance clipmap (`irradiance_clipmap`).
30
- * Mirrors {@link WIND_FIELD_STRUCT} so `clipmap_select_finest` operates directly on `levels`.
31
- *
32
- * - `anchor`: continuous world-space camera/placement anchor (`[x, y, z]` in metres), used for
33
- * continuous spherical cascade selection so blend weights never stair-step when integer cascade
34
- * corners step by 1 voxel.
35
- * - `blend_skirt`: number of voxels at each cascade window's outer boundary where blending toward
36
- * the parent cascade (or far field) takes place.
37
- *
38
- * @type {WebGPUStruct}
39
- */
40
- export const IRRADIANCE_CLIPMAP_STRUCT = WebGPUStruct.from({
41
- levels: CLIPMAP_LEVEL_ARRAY,
42
- cascades: IRRADIANCE_CASCADE_ARRAY,
43
- inverse_atlas_size: vec3f,
44
- cascade_count: u32,
45
- anchor: vec3f,
46
- blend_skirt: f32,
47
- }, "IrradianceClipmap");
1
+ import { CLIPMAP_LEVEL_STRUCT } from "../../shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.js";
2
+ import { f32, u32, vec3f } from "../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
3
+ import { WebGPUArray } from "../../shader/type/WebGPUArray.js";
4
+ import { WebGPUStruct } from "../../shader/type/WebGPUStruct.js";
5
+ import { IRRADIANCE_CLIPMAP_CASCADE_LIMIT } from "./IRRADIANCE_CLIPMAP.js";
6
+
7
+ /**
8
+ * Per-cascade atlas placement metadata for the world-space irradiance clipmap. 16 bytes.
9
+ * @type {WebGPUStruct}
10
+ */
11
+ export const IRRADIANCE_CASCADE_STRUCT = WebGPUStruct.from({
12
+ /**
13
+ * The atlas texel coordinate of window-local cell 0 (`slot_origin + border`). Window-local
14
+ * cell `c` has its centre at `content_origin + c + 0.5`.
15
+ */
16
+ content_origin: vec3f,
17
+ pad0: f32,
18
+ }, "IrradianceCascade");
19
+
20
+ /**
21
+ * The cascades' windows, finest first, as a field of {@link IRRADIANCE_CLIPMAP_STRUCT}: clipmap levels.
22
+ * @type {WebGPUArray}
23
+ */
24
+ export const IRRADIANCE_LEVEL_ARRAY = WebGPUArray.from(CLIPMAP_LEVEL_STRUCT, IRRADIANCE_CLIPMAP_CASCADE_LIMIT);
25
+
26
+ /**
27
+ * @type {WebGPUArray}
28
+ */
29
+ export const IRRADIANCE_CASCADE_ARRAY = WebGPUArray.from(
30
+ IRRADIANCE_CASCADE_STRUCT,
31
+ IRRADIANCE_CLIPMAP_CASCADE_LIMIT
32
+ );
33
+
34
+ /**
35
+ * Uniform buffer layout for the world-space irradiance clipmap (`irradiance_clipmap`).
36
+ * Mirrors {@link WIND_FIELD_STRUCT}: `levels` first, so the world light clusters read its windows from
37
+ * the front of the buffer.
38
+ *
39
+ * - `anchor`: continuous world-space camera/placement anchor (`[x, y, z]` in metres), used for
40
+ * continuous spherical cascade selection so blend weights never stair-step when integer cascade
41
+ * corners step by 1 voxel.
42
+ * - `blend_skirt`: number of voxels at each cascade window's outer boundary where blending toward
43
+ * the parent cascade (or far field) takes place.
44
+ *
45
+ * @type {WebGPUStruct}
46
+ */
47
+ export const IRRADIANCE_CLIPMAP_STRUCT = WebGPUStruct.from({
48
+ levels: IRRADIANCE_LEVEL_ARRAY,
49
+ cascades: IRRADIANCE_CASCADE_ARRAY,
50
+ inverse_atlas_size: vec3f,
51
+ cascade_count: u32,
52
+ anchor: vec3f,
53
+ blend_skirt: f32,
54
+ }, "IrradianceClipmap");
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_irradiance_clipmap_sample.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_sample.js"],"names":[],"mappings":"AAsDA;;;;;;;GAOG;AACH,wDALW,OAAO,wDAAwD,EAAE,6BAA6B;IAE5E,iBAAiB,GAAnC,OAAO;IACL,OAAO,wDAAwD,EAAE,6BAA6B,CAc1G;AA3DD;;;GAGG;AACH,kDAFU,wBAAwB,CAKhC;AAEF;;;GAGG;AACH,kDAFU,wBAAwB,CAMhC;AAEF;;;GAGG;AACH,qDAFU,wBAAwB,CAMhC;AAEF;;;GAGG;AACH,kDAFU,wBAAwB,CAMhC;AAwBF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACH,8CAFU,SAAS,CAsKjB;AAOF;;;;;;;;;;;;;;GAcG;AACH,6DAFU,SAAS,CAoCjB;yCAtWuC,mDAAmD;0BADlE,oCAAoC"}
1
+ {"version":3,"file":"chunk_irradiance_clipmap_sample.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_sample.js"],"names":[],"mappings":"AAuDA;;;;;;;GAOG;AACH,wDALW,OAAO,wDAAwD,EAAE,6BAA6B;IAE5E,iBAAiB,GAAnC,OAAO;IACL,OAAO,wDAAwD,EAAE,6BAA6B,CAc1G;AA3DD;;;GAGG;AACH,kDAFU,wBAAwB,CAKhC;AAEF;;;GAGG;AACH,kDAFU,wBAAwB,CAMhC;AAEF;;;GAGG;AACH,qDAFU,wBAAwB,CAMhC;AAEF;;;GAGG;AACH,kDAFU,wBAAwB,CAMhC;AAwBF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACH,8CAFU,SAAS,CAsKjB;AAOF;;;;;;;;;;;;;;GAcG;AACH,6DAFU,SAAS,CAoCjB;yCAvWuC,mDAAmD;0BADlE,oCAAoC"}