@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":"CLIPMAP_LEVEL_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.js"],"names":[],"mappings":"AAIA;;;GAGG;AACH,kCAFU,MAAM,CAEsB;AAEtC;;;;;;;GAOG;AACH,mCAFU,YAAY,CAeH;AAEnB;;;GAGG;AACH,kCAFU,WAAW,CAE0E;6BAnClE,4BAA4B;4BAD7B,2BAA2B"}
1
+ {"version":3,"file":"CLIPMAP_LEVEL_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/clipmap/CLIPMAP_LEVEL_STRUCT.js"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,mCAFU,YAAY,CAeH;AAEnB;;;;;GAKG;AACH,kCAFU,MAAM,CAEqH;AAErI;;;GAGG;AACH,kCAFU,WAAW,CAE0E;6BArClE,4BAA4B;4BAD7B,2BAA2B"}
@@ -1,13 +1,8 @@
1
+ import { WEBGPU_GUARANTEED_MAX_UNIFORM_BUFFER_BINDING_SIZE } from "../../../gpu_primitive/WEBGPU_GUARANTEED_MAX_UNIFORM_BUFFER_BINDING_SIZE.js";
1
2
  import { f32, vec3i } from "../../type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
2
3
  import { WebGPUArray } from "../../type/WebGPUArray.js";
3
4
  import { WebGPUStruct } from "../../type/WebGPUStruct.js";
4
5
 
5
- /**
6
- * Levels a clipmap table holds at most, and how far `clipmap_select_finest` walks.
7
- * @type {number}
8
- */
9
- export const CLIPMAP_LEVEL_LIMIT = 16;
10
-
11
6
  /**
12
7
  * One level of a clipmap as a shader reads it: the level's window, and how big its cell is. Levels
13
8
  * sit finest first in a {@link CLIPMAP_LEVEL_ARRAY}.
@@ -32,7 +27,15 @@ export const CLIPMAP_LEVEL_STRUCT = WebGPUStruct.from({
32
27
  }, "ClipmapLevel");
33
28
 
34
29
  /**
35
- * A clipmap's table of levels, as a field of the uniform that carries it.
30
+ * Levels a clipmap table holds: as many as fill the uniform binding every device allows, 2,048. The
31
+ * table is a uniform, whose length its type fixes, so this is the most levels any clipmap can have;
32
+ * a walk over it stops at the clipmap's own count, and a writer uploads only the levels it has.
33
+ * @type {number}
34
+ */
35
+ export const CLIPMAP_LEVEL_LIMIT = Math.floor(WEBGPU_GUARANTEED_MAX_UNIFORM_BUFFER_BINDING_SIZE / CLIPMAP_LEVEL_STRUCT.aligned_size);
36
+
37
+ /**
38
+ * A clipmap's table of levels, a uniform of its own, {@link CLIPMAP_LEVEL_LIMIT} long.
36
39
  * @type {WebGPUArray}
37
40
  */
38
41
  export const CLIPMAP_LEVEL_ARRAY = WebGPUArray.from(CLIPMAP_LEVEL_STRUCT, CLIPMAP_LEVEL_LIMIT);
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Shared key packing/unpacking and stacked 3D indirection texel coordinates for clipmap cascades
3
+ * of cubic window resolution `resolution`:
4
+ *
5
+ * ```wgsl
6
+ * fn clipmap_key(cascade: u32, storage: vec3<u32>, resolution: u32) -> u32
7
+ * fn clipmap_key_cascade(key: u32, resolution: u32) -> u32
8
+ * fn clipmap_key_storage(key: u32, resolution: u32) -> vec3<u32>
9
+ * fn clipmap_stacked_texel(cascade: u32, storage: vec3<u32>, resolution: u32) -> vec3<u32>
10
+ * ```
11
+ *
12
+ * @type {CodeChunk}
13
+ */
14
+ export const chunk_clipmap_key: CodeChunk;
15
+ import { CodeChunk } from "../../compiler/CodeChunk.js";
16
+ //# sourceMappingURL=chunk_clipmap_key.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_clipmap_key.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_key.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,gCAFU,SAAS,CAqBjB;0BAlCwB,6BAA6B"}
@@ -0,0 +1,35 @@
1
+ import { CodeChunk } from "../../compiler/CodeChunk.js";
2
+
3
+ /**
4
+ * Shared key packing/unpacking and stacked 3D indirection texel coordinates for clipmap cascades
5
+ * of cubic window resolution `resolution`:
6
+ *
7
+ * ```wgsl
8
+ * fn clipmap_key(cascade: u32, storage: vec3<u32>, resolution: u32) -> u32
9
+ * fn clipmap_key_cascade(key: u32, resolution: u32) -> u32
10
+ * fn clipmap_key_storage(key: u32, resolution: u32) -> vec3<u32>
11
+ * fn clipmap_stacked_texel(cascade: u32, storage: vec3<u32>, resolution: u32) -> vec3<u32>
12
+ * ```
13
+ *
14
+ * @type {CodeChunk}
15
+ */
16
+ export const chunk_clipmap_key = CodeChunk.from(
17
+ //language=WGSL
18
+ `
19
+ fn clipmap_key(cascade: u32, storage: vec3<u32>, resolution: u32) -> u32 {
20
+ return (cascade * resolution + storage.z) * resolution * resolution + storage.y * resolution + storage.x;
21
+ }
22
+
23
+ fn clipmap_key_cascade(key: u32, resolution: u32) -> u32 {
24
+ return key / (resolution * resolution * resolution);
25
+ }
26
+
27
+ fn clipmap_key_storage(key: u32, resolution: u32) -> vec3<u32> {
28
+ return vec3<u32>(key % resolution, (key / resolution) % resolution, (key / (resolution * resolution)) % resolution);
29
+ }
30
+
31
+ fn clipmap_stacked_texel(cascade: u32, storage: vec3<u32>, resolution: u32) -> vec3<u32> {
32
+ return vec3<u32>(storage.x, storage.y, storage.z + cascade * resolution);
33
+ }
34
+ `
35
+ );
@@ -2,14 +2,17 @@
2
2
  * The finest level of a clipmap whose window holds a world point, and how far into that window's
3
3
  * edge band the point is.
4
4
  *
5
- * Walks the first `count` levels of the table, finest first, at most {@link CLIPMAP_LEVEL_LIMIT}; the
6
- * first whose window holds the cell the point is in answers. Its `edge_weight` is the point's distance
5
+ * Walks the first `count` levels of the table, finest first; the first whose window holds the cell the
6
+ * point is in answers. Its `edge_weight` is the point's distance
7
7
  * to the window's nearest face, in the level's cells, through a linear ramp: 0 at `band_width` cells
8
8
  * or deeper, 1 on the face. It is how much a reader blends toward the next coarser source — the
9
9
  * parent level, or whatever stands outside the coarsest. `band_width` is positive.
10
10
  *
11
11
  * A point no level holds answers `CLIPMAP_LEVEL_NONE`, with a weight of 0.
12
12
  *
13
+ * `clipmap_level_select` is one level's test, for a table that is not a {@link CLIPMAP_LEVEL_ARRAY} of its
14
+ * own: the edge weight of a point the level's window holds, or a negative one for a point it does not.
15
+ *
13
16
  * The CPU twin is `clipmap_select_finest` in `core/geom/clipmap/`.
14
17
  *
15
18
  * @type {CodeChunk}
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_clipmap_select_finest.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_select_finest.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,0CAFU,SAAS,CAoDjB;0BAtEwB,6BAA6B"}
1
+ {"version":3,"file":"chunk_clipmap_select_finest.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/clipmap/chunk_clipmap_select_finest.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AACH,0CAFU,SAAS,CA0DjB;0BA/EwB,6BAA6B"}
@@ -6,14 +6,17 @@ import { chunk_clipmap_contains } from "./chunk_clipmap_contains.js";
6
6
  * The finest level of a clipmap whose window holds a world point, and how far into that window's
7
7
  * edge band the point is.
8
8
  *
9
- * Walks the first `count` levels of the table, finest first, at most {@link CLIPMAP_LEVEL_LIMIT}; the
10
- * first whose window holds the cell the point is in answers. Its `edge_weight` is the point's distance
9
+ * Walks the first `count` levels of the table, finest first; the first whose window holds the cell the
10
+ * point is in answers. Its `edge_weight` is the point's distance
11
11
  * to the window's nearest face, in the level's cells, through a linear ramp: 0 at `band_width` cells
12
12
  * or deeper, 1 on the face. It is how much a reader blends toward the next coarser source — the
13
13
  * parent level, or whatever stands outside the coarsest. `band_width` is positive.
14
14
  *
15
15
  * A point no level holds answers `CLIPMAP_LEVEL_NONE`, with a weight of 0.
16
16
  *
17
+ * `clipmap_level_select` is one level's test, for a table that is not a {@link CLIPMAP_LEVEL_ARRAY} of its
18
+ * own: the edge weight of a point the level's window holds, or a negative one for a point it does not.
19
+ *
17
20
  * The CPU twin is `clipmap_select_finest` in `core/geom/clipmap/`.
18
21
  *
19
22
  * @type {CodeChunk}
@@ -30,6 +33,25 @@ struct ClipmapSelection {
30
33
  edge_weight: f32,
31
34
  }
32
35
 
36
+ fn clipmap_level_select(level: ClipmapLevel, position_ws: vec3f, band_width: f32) -> f32 {
37
+ // the point in the level's cells
38
+ let position_cells = position_ws / level.cell_size;
39
+
40
+ if (!clipmap_contains(vec3<i32>(floor(position_cells)), level.corner, level.size)) {
41
+ return -1.0;
42
+ }
43
+
44
+ let from_corner = position_cells - vec3f(level.corner);
45
+ let to_far_corner = vec3f(level.size) - from_corner;
46
+
47
+ let edge = min(
48
+ min(min(from_corner.x, from_corner.y), from_corner.z),
49
+ min(min(to_far_corner.x, to_far_corner.y), to_far_corner.z)
50
+ );
51
+
52
+ return saturate(1.0 - edge / band_width);
53
+ }
54
+
33
55
  fn clipmap_select_finest(
34
56
  levels: ptr<uniform, ${CLIPMAP_LEVEL_ARRAY.wgsl_ref}>,
35
57
  count: u32,
@@ -42,24 +64,11 @@ fn clipmap_select_finest(
42
64
  break;
43
65
  }
44
66
 
45
- let level = (*levels)[i];
46
-
47
- // the point in the level's cells
48
- let position_cells = position_ws / level.cell_size;
67
+ let weight = clipmap_level_select((*levels)[i], position_ws, band_width);
49
68
 
50
- if (!clipmap_contains(vec3<i32>(floor(position_cells)), level.corner, level.size)) {
51
- continue;
69
+ if (weight >= 0.0) {
70
+ return ClipmapSelection(i, weight);
52
71
  }
53
-
54
- let from_corner = position_cells - vec3f(level.corner);
55
- let to_far_corner = vec3f(level.size) - from_corner;
56
-
57
- let edge = min(
58
- min(min(from_corner.x, from_corner.y), from_corner.z),
59
- min(min(to_far_corner.x, to_far_corner.y), to_far_corner.z)
60
- );
61
-
62
- return ClipmapSelection(i, saturate(1.0 - edge / band_width));
63
72
  }
64
73
 
65
74
  return ClipmapSelection(CLIPMAP_LEVEL_NONE, 0.0);
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_sh2_color_get_irradiance_at.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh2_color_get_irradiance_at.js"],"names":[],"mappings":"AAEA;;;GAGG;AACH,gDAFU,SAAS,CAqBhB;0BAzBuB,6BAA6B"}
1
+ {"version":3,"file":"chunk_sh2_color_get_irradiance_at.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh2_color_get_irradiance_at.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,gDAFU,SAAS,CAUhB;0BAfuB,6BAA6B"}
@@ -1,4 +1,5 @@
1
1
  import { CodeChunk } from "../../compiler/CodeChunk.js";
2
+ import { chunk_sh2_color_irradiance } from "./chunk_sh2_color_irradiance.js";
2
3
 
3
4
  /**
4
5
  * Kernel is cosine convolved
@@ -8,19 +9,8 @@ export const chunk_sh2_color_get_irradiance_at = CodeChunk.from(
8
9
  //language=WGSL
9
10
  `
10
11
  fn sh2_color_get_irradiance_at(normal: vec3<f32>, coefficients: array< vec3<f32>, 4 >) -> vec3<f32>{
11
- // normal is assumed to have unit length
12
- let x = normal.x;
13
- let y = normal.y;
14
- let z = normal.z;
15
-
16
- // band 0
17
- var result = coefficients[0] * 0.8862269254527579;
18
-
19
- // band 1
20
- result += coefficients[1] * 1.0233267079464885 * y;
21
- result += coefficients[2] * 1.0233267079464885 * z;
22
- result += coefficients[3] * 1.0233267079464885 * x;
23
-
24
- return max(vec3(0),result);
12
+ return max(vec3(0), sh2_color_irradiance(normal, coefficients));
25
13
  }
26
- `);
14
+ `, [
15
+ chunk_sh2_color_irradiance,
16
+ ]);
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_sh3_convolve_with_cosine_kernel.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh3_convolve_with_cosine_kernel.js"],"names":[],"mappings":"AAMA,8DAuBG;AAEH,oEA4CC;0BA3EyB,6BAA6B"}
1
+ {"version":3,"file":"chunk_sh3_convolve_with_cosine_kernel.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh3_convolve_with_cosine_kernel.js"],"names":[],"mappings":"AAOA,8DAQG;AAEH,oEA4CC;0BA7DyB,6BAA6B"}
@@ -1,4 +1,5 @@
1
1
  import { CodeChunk } from "../../compiler/CodeChunk.js";
2
+ import { chunk_sh3_convolve_with_zh } from "./chunk_sh3_convolve_with_zh.js";
2
3
 
3
4
  const sh_cosineA0 = Math.PI;
4
5
  const sh_cosineA1 = (2.0 * Math.PI) / 3.0;
@@ -8,26 +9,11 @@ export const chunk_sh3_convolve_with_cosine_kernel = CodeChunk.from(
8
9
  //language=WGSL
9
10
  `
10
11
  fn sh3_convolve_with_cosine_kernel(sh: array<f32,9>) -> array<f32, 9>{
11
- return array<f32,9>(
12
-
13
- // band 0
14
- sh[0]*${sh_cosineA0},
15
-
16
- // band 1
17
- sh[1]*${sh_cosineA1},
18
- sh[2]*${sh_cosineA1},
19
- sh[3]*${sh_cosineA1},
20
-
21
- // band 2
22
- sh[4]*${sh_cosineA2},
23
- sh[5]*${sh_cosineA2},
24
- sh[6]*${sh_cosineA2},
25
- sh[7]*${sh_cosineA2},
26
- sh[8]*${sh_cosineA2},
27
-
28
- );
12
+ return sh3_convolve_with_zh(sh, vec3<f32>(${sh_cosineA0}, ${sh_cosineA1}, ${sh_cosineA2}));
29
13
  }
30
- `);
14
+ `, [
15
+ chunk_sh3_convolve_with_zh,
16
+ ]);
31
17
 
32
18
  export const chunk_sh3_color_convolve_with_cosine_kernel = CodeChunk.from(
33
19
  //language=WGSL
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_sh3_windowing.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/spherical_harmonics/dering/chunk_sh3_windowing.js"],"names":[],"mappings":"AAIA,4CA4BO;0BAhCmB,gCAAgC"}
1
+ {"version":3,"file":"chunk_sh3_windowing.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/spherical_harmonics/dering/chunk_sh3_windowing.js"],"names":[],"mappings":"AAIA,4CASO;0BAbmB,gCAAgC"}
@@ -1,34 +1,15 @@
1
1
  import { CodeChunk } from "../../../compiler/CodeChunk.js";
2
- import { chunk_sh_index } from "../chunk_sh_index.js";
2
+ import { chunk_sh3_convolve_with_zh } from "../chunk_sh3_convolve_with_zh.js";
3
3
  import { chunk_sinc_window } from "./chunk_sinc_window.js";
4
4
 
5
5
  export const chunk_sh3_windowing = CodeChunk.from(
6
6
  //language=WGSL
7
7
  `
8
8
  fn sh3_windowing( f:array<f32, 9>, cutoff:f32 ) -> array<f32, 9>{
9
-
10
- // scale each band individually
11
- let w0 = 1.0; //first band is always unchanged
12
- let w1 = sinc_window(1, cutoff);
13
- let w2 = sinc_window(2, cutoff);
14
-
15
- return array<f32,9>(
16
- // band 0
17
- f[0] * w0,
18
- // band 1
19
- f[1] * w1,
20
- f[2] * w1,
21
- f[3] * w1,
22
- // band 2
23
- f[4] * w2,
24
- f[5] * w2,
25
- f[6] * w2,
26
- f[7] * w2,
27
- f[8] * w2,
28
- );
9
+ return sh3_convolve_with_zh(f, vec3<f32>(1.0, sinc_window(1, cutoff), sinc_window(2, cutoff)));
29
10
  }
30
11
  `, [
12
+ chunk_sh3_convolve_with_zh,
31
13
  chunk_sinc_window,
32
- chunk_sh_index,
33
14
  ]);
34
15
 
@@ -1 +1 @@
1
- {"version":3,"file":"ShadowmapDrawSelector.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/shadow/map/ShadowmapDrawSelector.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH;IACI;;;;OAIG;IACH,UAFU,WAAW,CAEP;IAEd;;;;OAIG;IACH,aAFU,MAAM,CAEA;IAEhB;;;;;;OAMG;IACH,sBAFU,MAAM,CAES;IAEzB;;;;;OAKG;IACH,sBAFU,OAAO,CAEY;IAsC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,mBALW,WAAW,eAEX,MAAM,gBACN,MAAM,QAkFhB;;CACJ"}
1
+ {"version":3,"file":"ShadowmapDrawSelector.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/shadow/map/ShadowmapDrawSelector.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH;IACI;;;;OAIG;IACH,UAFU,WAAW,CAEP;IAEd;;;;OAIG;IACH,aAFU,MAAM,CAEA;IAEhB;;;;;;OAMG;IACH,sBAFU,MAAM,CAES;IAEzB;;;;;OAKG;IACH,sBAFU,OAAO,CAEY;IAsC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,mBALW,WAAW,eAEX,MAAM,gBACN,MAAM,QAkFhB;;CACJ"}
@@ -1,5 +1,6 @@
1
1
  import { IndexedFloatMaxHeap } from "../../../../core/collection/heap/IndexedFloatMaxHeap.js";
2
2
  import { compute_shadowmap_update_score } from "./shadowmap_update_score.js";
3
+ import { ceilPowerOfTwo } from "../../../../core/binary/operations/ceilPowerOfTwo.js";
3
4
 
4
5
  /**
5
6
  * Picks which shadowmaps get rasterized this frame, given a view budget.
@@ -92,7 +93,7 @@ export class ShadowmapDrawSelector {
92
93
  return;
93
94
  }
94
95
 
95
- const capacity = Math.max(64, 1 << (32 - Math.clz32(count - 1)));
96
+ const capacity = Math.max(64, ceilPowerOfTwo(count));
96
97
 
97
98
  this.#heap = new IndexedFloatMaxHeap(capacity);
98
99
  this.#heap_capacity = capacity;
@@ -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"}