@woosh/meep-engine 3.61.2 → 3.61.3

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 (389) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/package.json +1 -1
  3. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  4. package/src/shade/playground/probe_clipmap/README.md +3 -4
  5. package/src/shade/playground/probe_clipmap/index.html +5 -13
  6. package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -1
  7. package/src/shade/playground/probe_clipmap/main.js +0 -5
  8. package/src/shade/playground/probe_clipmap_box/README.md +1 -1
  9. package/src/shade/playground/probe_clipmap_box/index.html +1 -1
  10. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  11. package/src/shade/renderer/Renderer.js +50 -11
  12. package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
  13. package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
  14. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +6 -6
  15. package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
  16. package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
  17. package/src/shade/renderer/geometry/meshlet/meshlet_batch_colored.d.ts +10 -0
  18. package/src/shade/renderer/geometry/meshlet/meshlet_batch_colored.d.ts.map +1 -0
  19. package/src/shade/renderer/geometry/meshlet/meshlet_batch_colored.js +54 -0
  20. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts +85 -36
  21. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts.map +1 -1
  22. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +813 -412
  23. package/src/shade/renderer/geometry/sdf/MESH_SDF.d.ts +7 -0
  24. package/src/shade/renderer/geometry/sdf/MESH_SDF.d.ts.map +1 -1
  25. package/src/shade/renderer/geometry/sdf/MESH_SDF.js +8 -0
  26. package/src/shade/renderer/geometry/sdf/MESH_SDF_BRICK_KEY.d.ts +14 -0
  27. package/src/shade/renderer/geometry/sdf/MESH_SDF_BRICK_KEY.d.ts.map +1 -0
  28. package/src/shade/renderer/geometry/sdf/MESH_SDF_BRICK_KEY.js +35 -0
  29. package/src/shade/renderer/geometry/sdf/MESH_SDF_STRUCT.d.ts.map +1 -1
  30. package/src/shade/renderer/geometry/sdf/MESH_SDF_STRUCT.js +0 -4
  31. package/src/shade/renderer/geometry/sdf/bake/MESH_SDF_BAKE.d.ts +55 -10
  32. package/src/shade/renderer/geometry/sdf/bake/MESH_SDF_BAKE.d.ts.map +1 -1
  33. package/src/shade/renderer/geometry/sdf/bake/MESH_SDF_BAKE.js +86 -16
  34. package/src/shade/renderer/geometry/sdf/bake/chunk_mesh_sdf_bake.d.ts +2 -2
  35. package/src/shade/renderer/geometry/sdf/bake/chunk_mesh_sdf_bake.d.ts.map +1 -1
  36. package/src/shade/renderer/geometry/sdf/bake/chunk_mesh_sdf_bake.js +28 -2
  37. package/src/shade/renderer/geometry/sdf/bake/chunk_mesh_sdf_contents.d.ts +54 -0
  38. package/src/shade/renderer/geometry/sdf/bake/chunk_mesh_sdf_contents.d.ts.map +1 -0
  39. package/src/shade/renderer/geometry/sdf/bake/chunk_mesh_sdf_contents.js +146 -0
  40. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.d.ts +1 -1
  41. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.d.ts.map +1 -1
  42. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.js +2 -1
  43. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_content_rehash.d.ts +18 -0
  44. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_content_rehash.d.ts.map +1 -0
  45. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_content_rehash.js +66 -0
  46. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_count.d.ts +17 -0
  47. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_count.d.ts.map +1 -0
  48. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_count.js +66 -0
  49. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.d.ts +5 -3
  50. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.d.ts.map +1 -1
  51. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.js +15 -14
  52. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_free.d.ts +2 -1
  53. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_free.d.ts.map +1 -1
  54. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_free.js +12 -3
  55. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_key.d.ts +21 -0
  56. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_key.d.ts.map +1 -0
  57. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_key.js +84 -0
  58. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_resolve.d.ts +53 -0
  59. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_resolve.d.ts.map +1 -0
  60. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_resolve.js +343 -0
  61. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_store.d.ts +3 -3
  62. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_store.d.ts.map +1 -1
  63. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_store.js +9 -5
  64. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_take.d.ts +2 -2
  65. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_take.d.ts.map +1 -1
  66. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_take.js +3 -2
  67. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_upload.d.ts +69 -0
  68. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_upload.d.ts.map +1 -0
  69. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_upload.js +294 -0
  70. package/src/shade/renderer/geometry/sdf/bundle/MODEL_CACHE_BUNDLE.d.ts +16 -0
  71. package/src/shade/renderer/geometry/sdf/bundle/MODEL_CACHE_BUNDLE.d.ts.map +1 -0
  72. package/src/shade/renderer/geometry/sdf/bundle/MODEL_CACHE_BUNDLE.js +36 -0
  73. package/src/shade/renderer/geometry/sdf/bundle/ModelCacheBundle.d.ts +126 -0
  74. package/src/shade/renderer/geometry/sdf/bundle/ModelCacheBundle.d.ts.map +1 -0
  75. package/src/shade/renderer/geometry/sdf/bundle/ModelCacheBundle.js +148 -0
  76. package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_read.d.ts +10 -0
  77. package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_read.d.ts.map +1 -0
  78. package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_read.js +140 -0
  79. package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_write.d.ts +8 -0
  80. package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_write.d.ts.map +1 -0
  81. package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_write.js +76 -0
  82. package/src/shade/renderer/geometry/sdf/chunk_mesh_sdf.d.ts +9 -0
  83. package/src/shade/renderer/geometry/sdf/chunk_mesh_sdf.d.ts.map +1 -1
  84. package/src/shade/renderer/geometry/sdf/chunk_mesh_sdf.js +23 -0
  85. package/src/shade/renderer/geometry/sdf/chunk_mesh_sdf_brick_key.d.ts +13 -0
  86. package/src/shade/renderer/geometry/sdf/chunk_mesh_sdf_brick_key.d.ts.map +1 -0
  87. package/src/shade/renderer/geometry/sdf/chunk_mesh_sdf_brick_key.js +23 -0
  88. package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.d.ts +262 -0
  89. package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.d.ts.map +1 -0
  90. package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.js +1819 -0
  91. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BAKE.d.ts +118 -0
  92. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BAKE.d.ts.map +1 -0
  93. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BAKE.js +204 -0
  94. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BLOCK.d.ts +66 -0
  95. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BLOCK.d.ts.map +1 -0
  96. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BLOCK.js +103 -0
  97. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_RESOURCES.d.ts +19 -0
  98. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_RESOURCES.d.ts.map +1 -0
  99. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_RESOURCES.js +23 -0
  100. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_STRUCT.d.ts +15 -0
  101. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_STRUCT.d.ts.map +1 -0
  102. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_STRUCT.js +70 -0
  103. package/src/shade/renderer/geometry/sdf/surface/SURFACE_MATERIAL.d.ts +13 -0
  104. package/src/shade/renderer/geometry/sdf/surface/SURFACE_MATERIAL.d.ts.map +1 -0
  105. package/src/shade/renderer/geometry/sdf/surface/SURFACE_MATERIAL.js +35 -0
  106. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_block.d.ts +32 -0
  107. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_block.d.ts.map +1 -0
  108. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_block.js +111 -0
  109. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_listed.d.ts +17 -0
  110. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_listed.d.ts.map +1 -0
  111. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_listed.js +49 -0
  112. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_run_find.d.ts +13 -0
  113. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_run_find.d.ts.map +1 -0
  114. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_run_find.js +35 -0
  115. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_sample.d.ts +24 -0
  116. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_sample.d.ts.map +1 -0
  117. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_sample.js +169 -0
  118. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_texel_ray.d.ts +19 -0
  119. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_texel_ray.d.ts.map +1 -0
  120. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_texel_ray.js +49 -0
  121. package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_fit.d.ts +19 -0
  122. package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_fit.d.ts.map +1 -0
  123. package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_fit.js +67 -0
  124. package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_read.d.ts +78 -0
  125. package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_read.d.ts.map +1 -0
  126. package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_read.js +320 -0
  127. package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_store.d.ts +15 -0
  128. package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_store.d.ts.map +1 -0
  129. package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_store.js +48 -0
  130. package/src/shade/renderer/geometry/sdf/surface/mesh_surface_channels.d.ts +51 -0
  131. package/src/shade/renderer/geometry/sdf/surface/mesh_surface_channels.d.ts.map +1 -0
  132. package/src/shade/renderer/geometry/sdf/surface/mesh_surface_channels.js +109 -0
  133. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_command.d.ts +11 -0
  134. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_command.d.ts.map +1 -0
  135. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_command.js +51 -0
  136. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_encode.d.ts +26 -0
  137. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_encode.d.ts.map +1 -0
  138. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_encode.js +453 -0
  139. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_list.d.ts +12 -0
  140. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_list.d.ts.map +1 -0
  141. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_list.js +99 -0
  142. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_survey.d.ts +22 -0
  143. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_survey.d.ts.map +1 -0
  144. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_survey.js +140 -0
  145. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_trace.d.ts +32 -0
  146. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_trace.d.ts.map +1 -0
  147. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_trace.js +261 -0
  148. package/src/shade/renderer/geometry/virtual/runtime/VirtualGeometry.d.ts +2 -2
  149. package/src/shade/renderer/geometry/virtual/runtime/VirtualGeometry.js +2 -2
  150. package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.d.ts +6 -6
  151. package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.js +7 -7
  152. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +15 -7
  153. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
  154. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +82 -17
  155. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.d.ts +26 -19
  156. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.d.ts.map +1 -1
  157. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.js +226 -148
  158. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +25 -52
  159. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
  160. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +29 -69
  161. package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.d.ts +19 -16
  162. package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.d.ts.map +1 -1
  163. package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.js +24 -21
  164. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts +46 -22
  165. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts.map +1 -1
  166. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.js +49 -36
  167. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.d.ts +3 -2
  168. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.d.ts.map +1 -1
  169. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.js +7 -6
  170. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +8 -22
  171. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts.map +1 -1
  172. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +15 -51
  173. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts +1 -6
  174. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts.map +1 -1
  175. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.js +6 -13
  176. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.d.ts.map +1 -1
  177. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.js +0 -2
  178. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.d.ts +4 -4
  179. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.d.ts.map +1 -1
  180. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.js +9 -34
  181. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.d.ts +4 -6
  182. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.d.ts.map +1 -1
  183. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.js +15 -39
  184. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_clear.d.ts +1 -1
  185. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_clear.js +1 -1
  186. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_store.d.ts +1 -2
  187. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_store.d.ts.map +1 -1
  188. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_store.js +2 -6
  189. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_take.d.ts +2 -2
  190. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_take.d.ts.map +1 -1
  191. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_take.js +5 -2
  192. package/src/shade/renderer/global_illumination/probe_clipmap/debug/ProbeClipmapDebugView.d.ts +5 -1
  193. package/src/shade/renderer/global_illumination/probe_clipmap/debug/ProbeClipmapDebugView.js +16 -2
  194. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_brick_material.d.ts +45 -0
  195. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_brick_material.d.ts.map +1 -0
  196. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_brick_material.js +208 -0
  197. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_indirect.d.ts +24 -0
  198. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_indirect.d.ts.map +1 -0
  199. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_indirect.js +40 -0
  200. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_surfaces.d.ts +34 -0
  201. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_surfaces.d.ts.map +1 -0
  202. package/src/shade/renderer/global_illumination/probe_clipmap/debug/{graph_probe_clipmap_debug_mesh_cards.js → graph_probe_clipmap_debug_mesh_surfaces.js} +38 -57
  203. package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.d.ts +61 -0
  204. package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.d.ts.map +1 -0
  205. package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.js +193 -0
  206. package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material.d.ts +67 -0
  207. package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material.d.ts.map +1 -0
  208. package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material.js +142 -0
  209. package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material_cell.d.ts +32 -0
  210. package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material_cell.d.ts.map +1 -0
  211. package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material_cell.js +70 -0
  212. package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material_store.d.ts +30 -0
  213. package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material_store.d.ts.map +1 -0
  214. package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material_store.js +71 -0
  215. package/src/shade/renderer/global_illumination/probe_clipmap/material/shader_brick_material_gather.d.ts +26 -0
  216. package/src/shade/renderer/global_illumination/probe_clipmap/material/shader_brick_material_gather.d.ts.map +1 -0
  217. package/src/shade/renderer/global_illumination/probe_clipmap/material/shader_brick_material_gather.js +176 -0
  218. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts +18 -9
  219. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts.map +1 -1
  220. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js +63 -44
  221. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts +21 -1
  222. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts.map +1 -1
  223. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.js +24 -1
  224. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_INDIRECT_LOBE.d.ts +10 -0
  225. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_INDIRECT_LOBE.d.ts.map +1 -0
  226. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_INDIRECT_LOBE.js +11 -0
  227. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapIndirectLobe.d.ts +11 -0
  228. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapIndirectLobe.d.ts.map +1 -0
  229. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapIndirectLobe.js +15 -0
  230. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts +44 -7
  231. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts.map +1 -1
  232. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.js +88 -11
  233. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_material.d.ts +43 -0
  234. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_material.d.ts.map +1 -0
  235. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_material.js +138 -0
  236. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_indirect_lobe.d.ts +21 -0
  237. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_indirect_lobe.d.ts.map +1 -0
  238. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_indirect_lobe.js +49 -0
  239. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.d.ts +2 -0
  240. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.d.ts.map +1 -1
  241. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.js +10 -4
  242. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_select.d.ts +22 -0
  243. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_select.d.ts.map +1 -0
  244. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_select.js +50 -0
  245. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.d.ts +4 -4
  246. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.d.ts.map +1 -1
  247. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.js +8 -8
  248. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.d.ts +3 -3
  249. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.js +5 -5
  250. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.d.ts +2 -0
  251. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.d.ts.map +1 -1
  252. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.js +5 -1
  253. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts +1 -1
  254. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.js +2 -2
  255. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.d.ts +7 -4
  256. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.d.ts.map +1 -1
  257. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.js +30 -26
  258. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts +6 -5
  259. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts.map +1 -1
  260. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.js +22 -16
  261. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.d.ts.map +1 -1
  262. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.js +6 -2
  263. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.d.ts +2 -2
  264. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.js +6 -6
  265. package/src/shade/renderer/gpu_primitive/hash_table/chunk_generate_next_linear_congruential_index.d.ts +14 -0
  266. package/src/shade/renderer/gpu_primitive/hash_table/chunk_generate_next_linear_congruential_index.d.ts.map +1 -0
  267. package/src/shade/renderer/gpu_primitive/hash_table/chunk_generate_next_linear_congruential_index.js +22 -0
  268. package/src/shade/renderer/gpu_primitive/hash_table/chunk_hash_table_atomic.d.ts +37 -0
  269. package/src/shade/renderer/gpu_primitive/hash_table/chunk_hash_table_atomic.d.ts.map +1 -0
  270. package/src/shade/renderer/gpu_primitive/hash_table/chunk_hash_table_atomic.js +122 -0
  271. package/src/shade/renderer/gpu_primitive/hash_table/chunk_hash_table_get.d.ts.map +1 -1
  272. package/src/shade/renderer/gpu_primitive/hash_table/chunk_hash_table_get.js +1 -11
  273. package/src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.d.ts +8 -0
  274. package/src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.d.ts.map +1 -1
  275. package/src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.js +6 -4
  276. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  277. package/src/shade/renderer/material/resident/GPUResidentMaterialContext.d.ts +1 -1
  278. package/src/shade/renderer/material/resident/GPUResidentMaterialContext.d.ts.map +1 -1
  279. package/src/shade/renderer/material/resident/GPUResidentMaterialContext.js +2 -18
  280. package/src/shade/renderer/material/resident/NEUTRAL_SURFACE.d.ts +17 -0
  281. package/src/shade/renderer/material/resident/NEUTRAL_SURFACE.d.ts.map +1 -0
  282. package/src/shade/renderer/material/resident/NEUTRAL_SURFACE.js +16 -0
  283. package/src/shade/renderer/path_tracer/shader/INDIRECT_TEXTURE_FILTER.d.ts +1 -1
  284. package/src/shade/renderer/path_tracer/shader/INDIRECT_TEXTURE_FILTER.js +1 -1
  285. package/src/shade/renderer/path_tracer/shader/IndirectTextureFilter.js +1 -1
  286. package/src/shade/renderer/path_tracer/shader/chunk_beam_texture_level.d.ts +20 -0
  287. package/src/shade/renderer/path_tracer/shader/chunk_beam_texture_level.d.ts.map +1 -0
  288. package/src/shade/renderer/path_tracer/shader/chunk_beam_texture_level.js +65 -0
  289. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  290. package/src/shade/renderer/scene/GPUSceneContext.d.ts +1 -1
  291. package/src/shade/renderer/scene/GPUSceneContext.js +1 -1
  292. package/src/shade/renderer/shader/chunk/material/albedo_compress.d.ts +12 -0
  293. package/src/shade/renderer/shader/chunk/material/albedo_compress.d.ts.map +1 -0
  294. package/src/shade/renderer/shader/chunk/material/albedo_compress.js +26 -0
  295. package/src/shade/renderer/shader/chunk/material/chunk_albedo_compress.d.ts +16 -0
  296. package/src/shade/renderer/shader/chunk/material/chunk_albedo_compress.d.ts.map +1 -0
  297. package/src/shade/renderer/shader/chunk/material/chunk_albedo_compress.js +22 -0
  298. package/src/shade/renderer/shader/chunk/material/chunk_albedo_uncompress.d.ts +15 -0
  299. package/src/shade/renderer/shader/chunk/material/chunk_albedo_uncompress.d.ts.map +1 -0
  300. package/src/shade/renderer/shader/chunk/material/chunk_albedo_uncompress.js +23 -0
  301. package/src/shade/renderer/shader/chunk/material/chunk_metal_rough_compress.d.ts +16 -0
  302. package/src/shade/renderer/shader/chunk/material/chunk_metal_rough_compress.d.ts.map +1 -0
  303. package/src/shade/renderer/shader/chunk/material/chunk_metal_rough_compress.js +25 -0
  304. package/src/shade/renderer/shader/chunk/material/chunk_metal_rough_uncompress.d.ts +25 -0
  305. package/src/shade/renderer/shader/chunk/material/chunk_metal_rough_uncompress.d.ts.map +1 -0
  306. package/src/shade/renderer/shader/chunk/material/chunk_metal_rough_uncompress.js +36 -0
  307. package/src/shade/renderer/shader/chunk/material/metal_rough_compress.d.ts +11 -0
  308. package/src/shade/renderer/shader/chunk/material/metal_rough_compress.d.ts.map +1 -0
  309. package/src/shade/renderer/shader/chunk/material/metal_rough_compress.js +38 -0
  310. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot.d.ts +20 -0
  311. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot.d.ts.map +1 -0
  312. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot.js +35 -0
  313. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_compress.d.ts +28 -0
  314. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_compress.d.ts.map +1 -0
  315. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_compress.js +79 -0
  316. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_fit.d.ts +25 -0
  317. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_fit.d.ts.map +1 -0
  318. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_fit.js +89 -0
  319. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_uncompress.d.ts +31 -0
  320. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_uncompress.d.ts.map +1 -0
  321. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_uncompress.js +66 -0
  322. package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_atomic_add.d.ts.map +1 -1
  323. package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_atomic_add.js +2 -0
  324. package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_atomic_load.d.ts +17 -0
  325. package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_atomic_load.d.ts.map +1 -0
  326. package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_atomic_load.js +34 -0
  327. package/src/shade/renderer/volumetrics/chunk_frustum_unit_box_coverage_multisample.d.ts +18 -0
  328. package/src/shade/renderer/volumetrics/chunk_frustum_unit_box_coverage_multisample.d.ts.map +1 -1
  329. package/src/shade/renderer/volumetrics/chunk_frustum_unit_box_coverage_multisample.js +31 -23
  330. package/src/shade/renderer/volumetrics/shader_volumetrics_build_participating_media.d.ts.map +1 -1
  331. package/src/shade/renderer/volumetrics/shader_volumetrics_build_participating_media.js +5 -6
  332. package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
  333. package/src/shade/renderer/wind/GPUSceneWind.d.ts +1 -1
  334. package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.d.ts +0 -213
  335. package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.d.ts.map +0 -1
  336. package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.js +0 -1468
  337. package/src/shade/renderer/geometry/sdf/cards/MESH_CARDS.d.ts +0 -82
  338. package/src/shade/renderer/geometry/sdf/cards/MESH_CARDS.d.ts.map +0 -1
  339. package/src/shade/renderer/geometry/sdf/cards/MESH_CARDS.js +0 -127
  340. package/src/shade/renderer/geometry/sdf/cards/MESH_CARD_RESOURCES.d.ts +0 -24
  341. package/src/shade/renderer/geometry/sdf/cards/MESH_CARD_RESOURCES.d.ts.map +0 -1
  342. package/src/shade/renderer/geometry/sdf/cards/MESH_CARD_RESOURCES.js +0 -29
  343. package/src/shade/renderer/geometry/sdf/cards/MESH_CARD_SET_STRUCT.d.ts +0 -12
  344. package/src/shade/renderer/geometry/sdf/cards/MESH_CARD_SET_STRUCT.d.ts.map +0 -1
  345. package/src/shade/renderer/geometry/sdf/cards/MESH_CARD_SET_STRUCT.js +0 -31
  346. package/src/shade/renderer/geometry/sdf/cards/MeshCardCaptureMode.d.ts +0 -11
  347. package/src/shade/renderer/geometry/sdf/cards/MeshCardCaptureMode.d.ts.map +0 -1
  348. package/src/shade/renderer/geometry/sdf/cards/MeshCardCaptureMode.js +0 -21
  349. package/src/shade/renderer/geometry/sdf/cards/chunk_mesh_card_surface.d.ts +0 -29
  350. package/src/shade/renderer/geometry/sdf/cards/chunk_mesh_card_surface.d.ts.map +0 -1
  351. package/src/shade/renderer/geometry/sdf/cards/chunk_mesh_card_surface.js +0 -179
  352. package/src/shade/renderer/geometry/sdf/cards/chunk_mesh_cards.d.ts +0 -17
  353. package/src/shade/renderer/geometry/sdf/cards/chunk_mesh_cards.d.ts.map +0 -1
  354. package/src/shade/renderer/geometry/sdf/cards/chunk_mesh_cards.js +0 -107
  355. package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.d.ts +0 -65
  356. package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.d.ts.map +0 -1
  357. package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.js +0 -376
  358. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_capture.d.ts +0 -40
  359. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_capture.d.ts.map +0 -1
  360. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_capture.js +0 -301
  361. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_compact.d.ts +0 -19
  362. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_compact.d.ts.map +0 -1
  363. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_compact.js +0 -61
  364. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_histogram.d.ts +0 -18
  365. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_histogram.d.ts.map +0 -1
  366. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_histogram.js +0 -102
  367. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_log.d.ts +0 -15
  368. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_log.d.ts.map +0 -1
  369. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_log.js +0 -65
  370. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_merge.d.ts +0 -22
  371. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_merge.d.ts.map +0 -1
  372. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_merge.js +0 -136
  373. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_pages.d.ts +0 -20
  374. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_pages.d.ts.map +0 -1
  375. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_pages.js +0 -104
  376. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_args.d.ts +0 -20
  377. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_args.d.ts.map +0 -1
  378. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_args.js +0 -80
  379. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_scatter.d.ts +0 -18
  380. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_scatter.d.ts.map +0 -1
  381. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_scatter.js +0 -113
  382. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_split.d.ts +0 -30
  383. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_split.d.ts.map +0 -1
  384. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_split.js +0 -146
  385. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_cards.d.ts +0 -34
  386. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_cards.d.ts.map +0 -1
  387. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_surface.d.ts +0 -31
  388. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_surface.d.ts.map +0 -1
  389. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_surface.js +0 -82
@@ -26,7 +26,6 @@ import {
26
26
  import { graph_import_buffer } from "../../../shader/graph/graph_import_buffer.js";
27
27
  import { GPUTileAtlas3D } from "../../../texture/atlas/GPUTileAtlas3D.js";
28
28
  import {
29
- BRICK_OBJECT_CELLS,
30
29
  BRICK_OCCUPANCY_BLOCK,
31
30
  BRICK_STAGING_WORDS,
32
31
  BRICK_STATE_FREE,
@@ -80,6 +79,12 @@ const BRICK_CASCADE_NEST_MARGIN = 1;
80
79
  */
81
80
  const BRICK_ATLAS_SLOTS_XY = 16;
82
81
 
82
+ /**
83
+ * A build with no payload written after its store.
84
+ * @type {ReadonlyArray<BrickMaterialWriter>}
85
+ */
86
+ const NO_MATERIAL_WRITERS = Object.freeze([]);
87
+
83
88
  /**
84
89
  * Boxes a moved window exposes at most: one an axis.
85
90
  * @type {number}
@@ -94,9 +99,9 @@ const SCROLL_BOXES_PER_CASCADE = 3;
94
99
  * @typedef {Object} BrickProviderContext
95
100
  * @property {FrameGraph} graph
96
101
  * @property {number} state `brick_state`'s handle: the ring's head and tail, and the free slots
97
- * @property {number} take `brick_take`'s handle: the taken keys' first and count, and the cell dispatch
98
- * at {@link BRICK_TAKE_CELL_DISPATCH}, a workgroup a taken cell. Bind it read-only and dispatch
99
- * through it.
102
+ * @property {number} take `brick_take`'s handle: the taken keys' first and count, the cell dispatch
103
+ * at {@link BRICK_TAKE_CELL_DISPATCH}, a workgroup a taken cell, and the texel dispatch at
104
+ * `BRICK_TAKE_TEXEL_DISPATCH`, a thread a texel of them. Bind it read-only and dispatch through it.
100
105
  * @property {number} staging `brick_staging`'s handle, `BRICK_STAGING_WORDS` words a build slot. A provider
101
106
  * that could not finish a cell sets its `BRICK_STAGING_RETRY_WORD`, and the cell is built again (§7.6, contract 7)
102
107
  * @property {number} staging_capacity build slots the staging holds: at least the frame's taken cells
@@ -108,6 +113,9 @@ const SCROLL_BOXES_PER_CASCADE = 3;
108
113
  * cell one brick of 7 voxels
109
114
  * @property {GPUSceneContext} scene the view's scene: its database, its TLAS over the mesh rows, and
110
115
  * its geometry caches
116
+ * @property {GPUBrickClipmap} clipmap the clipmap being built, whose {@link GPUBrickClipmap#write_bindings}
117
+ * a material writer binds the stored bricks through; a provider, which runs before the store, reads
118
+ * none of it
111
119
  */
112
120
 
113
121
  /**
@@ -115,6 +123,16 @@ const SCROLL_BOXES_PER_CASCADE = 3;
115
123
  * @property {function(FrameGraph, BrickProviderContext): void} graph_write_bricks
116
124
  */
117
125
 
126
+ /**
127
+ * What writes per-slot payloads of its own over the frame's taken cells once the store has put their
128
+ * bricks in their slots, such as their surface material (§7.6). The context's `state` is then the
129
+ * store's handle; a writer that records a pass replaces it with its own, so the next writer and the
130
+ * bricks' readers come after it. `take` holds the texel dispatch at `BRICK_TAKE_TEXEL_DISPATCH` too.
131
+ *
132
+ * @typedef {Object} BrickMaterialWriter
133
+ * @property {function(FrameGraph, BrickProviderContext): void} graph_write_material
134
+ */
135
+
118
136
  /**
119
137
  * The world as the probe clipmap's rays see it (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §7):
120
138
  * {@link cascade_count} cascades of {@link resolution}³ cells around an anchor, a cell one brick of
@@ -126,20 +144,19 @@ const SCROLL_BOXES_PER_CASCADE = 3;
126
144
  * - {@link occupancy}, `r32uint`, a texel a {@link BRICK_OCCUPANCY_BLOCK}³-cell block of storage: how many
127
145
  * of its cells a ray must read;
128
146
  * - {@link atlas}, `r8unorm` bricks of 8³ texels, the mesh caches' lattice and encoding, its slots
129
- * handed out by a free list on the device;
130
- * - {@link objects}, 64 words a slot: the `meshes` row nearest in each 2³-texel cell of the brick.
147
+ * handed out by a free list on the device.
131
148
  *
132
149
  * **A frame** ({@link graph_update}): the windows are placed around the anchor, coarsest first,
133
150
  * each child a parent cell inside its parent (`ClipmapCascadePlacement`), and what a move exposed is
134
151
  * queued (scroll). Then the frame takes up to its budget of queued cells, clears their staging, has
135
- * each provider merge its distances and objects into it, frees what needs no brick, stores what does,
152
+ * each provider merge its distances into it, frees what needs no brick, stores what does,
136
153
  * and counts the occupancy of the blocks it built. Every pass after scroll is sized by take's count
137
154
  * on the device, and scroll by the cells the moves exposed: nothing by the clipmap's size.
138
155
  *
139
156
  * **Capacity** (§7.10) starts at `2·N²·C` slots, a ground plane two cells thick through every
140
157
  * cascade. A take the free slots held back is counted on the device and read back, and the next
141
- * frame doubles the capacity: the atlas reserves more layers, and the objects and the free list grow
142
- * with a copy, the new slots pushed. Nothing shrinks.
158
+ * frame doubles the capacity: the atlas reserves more layers, and the free list grows with a copy,
159
+ * the new slots pushed. Nothing shrinks.
143
160
  */
144
161
  export class GPUBrickClipmap {
145
162
  /**
@@ -183,9 +200,6 @@ export class GPUBrickClipmap {
183
200
  /** @type {GPUTileAtlas3D} */
184
201
  #atlas;
185
202
 
186
- /** @type {GPUBuffer} */
187
- #objects;
188
-
189
203
  /** @type {GPUBuffer} */
190
204
  #free;
191
205
 
@@ -229,7 +243,7 @@ export class GPUBrickClipmap {
229
243
  /** @type {GPUBuffer} */
230
244
  #levels;
231
245
 
232
- /** Slots of the atlas and the object cells. */
246
+ /** Slots of the atlas. */
233
247
  #capacity = 0;
234
248
 
235
249
  #ring_capacity = 0;
@@ -294,6 +308,7 @@ export class GPUBrickClipmap {
294
308
  cascade_count: 0,
295
309
  levels: null,
296
310
  scene: null,
311
+ clipmap: null,
297
312
  };
298
313
 
299
314
  /**
@@ -367,7 +382,6 @@ export class GPUBrickClipmap {
367
382
 
368
383
  this.#atlas.reserve(capacity);
369
384
 
370
- this.#objects = this.#create_buffer('brick objects', 4 * BRICK_OBJECT_CELLS * capacity, GPUBufferUsage.COPY_SRC);
371
385
  this.#free = this.#create_buffer('brick free list', 4 * capacity, GPUBufferUsage.COPY_SRC);
372
386
 
373
387
  const keys = resolution ** 3 * cascade_count;
@@ -423,13 +437,6 @@ export class GPUBrickClipmap {
423
437
  return this.#atlas;
424
438
  }
425
439
 
426
- /**
427
- * @returns {GPUBuffer}
428
- */
429
- get objects() {
430
- return this.#objects;
431
- }
432
-
433
440
  /**
434
441
  * The cascades' windows, a {@link CLIPMAP_LEVEL_ARRAY} as a uniform, finest first: as placed by the
435
442
  * last {@link graph_update}.
@@ -441,9 +448,8 @@ export class GPUBrickClipmap {
441
448
 
442
449
  /**
443
450
  * Put what the tracer's chunks read (`chunk_brick_clipmap_trace.js`) into a reader's bindings,
444
- * under the names they take: the levels, the map, the occupancy, the atlas, its sampler and the
445
- * object cells. The atlas and the objects are replaced when the capacity grows: take them each
446
- * frame.
451
+ * under the names they take: the levels, the map, the occupancy, the atlas and its sampler. The atlas
452
+ * is replaced when the capacity grows: take it each frame.
447
453
  *
448
454
  * @param {Object} bindings
449
455
  * @returns {Object} bindings
@@ -454,13 +460,12 @@ export class GPUBrickClipmap {
454
460
  bindings.brick_occupancy = this.#occupancy_view;
455
461
  bindings.brick_atlas = this.#atlas.texture.obtainView();
456
462
  bindings.brick_sampler = MESH_SDF_SAMPLER;
457
- bindings.brick_objects = this.#objects;
458
463
 
459
464
  return bindings;
460
465
  }
461
466
 
462
467
  /**
463
- * Slots of the atlas and the object cells.
468
+ * Slots of the atlas.
464
469
  * @returns {number}
465
470
  */
466
471
  get capacity() {
@@ -520,8 +525,9 @@ export class GPUBrickClipmap {
520
525
 
521
526
  /**
522
527
  * Record the frame's build: place the windows around the anchor and queue what they exposed, then
523
- * take up to `budget` queued cells, stage them through `providers` in order, and store what they
524
- * need. Allocates nothing per frame once the staging holds the budget.
528
+ * take up to `budget` queued cells, stage them through `providers` in order, store what they
529
+ * need, and have `material_writers` write their payloads over the stored cells in order.
530
+ * Allocates nothing per frame once the staging holds the budget.
525
531
  *
526
532
  * @param {Object} options
527
533
  * @param {FrameGraph} options.graph
@@ -530,13 +536,14 @@ export class GPUBrickClipmap {
530
536
  * @param {number} options.z
531
537
  * @param {number} options.budget cells built a frame at most, `brick_build_budget`
532
538
  * @param {ArrayLike<BrickProvider>} options.providers merged into the staging in this order
539
+ * @param {ArrayLike<BrickMaterialWriter>} [options.material_writers] run after the store in this order
533
540
  * @param {GPUSceneContext|null} options.scene what the providers read: the view's scene
534
541
  * @param {number} [options.movers] the graph handle of the scene's mover list for the frame,
535
542
  * `GPUSceneContext.graph_movers`; none queues nothing but the invalidated rows
536
543
  * @returns {number} the graph handle of the build's last write, which a pass reading the bricks reads
537
544
  * to come after it
538
545
  */
539
- graph_update({ graph, x, y, z, budget, providers, scene, movers = -1 }) {
546
+ graph_update({ graph, x, y, z, budget, providers, material_writers = NO_MATERIAL_WRITERS, scene, movers = -1 }) {
540
547
  assert.defined(graph, 'graph');
541
548
  assert.isPositiveInteger(budget, 'budget');
542
549
  assert.notOk(this.#destroyed, 'destroyed');
@@ -598,6 +605,7 @@ export class GPUBrickClipmap {
598
605
  context.cascade_count = this.cascade_count;
599
606
  context.levels = this.#levels;
600
607
  context.scene = scene;
608
+ context.clipmap = this;
601
609
 
602
610
  for (let i = 0; i < providers.length; i++) {
603
611
  providers[i].graph_write_bricks(graph, context);
@@ -630,9 +638,17 @@ export class GPUBrickClipmap {
630
638
  // a reading lost to a timeout or a lost device: the count runs on, and a later reading carries it
631
639
  });
632
640
 
641
+ // the payloads written over the stored bricks, each writer after the one before it
642
+ context.state = store_data.state;
643
+ context.take = store_data.take;
644
+
645
+ for (let i = 0; i < material_writers.length; i++) {
646
+ material_writers[i].graph_write_material(graph, context);
647
+ }
648
+
633
649
  this.#fresh = false;
634
650
 
635
- return store_data.state;
651
+ return context.state;
636
652
  }
637
653
 
638
654
  /**
@@ -720,8 +736,8 @@ export class GPUBrickClipmap {
720
736
  }
721
737
 
722
738
  /**
723
- * Double the capacity: the atlas reserves the slots, the objects and the free list grow with a
724
- * copy, and the new slots are pushed by the next frame.
739
+ * Double the capacity: the atlas reserves the slots, the free list grows with a copy, and the new
740
+ * slots are pushed by the next frame.
725
741
  */
726
742
  #grow() {
727
743
  const old_capacity = this.#capacity;
@@ -733,7 +749,6 @@ export class GPUBrickClipmap {
733
749
 
734
750
  this.#atlas.reserve(capacity);
735
751
 
736
- this.#objects = this.#regrow(this.#objects, 'brick objects', 4 * BRICK_OBJECT_CELLS * capacity);
737
752
  this.#free = this.#regrow(this.#free, 'brick free list', 4 * capacity);
738
753
  this.#capacity = capacity;
739
754
  this.#pushes.push(old_capacity, capacity - old_capacity);
@@ -785,7 +800,6 @@ export class GPUBrickClipmap {
785
800
  b.brick_pending = this.#pending;
786
801
  b.brick_free = this.#free;
787
802
  b.brick_staging = resources.get(data.staging);
788
- b.brick_objects = this.#objects;
789
803
  b.brick_map = this.#brick_map_view;
790
804
  b.brick_occupancy = this.#occupancy_view;
791
805
  b.brick_atlas_store = this.#atlas.texture;
@@ -902,7 +916,6 @@ export class GPUBrickClipmap {
902
916
  b.brick_pending = this.#pending;
903
917
  b.brick_free = this.#free;
904
918
  b.brick_staging = resources.get(data.staging);
905
- b.brick_objects = this.#objects;
906
919
  b.brick_map = this.#brick_map_view;
907
920
  b.brick_occupancy = this.#occupancy_view;
908
921
  b.brick_atlas_store = this.#atlas.texture;
@@ -999,7 +1012,7 @@ export class GPUBrickClipmap {
999
1012
  this.#occupancy.destroy();
1000
1013
  this.#atlas.destroy();
1001
1014
 
1002
- for (const buffer of [this.#objects, this.#free, this.#ring, this.#pending, this.#state, this.#take, this.#movers, this.#invalidated, this.#no_movers, this.#staging, this.#runs, this.#levels]) {
1015
+ for (const buffer of [this.#free, this.#ring, this.#pending, this.#state, this.#take, this.#movers, this.#invalidated, this.#no_movers, this.#staging, this.#runs, this.#levels]) {
1003
1016
  buffer?.destroy();
1004
1017
  }
1005
1018
  }
@@ -23,14 +23,15 @@ export const BRICK_RING_RESOURCE: ShaderResourceDescriptor;
23
23
  */
24
24
  export const BRICK_PENDING_RESOURCE: ShaderResourceDescriptor;
25
25
  /**
26
- * The free slots of the atlas and the object cells, as a slot stack whose count is
26
+ * The free slots of the atlas, as a slot stack whose count is
27
27
  * `brick_state[BRICK_STATE_FREE]`.
28
28
  * @type {ShaderResourceDescriptor}
29
29
  */
30
30
  export const BRICK_FREE_RESOURCE: ShaderResourceDescriptor;
31
31
  /**
32
32
  * The taken cells' staging, a build slot each of `BRICK_STAGING_WORDS` words: 512 distance bytes, four
33
- * a word, then 64 objects. Providers merge into it, and free and store read it.
33
+ * a word, the retry word, then each texel's surface row. Providers merge into it, free and
34
+ * store read it, and the material writers read its surfaces.
34
35
  * @type {ShaderResourceDescriptor}
35
36
  */
36
37
  export const BRICK_STAGING_RESOURCE: ShaderResourceDescriptor;
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_brick_clipmap.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.js"],"names":[],"mappings":"AA4BA;;;GAGG;AACH,mCAFU,wBAAwB,CAE4F;AAE9H;;;;;GAKG;AACH,kCAFU,wBAAwB,CAEuE;AAEzG;;;;GAIG;AACH,kCAFU,wBAAwB,CAE6E;AAE/G;;;;GAIG;AACH,qCAFU,wBAAwB,CAEgG;AAElI;;;;GAIG;AACH,kCAFU,wBAAwB,CAE6E;AAE/G;;;;GAIG;AACH,qCAFU,wBAAwB,CAEmF;AAErH;;;;;;;;;;;;;;;;GAgBG;AACH,kCAFU,SAAS,CAwDhB;AAEH;;;;;;;;;;GAUG;AACH,0CAFU,SAAS,CAmBhB;AAMH;;;;;;;;;;GAUG;AACH,kDAFU,SAAS,CAYhB;yCAnMsC,sDAAsD;0BADrE,uCAAuC"}
1
+ {"version":3,"file":"chunk_brick_clipmap.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.js"],"names":[],"mappings":"AA4BA;;;GAGG;AACH,mCAFU,wBAAwB,CAE4F;AAE9H;;;;;GAKG;AACH,kCAFU,wBAAwB,CAEuE;AAEzG;;;;GAIG;AACH,kCAFU,wBAAwB,CAE6E;AAE/G;;;;GAIG;AACH,qCAFU,wBAAwB,CAEgG;AAElI;;;;GAIG;AACH,kCAFU,wBAAwB,CAE6E;AAE/G;;;;;GAKG;AACH,qCAFU,wBAAwB,CAEmF;AAErH;;;;;;;;;;;;;;;;GAgBG;AACH,kCAFU,SAAS,CAwDhB;AAEH;;;;;;;;;;GAUG;AACH,0CAFU,SAAS,CAmBhB;AAMH;;;;;;;;;;GAUG;AACH,kDAFU,SAAS,CAYhB;yCApMsC,sDAAsD;0BADrE,uCAAuC"}
@@ -10,10 +10,9 @@ import {
10
10
  BRICK_CLIPMAP_EMPTY_INSIDE,
11
11
  BRICK_CLIPMAP_STORE_PENDING,
12
12
  BRICK_CLIPMAP_UNKNOWN,
13
- BRICK_OBJECT_CELLS,
14
- BRICK_OBJECT_CELLS_PER_AXIS,
15
13
  BRICK_STAGING_DISTANCE_WORDS,
16
14
  BRICK_STAGING_RETRY_WORD,
15
+ BRICK_STAGING_SURFACE_WORDS,
17
16
  BRICK_STAGING_WORDS,
18
17
  BRICK_STATE_FREE,
19
18
  BRICK_STATE_HEAD,
@@ -22,6 +21,7 @@ import {
22
21
  BRICK_TAKE_CELL_DISPATCH,
23
22
  BRICK_TAKE_COUNT,
24
23
  BRICK_TAKE_FIRST,
24
+ BRICK_TAKE_TEXEL_DISPATCH,
25
25
  BRICK_TAKE_WORD_DISPATCH,
26
26
  BRICK_THREAD_WORKGROUP_SIZE
27
27
  } from "./BRICK_CLIPMAP.js";
@@ -55,7 +55,7 @@ export const BRICK_RING_RESOURCE = ShaderResourceDescriptor.storageBuffer("brick
55
55
  export const BRICK_PENDING_RESOURCE = ShaderResourceDescriptor.storageBuffer("brick_pending", WebGPUArray.from(atomic_u32), true);
56
56
 
57
57
  /**
58
- * The free slots of the atlas and the object cells, as a slot stack whose count is
58
+ * The free slots of the atlas, as a slot stack whose count is
59
59
  * `brick_state[BRICK_STATE_FREE]`.
60
60
  * @type {ShaderResourceDescriptor}
61
61
  */
@@ -63,7 +63,8 @@ export const BRICK_FREE_RESOURCE = ShaderResourceDescriptor.storageBuffer("brick
63
63
 
64
64
  /**
65
65
  * The taken cells' staging, a build slot each of `BRICK_STAGING_WORDS` words: 512 distance bytes, four
66
- * a word, then 64 objects. Providers merge into it, and free and store read it.
66
+ * a word, the retry word, then each texel's surface row. Providers merge into it, free and
67
+ * store read it, and the material writers read its surfaces.
67
68
  * @type {ShaderResourceDescriptor}
68
69
  */
69
70
  export const BRICK_STAGING_RESOURCE = ShaderResourceDescriptor.storageBuffer("brick_staging", WebGPUArray.u32, true);
@@ -94,10 +95,9 @@ const BRICK_CLIPMAP_EMPTY_INSIDE = ${BRICK_CLIPMAP_EMPTY_INSIDE}u;
94
95
  const BRICK_CLIPMAP_STORE_PENDING = ${BRICK_CLIPMAP_STORE_PENDING}u;
95
96
  const BRICK_CLIPMAP_BAND_VOXELS = ${MESH_SDF_BAND_VOXELS}.0;
96
97
 
97
- const BRICK_OBJECT_CELLS = ${BRICK_OBJECT_CELLS}u;
98
- const BRICK_OBJECT_CELLS_PER_AXIS = ${BRICK_OBJECT_CELLS_PER_AXIS}u;
99
98
  const BRICK_STAGING_DISTANCE_WORDS = ${BRICK_STAGING_DISTANCE_WORDS}u;
100
99
  const BRICK_STAGING_RETRY_WORD = ${BRICK_STAGING_RETRY_WORD}u;
100
+ const BRICK_STAGING_SURFACE_WORDS = ${BRICK_STAGING_SURFACE_WORDS}u;
101
101
  const BRICK_STAGING_WORDS = ${BRICK_STAGING_WORDS}u;
102
102
  const BRICK_CELL_WORKGROUP_SIZE = ${BRICK_CELL_WORKGROUP_SIZE}u;
103
103
  const BRICK_THREAD_WORKGROUP_SIZE = ${BRICK_THREAD_WORKGROUP_SIZE}u;
@@ -109,6 +109,7 @@ const BRICK_STATE_STARVED = ${BRICK_STATE_STARVED}u;
109
109
 
110
110
  const BRICK_TAKE_CELL_DISPATCH = ${BRICK_TAKE_CELL_DISPATCH}u;
111
111
  const BRICK_TAKE_WORD_DISPATCH = ${BRICK_TAKE_WORD_DISPATCH}u;
112
+ const BRICK_TAKE_TEXEL_DISPATCH = ${BRICK_TAKE_TEXEL_DISPATCH}u;
112
113
  const BRICK_TAKE_FIRST = ${BRICK_TAKE_FIRST}u;
113
114
  const BRICK_TAKE_COUNT = ${BRICK_TAKE_COUNT}u;
114
115
 
@@ -10,6 +10,12 @@ export const BRICK_TRACE_STEPS: number;
10
10
  * @type {number}
11
11
  */
12
12
  export const BRICK_TRACE_NUDGE: number;
13
+ /**
14
+ * The distance under which the march stands on a surface, in voxels of its cascade: UE's half voxel
15
+ * (§7.9). A hit is reported from anywhere between the surface and this far out.
16
+ * @type {number}
17
+ */
18
+ export const BRICK_TRACE_HIT_VOXELS: number;
13
19
  /**
14
20
  * The brick map as the tracer reads it: an entry a cell, the cascades stacked along z.
15
21
  * @type {ShaderResourceDescriptor}
@@ -36,15 +42,11 @@ export const BRICK_SAMPLER_RESOURCE: ShaderResourceDescriptor;
36
42
  */
37
43
  export const BRICK_LEVELS_RESOURCE: ShaderResourceDescriptor;
38
44
  /**
39
- * The object cells: {@link BRICK_OBJECT_CELLS} `meshes` rows a slot, 0 for none.
40
- * @type {ShaderResourceDescriptor}
41
- */
42
- export const BRICK_OBJECTS_RESOURCE: ShaderResourceDescriptor;
43
- /**
44
- * A brick's distance at a point of its cell, and the field's gradient there.
45
+ * A brick's distance at a point of its cell, where its slot sits in the atlas, and the field's gradient.
45
46
  *
46
47
  * ```wgsl
47
48
  * fn brick_clipmap_sample(slot: u32, local: vec3<f32>, voxel: f32) -> f32 // local in voxels from the cell's corner
49
+ * fn brick_clipmap_slot_texel(slot: u32) -> vec3<u32> // the slot's texel 0 in the atlas
48
50
  * fn brick_clipmap_normal(slot: u32, local: vec3<f32>) -> vec3<f32> // out of the solid, unit length
49
51
  * ```
50
52
  *
@@ -142,22 +144,6 @@ export const chunk_brick_clipmap_distance: CodeChunk;
142
144
  * @type {CodeChunk}
143
145
  */
144
146
  export const chunk_brick_clipmap_gradient: CodeChunk;
145
- /**
146
- * The `meshes` row whose surface a hit is on (§7.9), 0 for none.
147
- *
148
- * ```wgsl
149
- * fn brick_clipmap_object(hit: BrickClipmapHit) -> u32
150
- * ```
151
- *
152
- * The object cell of the texel nearest the hit moved half a voxel along the normal, onto the ray's
153
- * side: of a wall thinner than a voxel, whose two faces are in neighbouring object cells, it picks
154
- * the face the ray hit, as UE's object lookup does. A front face's normal is against the ray, and a
155
- * back face is counted, never shaded (§8.4), so the move is along the normal. A hit inside a solid
156
- * has no face: none.
157
- *
158
- * @type {CodeChunk}
159
- */
160
- export const chunk_brick_clipmap_object: CodeChunk;
161
147
  import { ShaderResourceDescriptor } from "../../../shader/resource/ShaderResourceDescriptor.js";
162
148
  import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
163
149
  //# sourceMappingURL=chunk_brick_clipmap_trace.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_brick_clipmap_trace.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js"],"names":[],"mappings":"AAsBA;;;;GAIG;AACH,gCAFU,MAAM,CAEoB;AAEpC;;;;GAIG;AACH,gCAFU,MAAM,CAEwB;AAExC;;;GAGG;AACH,yCAFU,wBAAwB,CAEoE;AAEtG;;;GAGG;AACH,+CAFU,wBAAwB,CAEgF;AAElH;;;GAGG;AACH,2CAFU,wBAAwB,CAEyE;AAE3G;;;GAGG;AACH,qCAFU,wBAAwB,CAEqF;AAEvH;;;GAGG;AACH,oCAFU,wBAAwB,CAEyE;AAE3G;;;GAGG;AACH,qCAFU,wBAAwB,CAE6E;AAE/G;;;;;;;;;;;;;GAaG;AACH,yCAFU,SAAS,CAsCZ;AAKP;;;;;;;;;;;;GAYG;AACH,yCAFU,SAAS,CAyBZ;AAIP;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wCAFU,SAAS,CAgFZ;AAKP;;;;;;;;;;;;;;;;;;GAkBG;AACH,wCAFU,SAAS,CAoGZ;AAEP;;;;;;;;;;;;GAYG;AACH,2CAFU,SAAS,CAsCZ;AAIP;;;;;;;;;;;;;;GAcG;AACH,2CAFU,SAAS,CA0BZ;AAEP;;;;;;;;;;;;;;GAcG;AACH,yCAFU,SAAS,CAqBZ;yCA9fkC,sDAAsD;0BADrE,uCAAuC"}
1
+ {"version":3,"file":"chunk_brick_clipmap_trace.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,gCAFU,MAAM,CAEoB;AAEpC;;;;GAIG;AACH,gCAFU,MAAM,CAEwB;AAExC;;;;GAIG;AACH,qCAFU,MAAM,CAE0B;AAE1C;;;GAGG;AACH,yCAFU,wBAAwB,CAEoE;AAEtG;;;GAGG;AACH,+CAFU,wBAAwB,CAEgF;AAElH;;;GAGG;AACH,2CAFU,wBAAwB,CAEyE;AAE3G;;;GAGG;AACH,qCAFU,wBAAwB,CAEqF;AAEvH;;;GAGG;AACH,oCAFU,wBAAwB,CAEyE;AAE3G;;;;;;;;;;;;;;GAcG;AACH,yCAFU,SAAS,CAyCZ;AAKP;;;;;;;;;;;;GAYG;AACH,yCAFU,SAAS,CAyBZ;AAIP;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wCAFU,SAAS,CAgFZ;AAKP;;;;;;;;;;;;;;;;;;GAkBG;AACH,wCAFU,SAAS,CAoGZ;AAEP;;;;;;;;;;;;GAYG;AACH,2CAFU,SAAS,CAsCZ;AAIP;;;;;;;;;;;;;;GAcG;AACH,2CAFU,SAAS,CA0BZ;yCA7dkC,sDAAsD;0BADrE,uCAAuC"}
@@ -11,8 +11,6 @@ import { ShaderResourceDescriptor } from "../../../shader/resource/ShaderResourc
11
11
  import { WebGPUArray } from "../../../shader/type/WebGPUArray.js";
12
12
  import { chunk_tile_atlas_slot_origin } from "../../../texture/atlas/chunk_tile_atlas_slot_origin.js";
13
13
  import {
14
- BRICK_OBJECT_CELLS,
15
- BRICK_OBJECT_CELLS_PER_AXIS,
16
14
  BRICK_OCCUPANCY_BLOCK,
17
15
  BRICK_TRACE_HIT,
18
16
  BRICK_TRACE_MISS,
@@ -34,6 +32,13 @@ export const BRICK_TRACE_STEPS = 64;
34
32
  */
35
33
  export const BRICK_TRACE_NUDGE = 1 / 64;
36
34
 
35
+ /**
36
+ * The distance under which the march stands on a surface, in voxels of its cascade: UE's half voxel
37
+ * (§7.9). A hit is reported from anywhere between the surface and this far out.
38
+ * @type {number}
39
+ */
40
+ export const BRICK_TRACE_HIT_VOXELS = 0.5;
41
+
37
42
  /**
38
43
  * The brick map as the tracer reads it: an entry a cell, the cascades stacked along z.
39
44
  * @type {ShaderResourceDescriptor}
@@ -65,16 +70,11 @@ export const BRICK_SAMPLER_RESOURCE = ShaderResourceDescriptor.sampler("brick_sa
65
70
  export const BRICK_LEVELS_RESOURCE = ShaderResourceDescriptor.uniform("brick_levels", CLIPMAP_LEVEL_ARRAY);
66
71
 
67
72
  /**
68
- * The object cells: {@link BRICK_OBJECT_CELLS} `meshes` rows a slot, 0 for none.
69
- * @type {ShaderResourceDescriptor}
70
- */
71
- export const BRICK_OBJECTS_RESOURCE = ShaderResourceDescriptor.storageBuffer("brick_objects", WebGPUArray.u32);
72
-
73
- /**
74
- * A brick's distance at a point of its cell, and the field's gradient there.
73
+ * A brick's distance at a point of its cell, where its slot sits in the atlas, and the field's gradient.
75
74
  *
76
75
  * ```wgsl
77
76
  * fn brick_clipmap_sample(slot: u32, local: vec3<f32>, voxel: f32) -> f32 // local in voxels from the cell's corner
77
+ * fn brick_clipmap_slot_texel(slot: u32) -> vec3<u32> // the slot's texel 0 in the atlas
78
78
  * fn brick_clipmap_normal(slot: u32, local: vec3<f32>) -> vec3<f32> // out of the solid, unit length
79
79
  * ```
80
80
  *
@@ -87,10 +87,13 @@ export const BRICK_OBJECTS_RESOURCE = ShaderResourceDescriptor.storageBuffer("br
87
87
  export const chunk_brick_clipmap_sample = CodeChunk.from(
88
88
  //language=WGSL
89
89
  `
90
+ fn brick_clipmap_slot_texel(slot: u32) -> vec3<u32> {
91
+ return tile_atlas_slot_origin(slot, textureDimensions(brick_atlas, 0).xy / ${MESH_SDF_BRICK_TEXELS}u, vec3<u32>(${MESH_SDF_BRICK_TEXELS}u));
92
+ }
93
+
90
94
  fn brick_clipmap_tap(slot: u32, local: vec3<f32>) -> f32 {
91
95
  let atlas_size = textureDimensions(brick_atlas, 0);
92
- let corner = tile_atlas_slot_origin(slot, atlas_size.xy / ${MESH_SDF_BRICK_TEXELS}u, vec3<u32>(${MESH_SDF_BRICK_TEXELS}u));
93
- let uvw = (vec3<f32>(corner) + 0.5 + clamp(local, vec3<f32>(0.0), vec3<f32>(${MESH_SDF_BRICK_VOXELS}.0))) / vec3<f32>(atlas_size);
96
+ let uvw = (vec3<f32>(brick_clipmap_slot_texel(slot)) + 0.5 + clamp(local, vec3<f32>(0.0), vec3<f32>(${MESH_SDF_BRICK_VOXELS}.0))) / vec3<f32>(atlas_size);
94
97
 
95
98
  return textureSampleLevel(brick_atlas, brick_sampler, uvw, 0.0).r;
96
99
  }
@@ -360,7 +363,7 @@ fn brick_clipmap_trace(origin: vec3<f32>, direction: vec3<f32>, t_min: f32, t_ma
360
363
  let local = (march.position - march.cell_min) / march.voxel;
361
364
  let distance = brick_clipmap_sample(march.entry, local, march.voxel);
362
365
 
363
- if (distance < 0.5 * march.voxel) {
366
+ if (distance < ${BRICK_TRACE_HIT_VOXELS} * march.voxel) {
364
367
  hit.kind = BRICK_TRACE_HIT;
365
368
  hit.t = march.t;
366
369
  hit.cascade = march.cascade;
@@ -482,42 +485,3 @@ fn brick_clipmap_gradient(position: vec3<f32>, cascade_count: u32) -> vec3<f32>
482
485
  chunk_brick_clipmap_window,
483
486
  chunk_brick_clipmap_distance,
484
487
  ]);
485
-
486
- /**
487
- * The `meshes` row whose surface a hit is on (§7.9), 0 for none.
488
- *
489
- * ```wgsl
490
- * fn brick_clipmap_object(hit: BrickClipmapHit) -> u32
491
- * ```
492
- *
493
- * The object cell of the texel nearest the hit moved half a voxel along the normal, onto the ray's
494
- * side: of a wall thinner than a voxel, whose two faces are in neighbouring object cells, it picks
495
- * the face the ray hit, as UE's object lookup does. A front face's normal is against the ray, and a
496
- * back face is counted, never shaded (§8.4), so the move is along the normal. A hit inside a solid
497
- * has no face: none.
498
- *
499
- * @type {CodeChunk}
500
- */
501
- export const chunk_brick_clipmap_object = CodeChunk.from(
502
- //language=WGSL
503
- `
504
- fn brick_clipmap_object(hit: BrickClipmapHit) -> u32 {
505
- if (hit.kind != BRICK_TRACE_HIT || !brick_clipmap_entry_holds_slot(hit.slot)) {
506
- return 0u;
507
- }
508
-
509
- let voxel = brick_levels[hit.cascade].cell_size / ${MESH_SDF_BRICK_VOXELS}.0;
510
-
511
- let local = (hit.position + 0.5 * voxel * hit.normal - hit.cell_min) / voxel;
512
- let texel = vec3<u32>(clamp(round(local), vec3<f32>(0.0), vec3<f32>(${MESH_SDF_BRICK_VOXELS}.0)));
513
- let cell = min(texel / 2u, vec3<u32>(${BRICK_OBJECT_CELLS_PER_AXIS - 1}u));
514
-
515
- return brick_objects[hit.slot * ${BRICK_OBJECT_CELLS}u + cell.x + ${BRICK_OBJECT_CELLS_PER_AXIS}u * (cell.y + ${BRICK_OBJECT_CELLS_PER_AXIS}u * cell.z)];
516
- }
517
- `, [
518
- chunk_brick_clipmap,
519
- chunk_brick_clipmap_trace,
520
- ]);
521
-
522
- chunk_brick_clipmap_object.requireResource(BRICK_OBJECTS_RESOURCE);
523
- chunk_brick_clipmap_object.requireResource(BRICK_LEVELS_RESOURCE);
@@ -38,11 +38,6 @@ export const MESH_BRICK_ROUNDS: number;
38
38
  * @type {number}
39
39
  */
40
40
  export const MESH_BRICK_ROUND_LIMIT: number;
41
- /**
42
- * The first of a build slot's object words.
43
- * @type {number}
44
- */
45
- export const MESH_BRICK_ACCUMULATOR_OBJECTS: number;
46
41
  /**
47
42
  * The word of the cell's flags for the frame, {@link MESH_BRICK_FLAG_TOUCHED} and
48
43
  * {@link MESH_BRICK_FLAG_UNFINISHED}. The walk that sets the first of them lists the cell for the
@@ -56,7 +51,7 @@ export const MESH_BRICK_ACCUMULATOR_FLAGS: number;
56
51
  */
57
52
  export const MESH_BRICK_ACCUMULATOR_WORDS: number;
58
53
  /**
59
- * A batch of the cell was made: the resolve merges its texel and object words.
54
+ * A batch of the cell was made: the resolve merges its texel words.
60
55
  * @type {number}
61
56
  */
62
57
  export const MESH_BRICK_FLAG_TOUCHED: number;
@@ -1 +1 @@
1
- {"version":3,"file":"MESH_BRICK.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.js"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,+BAFU,MAAM,CAE0C;AAE1D;;;;;;;;;;;GAWG;AACH,kCAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH,6CAFU,MAAM,CAEgC;AAEhD;;;GAGG;AACH,sCAFU,MAAM,CAEyE;AAEzF;;;GAGG;AACH,gCAFU,MAAM,CAEmB;AAEnC;;;;;GAKG;AACH,qCAFU,MAAM,CAEiI;AAUjJ;;;GAGG;AACH,6CAFU,MAAM,CAEyD;AAEzE;;;;;GAKG;AACH,2CAFU,MAAM,CAEgF;AAEhG;;;GAGG;AACH,2CAFU,MAAM,CAE6D;AAE7E;;;GAGG;AACH,sCAFU,MAAM,CAEyB;AAEzC;;;;;GAKG;AACH,yCAFU,MAAM,CAE4B;AAO5C;;;GAGG;AACH,2CAFU,MAAM,CAE8B;AAE9C;;;GAGG;AACH,mDAFU,MAAM,CAEsC;AAEtD;;;GAGG;AACH,yCAFU,MAAM,CAE4B;AAE5C;;;GAGG;AACH,iDAFU,MAAM,CAEoC;AAEpD;;;GAGG;AACH,gDAFU,MAAM,CAEmC;AAEnD;;;GAGG;AACH,gDAFU,MAAM,CAEmC;AAEnD;;;GAGG;AACH,iDAFU,MAAM,CAEoC;AAEpD;;;GAGG;AACH,gDAFU,MAAM,CAEmC;AAEnD;;;GAGG;AACH,8CAFU,MAAM,CAEiC;AAEjD;;;GAGG;AACH,iDAFU,MAAM,CAEoC;AAEpD;;;GAGG;AACH,yCAFU,MAAM,CAE6B;AAE7C;;;GAGG;AACH,yCAFU,MAAM,CAEqD;AAErE;;;;GAIG;AACH,uCAFU,MAAM,CAEuD;AAEvE;;;GAGG;AACH,8CAFU,MAAM,CAE4D;AAE5E;;;GAGG;AACH,8CAFU,MAAM,CAEmE;AAEnF;;;GAGG;AACH,0CAFU,MAAM,CAE+D;AAE/E;;;GAGG;AACH,gDAFU,MAAM,CAEiE;AAEjF;;;GAGG;AACH,uCAFU,MAAM,CAE8D"}
1
+ {"version":3,"file":"MESH_BRICK.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.js"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,+BAFU,MAAM,CAE0C;AAE1D;;;;;;;;;;;GAWG;AACH,kCAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH,6CAFU,MAAM,CAEgC;AAEhD;;;GAGG;AACH,sCAFU,MAAM,CAEyE;AAEzF;;;GAGG;AACH,gCAFU,MAAM,CAEmB;AAEnC;;;;;GAKG;AACH,qCAFU,MAAM,CAEiI;AASjJ;;;;;GAKG;AACH,2CAFU,MAAM,CAEuD;AAEvE;;;GAGG;AACH,2CAFU,MAAM,CAE6D;AAE7E;;;GAGG;AACH,sCAFU,MAAM,CAEyB;AAEzC;;;;;GAKG;AACH,yCAFU,MAAM,CAE4B;AAO5C;;;GAGG;AACH,2CAFU,MAAM,CAE8B;AAE9C;;;GAGG;AACH,mDAFU,MAAM,CAEsC;AAEtD;;;GAGG;AACH,yCAFU,MAAM,CAE4B;AAE5C;;;GAGG;AACH,iDAFU,MAAM,CAEoC;AAEpD;;;GAGG;AACH,gDAFU,MAAM,CAEmC;AAEnD;;;GAGG;AACH,gDAFU,MAAM,CAEmC;AAEnD;;;GAGG;AACH,iDAFU,MAAM,CAEoC;AAEpD;;;GAGG;AACH,gDAFU,MAAM,CAEmC;AAEnD;;;GAGG;AACH,8CAFU,MAAM,CAEiC;AAEjD;;;GAGG;AACH,iDAFU,MAAM,CAEoC;AAEpD;;;GAGG;AACH,yCAFU,MAAM,CAE6B;AAE7C;;;GAGG;AACH,yCAFU,MAAM,CAEqD;AAErE;;;;GAIG;AACH,uCAFU,MAAM,CAEuD;AAEvE;;;GAGG;AACH,8CAFU,MAAM,CAE4D;AAE5E;;;GAGG;AACH,8CAFU,MAAM,CAEmE;AAEnF;;;GAGG;AACH,0CAFU,MAAM,CAE+D;AAE/E;;;GAGG;AACH,gDAFU,MAAM,CAEiE;AAEjF;;;GAGG;AACH,uCAFU,MAAM,CAE8D"}
@@ -1,5 +1,5 @@
1
1
  import { MESH_SDF_BRICK_TEXEL_COUNT } from "../../../../geometry/sdf/MESH_SDF.js";
2
- import { BRICK_CELL_WORKGROUP_SIZE, BRICK_OBJECT_CELLS } from "../BRICK_CLIPMAP.js";
2
+ import { BRICK_CELL_WORKGROUP_SIZE } from "../BRICK_CLIPMAP.js";
3
3
 
4
4
  /*
5
5
  The mesh provider's device state (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §7.7, as S9 built it).
@@ -63,26 +63,19 @@ export const MESH_BRICK_ROUNDS = 2;
63
63
  export const MESH_BRICK_ROUND_LIMIT = 1 + Math.ceil(Math.log2((1 << 20) / MESH_BRICK_BATCH) / Math.log2(MESH_BRICK_FRONTIER / MESH_BRICK_BATCH));
64
64
 
65
65
  /*
66
- A build slot's accumulators, MESH_BRICK_ACCUMULATOR_WORDS words: a word a texel holding 255 less the
67
- least byte the batches staged there, a word an object cell holding the largest object key the
68
- batches bid (`brick_object_key`), and the cell's flags for the frame. A texel or object word is 0
69
- when nothing reached it, so a buffer the device has zeroed starts empty, and the resolve leaves each
66
+ A build slot's accumulators, MESH_BRICK_ACCUMULATOR_WORDS words: a word a texel holding the largest
67
+ key the batches bid there (`brick_object_key`), its least byte and the row that gave it, then the
68
+ cell's flags for the frame. A texel word is 0 when nothing reached it, so a buffer the device has zeroed starts empty, and the resolve leaves each
70
69
  one it merges at 0 for the next frame; the cell's walk from the root clears the flags.
71
70
  */
72
71
 
73
- /**
74
- * The first of a build slot's object words.
75
- * @type {number}
76
- */
77
- export const MESH_BRICK_ACCUMULATOR_OBJECTS = MESH_SDF_BRICK_TEXEL_COUNT;
78
-
79
72
  /**
80
73
  * The word of the cell's flags for the frame, {@link MESH_BRICK_FLAG_TOUCHED} and
81
74
  * {@link MESH_BRICK_FLAG_UNFINISHED}. The walk that sets the first of them lists the cell for the
82
75
  * resolve: most taken cells set none, and the resolve never reads them.
83
76
  * @type {number}
84
77
  */
85
- export const MESH_BRICK_ACCUMULATOR_FLAGS = MESH_BRICK_ACCUMULATOR_OBJECTS + BRICK_OBJECT_CELLS;
78
+ export const MESH_BRICK_ACCUMULATOR_FLAGS = MESH_SDF_BRICK_TEXEL_COUNT;
86
79
 
87
80
  /**
88
81
  * Words of a build slot's accumulators.
@@ -91,7 +84,7 @@ export const MESH_BRICK_ACCUMULATOR_FLAGS = MESH_BRICK_ACCUMULATOR_OBJECTS + BRI
91
84
  export const MESH_BRICK_ACCUMULATOR_WORDS = MESH_BRICK_ACCUMULATOR_FLAGS + 1;
92
85
 
93
86
  /**
94
- * A batch of the cell was made: the resolve merges its texel and object words.
87
+ * A batch of the cell was made: the resolve merges its texel words.
95
88
  * @type {number}
96
89
  */
97
90
  export const MESH_BRICK_FLAG_TOUCHED = 1;
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_mesh_brick_walk.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.js"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,oCAFU,SAAS,CAoChB;0BAnEuB,0CAA0C"}
1
+ {"version":3,"file":"chunk_mesh_brick_walk.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.js"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,oCAFU,SAAS,CAmChB;0BAjEuB,0CAA0C"}
@@ -2,7 +2,6 @@ import { chunk_divide_round_up_u32 } from "../../../../shader/chunk/math/chunk_d
2
2
  import { CodeChunk } from "../../../../shader/compiler/CodeChunk.js";
3
3
  import {
4
4
  MESH_BRICK_ACCUMULATOR_FLAGS,
5
- MESH_BRICK_ACCUMULATOR_OBJECTS,
6
5
  MESH_BRICK_ACCUMULATOR_WORDS,
7
6
  MESH_BRICK_BATCH,
8
7
  MESH_BRICK_FLAG_TOUCHED,
@@ -39,7 +38,6 @@ const MESH_BRICK_BATCH = ${MESH_BRICK_BATCH}u;
39
38
  const MESH_BRICK_FRONTIER = ${MESH_BRICK_FRONTIER}u;
40
39
  const MESH_BRICK_RECORD_HEADER_WORDS = ${MESH_BRICK_RECORD_HEADER_WORDS}u;
41
40
  const MESH_BRICK_RECORD_WORDS = ${MESH_BRICK_RECORD_WORDS}u;
42
- const MESH_BRICK_ACCUMULATOR_OBJECTS = ${MESH_BRICK_ACCUMULATOR_OBJECTS}u;
43
41
  const MESH_BRICK_ACCUMULATOR_FLAGS = ${MESH_BRICK_ACCUMULATOR_FLAGS}u;
44
42
  const MESH_BRICK_ACCUMULATOR_WORDS = ${MESH_BRICK_ACCUMULATOR_WORDS}u;
45
43
  const MESH_BRICK_FLAG_TOUCHED = ${MESH_BRICK_FLAG_TOUCHED}u;
@@ -9,10 +9,10 @@ export const MESH_BRICK_BATCH_SETTINGS: WebGPUStruct;
9
9
  * Its up to {@link MESH_BRICK_BATCH} rows, sorted ascending (a bitonic network, a lane a pair), become
10
10
  * instances in workgroup memory, a lane each (`mesh_brick_instance`), and its cell's 512 texels are
11
11
  * sampled over them in that order, eight a lane
12
- * (`mesh_brick_texel`: the least distance and its row, the box test first). Each texel's byte goes into
13
- * the cell's accumulators by an atomic maximum of 255 less it, and each 2³ object cell's nearest texel
14
- * bids its key by another (`brick_object_key`): the least byte and the nearest row over every batch
15
- * of the cell, whatever order the batches ran in. The staging is the resolve's to write.
12
+ * (`mesh_brick_texel`: the least distance and its row, the box test first). Each texel's key, its byte
13
+ * and its row (`brick_object_key`), goes into the cell's accumulators by an atomic maximum: the least byte
14
+ * and the nearest row over every batch of the cell, whatever order the batches ran in. The staging is the
15
+ * resolve's to write.
16
16
  *
17
17
  * The order is what keeps a cell of up to {@link MESH_BRICK_BATCH} rows, one batch, the same however the walk
18
18
  * found its rows: the box test is exact only where an instance's field is not negative outside its box,
@@ -1 +1 @@
1
- {"version":3,"file":"shader_mesh_brick_batch.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.js"],"names":[],"mappings":"AAyBA;;GAEG;AACH,wCAFU,YAAY,CAOO;AAuJ7B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,sCAFU,aAAa,CAMpB;6BAnM0B,yCAAyC;8BAJxC,qCAAqC"}
1
+ {"version":3,"file":"shader_mesh_brick_batch.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.js"],"names":[],"mappings":"AAyBA;;GAEG;AACH,wCAFU,YAAY,CAOO;AA8H7B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,sCAFU,aAAa,CAMpB;6BA1K0B,yCAAyC;8BAJxC,qCAAqC"}