@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
@@ -0,0 +1,142 @@
1
+ import { MESH_SDF_BRICK_TEXELS } from "../../../geometry/sdf/MESH_SDF.js";
2
+ import {
3
+ chunk_surface_material_pick,
4
+ chunk_surface_material_read
5
+ } from "../../../geometry/sdf/surface/chunk_surface_material_read.js";
6
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
7
+ import { ShaderResourceDescriptor } from "../../../shader/resource/ShaderResourceDescriptor.js";
8
+ import { chunk_tile_atlas_slot_origin } from "../../../texture/atlas/chunk_tile_atlas_slot_origin.js";
9
+ import { BRICK_TRACE_HIT_VOXELS, chunk_brick_clipmap_sample } from "../brick/chunk_brick_clipmap_trace.js";
10
+
11
+ /*
12
+ The material of the brick clipmap's surfaces: a tile of surface material texels (`SURFACE_MATERIAL.js`)
13
+ for every brick, on the lattice the slot's field uses, a texture a plane of `GPUBrickMaterial`'s atlas
14
+ whose slots are the brick atlas's.
15
+ */
16
+
17
+ /**
18
+ * @type {ShaderResourceDescriptor}
19
+ */
20
+ export const BRICK_MATERIAL_ALBEDO_RESOURCE = ShaderResourceDescriptor.texture("brick_material_albedo_codes", "uint", "3d");
21
+
22
+ /**
23
+ * @type {ShaderResourceDescriptor}
24
+ */
25
+ export const BRICK_MATERIAL_METAL_ROUGH_RESOURCE = ShaderResourceDescriptor.texture("brick_material_metal_rough_codes", "uint", "3d");
26
+
27
+ /**
28
+ * @type {ShaderResourceDescriptor}
29
+ */
30
+ export const BRICK_MATERIAL_EMISSIVE_RESOURCE = ShaderResourceDescriptor.texture("brick_material_emissive_codes", "uint", "3d");
31
+
32
+ /**
33
+ * Where a reader stands among a slot's material texels, and which of them hold the surface it is on
34
+ * (`surface_material_corners`), the albedo plane saying which hold a material
35
+ * (`surface_material_present`):
36
+ *
37
+ * ```wgsl
38
+ * fn brick_material_tile(slot: u32) -> vec3<u32>
39
+ * fn brick_material_corners(slot: u32, local: vec3<f32>, normal: vec3<f32>) -> SurfaceMaterialCorners
40
+ * ```
41
+ *
42
+ * `brick_material_tile` is the slot's tile's origin in the planes. `local` is a point by the surface in
43
+ * voxels from the cell's corner, a hit's position, and `normal` the field's normal there. Surfaces
44
+ * within {@link BRICK_TRACE_HIT_VOXELS} of each other are one: a ray stands on a surface from anywhere
45
+ * that far out of it, so it cannot tell closer ones apart.
46
+ *
47
+ * @type {CodeChunk}
48
+ */
49
+ export const chunk_brick_material_corners = CodeChunk.from(
50
+ //language=WGSL
51
+ `
52
+ fn brick_material_tile(slot: u32) -> vec3<u32> {
53
+ let t = ${MESH_SDF_BRICK_TEXELS}u;
54
+
55
+ return tile_atlas_slot_origin(slot, textureDimensions(brick_material_albedo_codes, 0).xy / t, vec3<u32>(t));
56
+ }
57
+
58
+ fn brick_material_corners(slot: u32, local: vec3<f32>, normal: vec3<f32>) -> SurfaceMaterialCorners {
59
+ let point = surface_material_point(local, brick_clipmap_sample(slot, local, 1.0), normal);
60
+ let present = surface_material_present(brick_material_albedo_codes, brick_material_tile(slot) + surface_material_base(point));
61
+
62
+ return surface_material_corners(brick_atlas, brick_clipmap_slot_texel(slot), point, present, normal, ${BRICK_TRACE_HIT_VOXELS});
63
+ }
64
+ `, [
65
+ chunk_surface_material_read,
66
+ chunk_brick_clipmap_sample,
67
+ chunk_tile_atlas_slot_origin,
68
+ ]);
69
+
70
+ chunk_brick_material_corners.requireResource(BRICK_MATERIAL_ALBEDO_RESOURCE);
71
+
72
+ /**
73
+ * What a hit's light takes from the brick material, its diffuse albedo and its emissive
74
+ * (`surface_material_surface`):
75
+ *
76
+ * ```wgsl
77
+ * fn brick_material_surface(slot: u32, local: vec3<f32>, normal: vec3<f32>) -> SurfaceMaterialSurface
78
+ * ```
79
+ *
80
+ * @type {CodeChunk}
81
+ */
82
+ export const chunk_brick_material_surface = CodeChunk.from(
83
+ //language=WGSL
84
+ `
85
+ fn brick_material_surface(slot: u32, local: vec3<f32>, normal: vec3<f32>) -> SurfaceMaterialSurface {
86
+ return surface_material_surface(brick_atlas, brick_material_albedo_codes, brick_material_emissive_codes, brick_material_tile(slot), brick_material_corners(slot, local, normal));
87
+ }
88
+ `, [
89
+ chunk_brick_material_corners,
90
+ chunk_surface_material_read,
91
+ ]);
92
+
93
+ chunk_brick_material_surface.requireResource(BRICK_MATERIAL_EMISSIVE_RESOURCE);
94
+
95
+ /**
96
+ * What a hit's light takes from one texel of the brick material, drawn by `u` in [0, 1) in proportion
97
+ * to its weight in {@link chunk_brick_material_surface}'s blend (`surface_material_pick`): the blend on
98
+ * average, over the reads a probe's rays make:
99
+ *
100
+ * ```wgsl
101
+ * fn brick_material_surface_pick(slot: u32, local: vec3<f32>, normal: vec3<f32>, u: f32) -> SurfaceMaterialSurface
102
+ * ```
103
+ *
104
+ * @type {CodeChunk}
105
+ */
106
+ export const chunk_brick_material_surface_pick = CodeChunk.from(
107
+ //language=WGSL
108
+ `
109
+ fn brick_material_surface_pick(slot: u32, local: vec3<f32>, normal: vec3<f32>, u: f32) -> SurfaceMaterialSurface {
110
+ let corners = brick_material_corners(slot, local, normal);
111
+
112
+ return surface_material_surface_at(brick_material_albedo_codes, brick_material_emissive_codes, brick_material_tile(slot), corners, surface_material_pick(brick_atlas, corners, u));
113
+ }
114
+ `, [
115
+ chunk_brick_material_corners,
116
+ chunk_surface_material_pick,
117
+ ]);
118
+
119
+ chunk_brick_material_surface_pick.requireResource(BRICK_MATERIAL_EMISSIVE_RESOURCE);
120
+
121
+ /**
122
+ * A hit's metalness and roughness from the brick material (`surface_material_metal_rough`), over the
123
+ * texels {@link chunk_brick_material_surface} takes:
124
+ *
125
+ * ```wgsl
126
+ * fn brick_material_metal_rough(slot: u32, local: vec3<f32>, normal: vec3<f32>) -> SurfaceMaterialMetalRough
127
+ * ```
128
+ *
129
+ * @type {CodeChunk}
130
+ */
131
+ export const chunk_brick_material_metal_rough = CodeChunk.from(
132
+ //language=WGSL
133
+ `
134
+ fn brick_material_metal_rough(slot: u32, local: vec3<f32>, normal: vec3<f32>) -> SurfaceMaterialMetalRough {
135
+ return surface_material_metal_rough(brick_atlas, brick_material_metal_rough_codes, brick_material_tile(slot), brick_material_corners(slot, local, normal));
136
+ }
137
+ `, [
138
+ chunk_brick_material_corners,
139
+ chunk_surface_material_read,
140
+ ]);
141
+
142
+ chunk_brick_material_metal_rough.requireResource(BRICK_MATERIAL_METAL_ROUGH_RESOURCE);
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Texels of a brick: 8³.
3
+ * @type {number}
4
+ */
5
+ export const BRICK_MATERIAL_TEXELS: number;
6
+ /**
7
+ * A brick's texel from its index:
8
+ *
9
+ * ```wgsl
10
+ * fn brick_material_texel(index: u32) -> vec3<u32> // index t.x + 8 (t.y + 8 t.z)
11
+ * ```
12
+ *
13
+ * @type {CodeChunk}
14
+ */
15
+ export const chunk_brick_material_texel: CodeChunk;
16
+ /**
17
+ * The taken cell a thread of the texel dispatch works on:
18
+ *
19
+ * ```wgsl
20
+ * fn brick_material_cell_entry(build: u32, ring_capacity: u32, resolution: u32) -> BrickMaterialCellEntry
21
+ * ```
22
+ *
23
+ * Build slot `build`'s key, and its brick map entry as store left it: a slot, or a cell with none.
24
+ *
25
+ * Requires the importing shader to declare `brick_take`, `brick_ring` and `brick_levels`, as
26
+ * `chunk_brick_provider` does.
27
+ *
28
+ * @type {CodeChunk}
29
+ */
30
+ export const chunk_brick_material_cell: CodeChunk;
31
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
32
+ //# sourceMappingURL=chunk_brick_material_cell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_brick_material_cell.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material_cell.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH,oCAFU,MAAM,CAEgD;AAEhE;;;;;;;;GAQG;AACH,yCAFU,SAAS,CAQhB;AAEH;;;;;;;;;;;;;GAaG;AACH,wCAFU,SAAS,CA0BZ;0BAlEmB,uCAAuC"}
@@ -0,0 +1,70 @@
1
+ import { MESH_SDF_BRICK_TEXELS } from "../../../geometry/sdf/MESH_SDF.js";
2
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
3
+ import { chunk_brick_clipmap } from "../brick/chunk_brick_clipmap.js";
4
+ import { BRICK_MAP_TEXTURE_RESOURCE } from "../brick/chunk_brick_clipmap_trace.js";
5
+ import { chunk_brick_provider } from "../brick/chunk_brick_provider.js";
6
+
7
+ /**
8
+ * Texels of a brick: 8³.
9
+ * @type {number}
10
+ */
11
+ export const BRICK_MATERIAL_TEXELS = MESH_SDF_BRICK_TEXELS ** 3;
12
+
13
+ /**
14
+ * A brick's texel from its index:
15
+ *
16
+ * ```wgsl
17
+ * fn brick_material_texel(index: u32) -> vec3<u32> // index t.x + 8 (t.y + 8 t.z)
18
+ * ```
19
+ *
20
+ * @type {CodeChunk}
21
+ */
22
+ export const chunk_brick_material_texel = CodeChunk.from(
23
+ //language=WGSL
24
+ `
25
+ fn brick_material_texel(index: u32) -> vec3<u32> {
26
+ return vec3<u32>(index % ${MESH_SDF_BRICK_TEXELS}u, (index / ${MESH_SDF_BRICK_TEXELS}u) % ${MESH_SDF_BRICK_TEXELS}u, index / ${MESH_SDF_BRICK_TEXELS ** 2}u);
27
+ }
28
+ `);
29
+
30
+ /**
31
+ * The taken cell a thread of the texel dispatch works on:
32
+ *
33
+ * ```wgsl
34
+ * fn brick_material_cell_entry(build: u32, ring_capacity: u32, resolution: u32) -> BrickMaterialCellEntry
35
+ * ```
36
+ *
37
+ * Build slot `build`'s key, and its brick map entry as store left it: a slot, or a cell with none.
38
+ *
39
+ * Requires the importing shader to declare `brick_take`, `brick_ring` and `brick_levels`, as
40
+ * `chunk_brick_provider` does.
41
+ *
42
+ * @type {CodeChunk}
43
+ */
44
+ export const chunk_brick_material_cell = CodeChunk.from(
45
+ //language=WGSL
46
+ `
47
+ struct BrickMaterialCellEntry {
48
+ key: u32,
49
+ entry: u32,
50
+ }
51
+
52
+ fn brick_material_cell_entry(build: u32, ring_capacity: u32, resolution: u32) -> BrickMaterialCellEntry {
53
+ var out: BrickMaterialCellEntry;
54
+
55
+ out.key = brick_provider_key(build, ring_capacity);
56
+ out.entry = textureLoad(
57
+ brick_map,
58
+ brick_clipmap_map_texel(brick_clipmap_key_cascade(out.key, resolution), brick_clipmap_key_storage(out.key, resolution), resolution),
59
+ 0
60
+ ).x;
61
+
62
+ return out;
63
+ }
64
+ `, [
65
+ chunk_brick_clipmap,
66
+ chunk_brick_provider,
67
+ chunk_brick_material_texel,
68
+ ]);
69
+
70
+ chunk_brick_material_cell.requireResource(BRICK_MAP_TEXTURE_RESOURCE);
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @type {ShaderResourceDescriptor}
3
+ */
4
+ export const BRICK_MATERIAL_ALBEDO_STORE_RESOURCE: ShaderResourceDescriptor;
5
+ /**
6
+ * @type {ShaderResourceDescriptor}
7
+ */
8
+ export const BRICK_MATERIAL_METAL_ROUGH_STORE_RESOURCE: ShaderResourceDescriptor;
9
+ /**
10
+ * @type {ShaderResourceDescriptor}
11
+ */
12
+ export const BRICK_MATERIAL_EMISSIVE_STORE_RESOURCE: ShaderResourceDescriptor;
13
+ /**
14
+ * A texel's material written into its slot's planes (`chunk_brick_material.js`), through
15
+ * `surface_material_store`:
16
+ *
17
+ * ```wgsl
18
+ * fn brick_material_atlas_texel(slot: u32, texel: vec3<u32>) -> vec3<u32>
19
+ * fn brick_material_store(at: vec3<u32>, fitted: SurfaceMaterialFitted) // a fit that covered nothing clears
20
+ * fn brick_material_clear(at: vec3<u32>) // no material: 0 in every plane
21
+ * ```
22
+ *
23
+ * `at` is the texel in the material atlas, `brick_material_atlas_texel` of the slot and the texel.
24
+ *
25
+ * @type {CodeChunk}
26
+ */
27
+ export const chunk_brick_material_store: CodeChunk;
28
+ import { ShaderResourceDescriptor } from "../../../shader/resource/ShaderResourceDescriptor.js";
29
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
30
+ //# sourceMappingURL=chunk_brick_material_store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_brick_material_store.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material_store.js"],"names":[],"mappings":"AAYA;;GAEG;AACH,mDAFU,wBAAwB,CAIhC;AAEF;;GAEG;AACH,wDAFU,wBAAwB,CAIhC;AAEF;;GAEG;AACH,qDAFU,wBAAwB,CAIhC;AAEF;;;;;;;;;;;;;GAaG;AACH,yCAFU,SAAS,CAqBZ;yCAzDkC,sDAAsD;0BADrE,uCAAuC"}
@@ -0,0 +1,71 @@
1
+ import { MESH_SDF_BRICK_TEXELS } from "../../../geometry/sdf/MESH_SDF.js";
2
+ import { chunk_surface_material_store } from "../../../geometry/sdf/surface/chunk_surface_material_store.js";
3
+ import {
4
+ SURFACE_MATERIAL_ALBEDO_PLANE,
5
+ SURFACE_MATERIAL_EMISSIVE_PLANE,
6
+ SURFACE_MATERIAL_FORMATS,
7
+ SURFACE_MATERIAL_METAL_ROUGH_PLANE
8
+ } from "../../../geometry/sdf/surface/SURFACE_MATERIAL.js";
9
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
10
+ import { ShaderResourceDescriptor } from "../../../shader/resource/ShaderResourceDescriptor.js";
11
+ import { chunk_tile_atlas_slot_origin } from "../../../texture/atlas/chunk_tile_atlas_slot_origin.js";
12
+
13
+ /**
14
+ * @type {ShaderResourceDescriptor}
15
+ */
16
+ export const BRICK_MATERIAL_ALBEDO_STORE_RESOURCE = ShaderResourceDescriptor.storageTexture(
17
+ "brick_material_albedo_store", SURFACE_MATERIAL_FORMATS[SURFACE_MATERIAL_ALBEDO_PLANE], "3d", "write-only"
18
+ );
19
+
20
+ /**
21
+ * @type {ShaderResourceDescriptor}
22
+ */
23
+ export const BRICK_MATERIAL_METAL_ROUGH_STORE_RESOURCE = ShaderResourceDescriptor.storageTexture(
24
+ "brick_material_metal_rough_store", SURFACE_MATERIAL_FORMATS[SURFACE_MATERIAL_METAL_ROUGH_PLANE], "3d", "write-only"
25
+ );
26
+
27
+ /**
28
+ * @type {ShaderResourceDescriptor}
29
+ */
30
+ export const BRICK_MATERIAL_EMISSIVE_STORE_RESOURCE = ShaderResourceDescriptor.storageTexture(
31
+ "brick_material_emissive_store", SURFACE_MATERIAL_FORMATS[SURFACE_MATERIAL_EMISSIVE_PLANE], "3d", "write-only"
32
+ );
33
+
34
+ /**
35
+ * A texel's material written into its slot's planes (`chunk_brick_material.js`), through
36
+ * `surface_material_store`:
37
+ *
38
+ * ```wgsl
39
+ * fn brick_material_atlas_texel(slot: u32, texel: vec3<u32>) -> vec3<u32>
40
+ * fn brick_material_store(at: vec3<u32>, fitted: SurfaceMaterialFitted) // a fit that covered nothing clears
41
+ * fn brick_material_clear(at: vec3<u32>) // no material: 0 in every plane
42
+ * ```
43
+ *
44
+ * `at` is the texel in the material atlas, `brick_material_atlas_texel` of the slot and the texel.
45
+ *
46
+ * @type {CodeChunk}
47
+ */
48
+ export const chunk_brick_material_store = CodeChunk.from(
49
+ //language=WGSL
50
+ `
51
+ fn brick_material_atlas_texel(slot: u32, texel: vec3<u32>) -> vec3<u32> {
52
+ let t = ${MESH_SDF_BRICK_TEXELS}u;
53
+
54
+ return tile_atlas_slot_origin(slot, textureDimensions(brick_material_albedo_store).xy / t, vec3<u32>(t)) + texel;
55
+ }
56
+
57
+ fn brick_material_clear(at: vec3<u32>) {
58
+ surface_material_clear(brick_material_albedo_store, brick_material_metal_rough_store, brick_material_emissive_store, at);
59
+ }
60
+
61
+ fn brick_material_store(at: vec3<u32>, fitted: SurfaceMaterialFitted) {
62
+ surface_material_store(brick_material_albedo_store, brick_material_metal_rough_store, brick_material_emissive_store, at, fitted);
63
+ }
64
+ `, [
65
+ chunk_tile_atlas_slot_origin,
66
+ chunk_surface_material_store,
67
+ ]);
68
+
69
+ chunk_brick_material_store.requireResource(BRICK_MATERIAL_ALBEDO_STORE_RESOURCE);
70
+ chunk_brick_material_store.requireResource(BRICK_MATERIAL_METAL_ROUGH_STORE_RESOURCE);
71
+ chunk_brick_material_store.requireResource(BRICK_MATERIAL_EMISSIVE_STORE_RESOURCE);
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @type {WebGPUStruct}
3
+ */
4
+ export const BRICK_MATERIAL_GATHER_SETTINGS: WebGPUStruct;
5
+ /**
6
+ * The brick material of the frame's taken cells, gathered from the Model Surface Caches: a thread a
7
+ * texel, dispatched through `BRICK_TAKE_TEXEL_DISPATCH` after store and the providers' merge. A cell
8
+ * store left without a slot does nothing.
9
+ *
10
+ * Every texel of a cell with a slot is cleared to no material, since the slot may have held another
11
+ * cell's. A texel whose nearest surface point is under its tent, |d|·|n|∞ < 1 voxel of the field's
12
+ * distance d and normal n there, takes its material from the surface it holds: the `meshes` row the
13
+ * providers left it (`BRICK_STAGING_SURFACE_WORDS`, contract 8), that row's (geometry, material) pair's
14
+ * cache (`mesh_surface_rows`), read at the texel moved into the geometry's space, at the level of its
15
+ * field the mesh provider sampled its distance from (`mesh_brick_instance`), surfaces within
16
+ * {@link BRICK_TRACE_HIT_VOXELS} of the nearest one blended (`mesh_surface_sample`). A row with no cache
17
+ * resident, and a point the cache holds nothing at, leave the texel without material.
18
+ *
19
+ * Reads the caches, the fields and the scene's transforms: no ray, no BLAS, no material table.
20
+ *
21
+ * @type {ComputeShader}
22
+ */
23
+ export const shader_brick_material_gather: ComputeShader;
24
+ import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
25
+ import { ComputeShader } from "../../../shader/ComputeShader.js";
26
+ //# sourceMappingURL=shader_brick_material_gather.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shader_brick_material_gather.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/material/shader_brick_material_gather.js"],"names":[],"mappings":"AA0CA;;GAEG;AACH,6CAFU,YAAY,CAOY;AAmClC;;;;;;;;;;;;;;;;;GAiBG;AACH,2CAFU,aAAa,CA0EpB;6BA1J0B,sCAAsC;8BALrC,kCAAkC"}
@@ -0,0 +1,176 @@
1
+ import { GPU_DATABASE_NULL } from "../../../buffer/table/GPU_DATABASE_NULL.js";
2
+ import { MESH_SDF_BRICK_TEXEL_COUNT } from "../../../geometry/sdf/MESH_SDF.js";
3
+ import {
4
+ MESH_SDF_ATLAS_RESOURCE,
5
+ MESH_SDF_HEADERS_RESOURCE,
6
+ MESH_SDF_INDIRECTION_RESOURCE,
7
+ MESH_SDF_SAMPLER_RESOURCE
8
+ } from "../../../geometry/sdf/MESH_SDF_RESOURCES.js";
9
+ import { chunk_mesh_surface_sample } from "../../../geometry/sdf/surface/chunk_mesh_surface_sample.js";
10
+ import {
11
+ MESH_SURFACE_DATA_RESOURCE,
12
+ MESH_SURFACE_RECORDS_RESOURCE,
13
+ MESH_SURFACE_ROWS_RESOURCE
14
+ } from "../../../geometry/sdf/surface/MESH_SURFACE_RESOURCES.js";
15
+ import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
16
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
17
+ import { ComputeShader } from "../../../shader/ComputeShader.js";
18
+ import { ShaderResourceDescriptor } from "../../../shader/resource/ShaderResourceDescriptor.js";
19
+ import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
20
+ import { u32 } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
21
+ import { WebGPUArray } from "../../../shader/type/WebGPUArray.js";
22
+ import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
23
+ import { BRICK_THREAD_WORKGROUP_SIZE } from "../brick/BRICK_CLIPMAP.js";
24
+ import { BRICK_RING_RESOURCE, BRICK_TAKE_RESOURCE } from "../brick/chunk_brick_clipmap.js";
25
+ import {
26
+ BRICK_ATLAS_TEXTURE_RESOURCE,
27
+ BRICK_LEVELS_RESOURCE,
28
+ BRICK_MAP_TEXTURE_RESOURCE,
29
+ BRICK_SAMPLER_RESOURCE,
30
+ BRICK_TRACE_HIT_VOXELS,
31
+ chunk_brick_clipmap_sample
32
+ } from "../brick/chunk_brick_clipmap_trace.js";
33
+ import { chunk_brick_provider } from "../brick/chunk_brick_provider.js";
34
+ import { chunk_mesh_brick_instance } from "../brick/mesh/chunk_mesh_brick_instance.js";
35
+ import { chunk_brick_material_cell, chunk_brick_material_texel } from "./chunk_brick_material_cell.js";
36
+ import {
37
+ BRICK_MATERIAL_ALBEDO_STORE_RESOURCE,
38
+ BRICK_MATERIAL_EMISSIVE_STORE_RESOURCE,
39
+ BRICK_MATERIAL_METAL_ROUGH_STORE_RESOURCE,
40
+ chunk_brick_material_store
41
+ } from "./chunk_brick_material_store.js";
42
+
43
+ /**
44
+ * @type {WebGPUStruct}
45
+ */
46
+ export const BRICK_MATERIAL_GATHER_SETTINGS = WebGPUStruct.from({
47
+ /** keys `brick_ring` holds, a power of two */
48
+ ring_capacity: u32,
49
+ /** cells a cascade's window has a side */
50
+ resolution: u32,
51
+ }, "BrickMaterialGatherSettings");
52
+
53
+ /**
54
+ * The taken cells' staging as the gather reads it, after the providers and the store
55
+ * (`BRICK_STAGING_RESOURCE`).
56
+ * @type {ShaderResourceDescriptor}
57
+ */
58
+ const BRICK_STAGING_READ_RESOURCE = ShaderResourceDescriptor.storageBuffer("brick_staging", WebGPUArray.u32);
59
+
60
+ const resources = new ShaderResourceSetDescriptor();
61
+
62
+ resources.setImmediate("settings", BRICK_MATERIAL_GATHER_SETTINGS);
63
+
64
+ resources.createGroup()
65
+ .add(BRICK_LEVELS_RESOURCE)
66
+ .add(BRICK_MAP_TEXTURE_RESOURCE)
67
+ .add(BRICK_ATLAS_TEXTURE_RESOURCE)
68
+ .add(BRICK_SAMPLER_RESOURCE)
69
+ .add(BRICK_TAKE_RESOURCE)
70
+ .add(BRICK_RING_RESOURCE)
71
+ .add(BRICK_STAGING_READ_RESOURCE)
72
+ .add(BRICK_MATERIAL_ALBEDO_STORE_RESOURCE)
73
+ .add(BRICK_MATERIAL_METAL_ROUGH_STORE_RESOURCE)
74
+ .add(BRICK_MATERIAL_EMISSIVE_STORE_RESOURCE);
75
+
76
+ resources.createGroup()
77
+ .addStorageBuffer("scene_database", WebGPUArray.from(u32))
78
+ .add(MESH_SDF_HEADERS_RESOURCE)
79
+ .add(MESH_SDF_INDIRECTION_RESOURCE)
80
+ .add(MESH_SDF_ATLAS_RESOURCE)
81
+ .add(MESH_SDF_SAMPLER_RESOURCE)
82
+ .add(MESH_SURFACE_RECORDS_RESOURCE)
83
+ .add(MESH_SURFACE_ROWS_RESOURCE)
84
+ .add(MESH_SURFACE_DATA_RESOURCE);
85
+
86
+ /**
87
+ * The brick material of the frame's taken cells, gathered from the Model Surface Caches: a thread a
88
+ * texel, dispatched through `BRICK_TAKE_TEXEL_DISPATCH` after store and the providers' merge. A cell
89
+ * store left without a slot does nothing.
90
+ *
91
+ * Every texel of a cell with a slot is cleared to no material, since the slot may have held another
92
+ * cell's. A texel whose nearest surface point is under its tent, |d|·|n|∞ < 1 voxel of the field's
93
+ * distance d and normal n there, takes its material from the surface it holds: the `meshes` row the
94
+ * providers left it (`BRICK_STAGING_SURFACE_WORDS`, contract 8), that row's (geometry, material) pair's
95
+ * cache (`mesh_surface_rows`), read at the texel moved into the geometry's space, at the level of its
96
+ * field the mesh provider sampled its distance from (`mesh_brick_instance`), surfaces within
97
+ * {@link BRICK_TRACE_HIT_VOXELS} of the nearest one blended (`mesh_surface_sample`). A row with no cache
98
+ * resident, and a point the cache holds nothing at, leave the texel without material.
99
+ *
100
+ * Reads the caches, the fields and the scene's transforms: no ray, no BLAS, no material table.
101
+ *
102
+ * @type {ComputeShader}
103
+ */
104
+ export const shader_brick_material_gather = ComputeShader.from({
105
+ label: "Brick Material Gather",
106
+ resources,
107
+ body: CodeChunk.from(
108
+ //language=WGSL
109
+ `
110
+ @compute @workgroup_size(${BRICK_THREAD_WORKGROUP_SIZE})
111
+ fn main(
112
+ @builtin(workgroup_id) workgroup_id: vec3<u32>,
113
+ @builtin(local_invocation_index) lane: u32,
114
+ ) {
115
+ let thread = folded_workgroup_index(workgroup_id) * ${BRICK_THREAD_WORKGROUP_SIZE}u + lane;
116
+ let build = thread / ${MESH_SDF_BRICK_TEXEL_COUNT}u;
117
+ let index = thread % ${MESH_SDF_BRICK_TEXEL_COUNT}u;
118
+
119
+ if (build >= brick_take[BRICK_TAKE_COUNT]) {
120
+ return;
121
+ }
122
+
123
+ let taken = brick_material_cell_entry(build, settings.ring_capacity, settings.resolution);
124
+
125
+ if (!brick_clipmap_entry_holds_slot(taken.entry)) {
126
+ return;
127
+ }
128
+
129
+ let t = brick_material_texel(index);
130
+ let at = brick_material_atlas_texel(taken.entry, t);
131
+
132
+ brick_material_clear(at);
133
+
134
+ // in voxels: a voxel of 1
135
+ let local = vec3<f32>(t);
136
+ let d = brick_clipmap_sample(taken.entry, local, 1.0);
137
+ let n = brick_clipmap_normal(taken.entry, local);
138
+
139
+ if (!(any(n != vec3<f32>(0.0)) && abs(d) * max(max(abs(n.x), abs(n.y)), abs(n.z)) < 1.0)) {
140
+ return;
141
+ }
142
+
143
+ let row = brick_staging[build * BRICK_STAGING_WORDS + BRICK_STAGING_SURFACE_WORDS + index];
144
+
145
+ if (row == 0u) {
146
+ return;
147
+ }
148
+
149
+ let cache = mesh_surface_rows[row];
150
+
151
+ if (cache == ${GPU_DATABASE_NULL}u) {
152
+ return;
153
+ }
154
+
155
+ let cell = brick_provider_cell(taken.key, settings.resolution);
156
+ let p = vec4<f32>(cell.corner + local * cell.voxel, 1.0);
157
+ let instance = mesh_brick_instance(row, cell.voxel);
158
+ let q = vec3<f32>(dot(instance.to_local_0, p), dot(instance.to_local_1, p), dot(instance.to_local_2, p));
159
+
160
+ let seen = mesh_surface_sample(mesh_surface_records[cache], mesh_sdf_headers[instance.geometry], instance.level, q, ${BRICK_TRACE_HIT_VOXELS});
161
+
162
+ if (seen.found) {
163
+ brick_material_store(at, SurfaceMaterialFitted(true, seen.albedo, seen.metal_rough, seen.emissive));
164
+ }
165
+ }
166
+ `, [
167
+ chunk_folded_workgroup_index,
168
+ chunk_brick_material_cell,
169
+ chunk_brick_material_texel,
170
+ chunk_brick_material_store,
171
+ chunk_brick_clipmap_sample,
172
+ chunk_brick_provider,
173
+ chunk_mesh_brick_instance,
174
+ chunk_mesh_surface_sample,
175
+ ]),
176
+ });
@@ -23,7 +23,10 @@
23
23
  * of the frame's updates, at most U = ⌊ray_budget / rays_per_probe⌋.
24
24
  *
25
25
  * **A frame's windows** ({@link place}, {@link place_within}): around the anchor, coarsest first, each a
26
- * parent cell inside its parent; or another clipmap's.
26
+ * parent cell inside its parent; or another clipmap's. Readers and wants choose a point's cascade by
27
+ * selection boxes centred on the anchor itself, `PROBE_SELECTION_INSET` short of half a window (§9.1,
28
+ * "Selection"): the windows move a step at a time, the boxes with the anchor, so the blend between
29
+ * cascades moves as the anchor does.
27
30
  *
28
31
  * **A frame's lifetime** ({@link graph_update}, §8.3, §8.5): retire frees the probes whose points left
29
32
  * their windows and those the last frame's schedule evicted, the wants mark the cages they read, admit
@@ -58,7 +61,9 @@ export class GPUProbeClipmap {
58
61
  * the record's cascade field, {@link PROBE_RECORD_CASCADE_SHIFT}
59
62
  * @param {number} options.resolution a power of two, at most 1024: the order's Morton code takes 10 bits
60
63
  * an axis; the indirection's height, resolution · cascade_count, at most the device's
61
- * `maxTextureDimension3D`
64
+ * `maxTextureDimension3D`; past twice {@link PROBE_SELECTION_INSET}, so a selection box holds points;
65
+ * and with more than one cascade, from 8, so the nesting never holds a window further from the anchor
66
+ * than the inset allows (§9.1, "Selection")
62
67
  * @param {number} options.spacing metres
63
68
  * @param {number} options.radiance_resolution a power of two from 2, which the update's bit-reversed
64
69
  * walk of the texels needs
@@ -186,8 +191,8 @@ export class GPUProbeClipmap {
186
191
  */
187
192
  built_for(settings: ProbeClipmapSettings): boolean;
188
193
  /**
189
- * Place the windows around the anchor, coarsest first, each a parent cell inside its parent, for the
190
- * frame's {@link graph_update}.
194
+ * Place the windows around the anchor, coarsest first, each a parent cell inside its parent, and the
195
+ * selection boxes on the anchor, for the frame's {@link graph_update}.
191
196
  *
192
197
  * @param {number} x the anchor, world metres
193
198
  * @param {number} y
@@ -198,7 +203,8 @@ export class GPUProbeClipmap {
198
203
  * Take another clipmap's windows, as {@link place} last placed them, at 2^k this clipmap's lattice
199
204
  * (WORLD_PROBE_CACHE_SCOPE_2026_11_01.md §1.2): the same cascades, each the other's window and spacing over
200
205
  * 2^k, its corner 2^k the other's, so every point of the other's lattice is one of this clipmap's and the
201
- * two scroll together. k is the ratio of the resolutions, a power of two from 2.
206
+ * two scroll together. k is the ratio of the resolutions, a power of two from 2. The selection boxes are the
207
+ * other's too: the same anchor, the same half side in metres.
202
208
  *
203
209
  * @param {GPUProbeClipmap} clipmap placed this frame
204
210
  */
@@ -219,8 +225,9 @@ export class GPUProbeClipmap {
219
225
  * @param {number} options.bricks the graph handle of the brick clipmap's last write this frame, which
220
226
  * the update orders after
221
227
  * @param {import("../../../scene/GPUSceneContext.js").GPUSceneContext} options.scene the scene the rays
222
- * light and shade: its lights, its environment, its rows and their geometry caches' cards
223
- * @param {GPUBuffer} options.card_rows the row → card set table, a word a `meshes` row
228
+ * light: its lights and its environment
229
+ * @param {{write_bindings: function(Object): Object}} options.material what binds the brick material's planes
230
+ * for the shade (`GPUBrickMaterial#write_bindings`): the material the bricks carry
224
231
  * @param {boolean} options.history_resampling whether each update re-samples its neighbours' histories, adding
225
232
  * what they have seen to its rays (`shader_probe_clipmap_resample`); never where the radiance has no skirt
226
233
  * @param {boolean} options.ray_resampling whether each update re-samples one neighbour's rays of the frame,
@@ -233,7 +240,7 @@ export class GPUProbeClipmap {
233
240
  * tone curve, a single f32, as the last frame was shown: the exposure the probes' estimators state their
234
241
  * thresholds in
235
242
  */
236
- graph_update({ graph, wants, response_frames, ray_budget, rays_per_probe, brick_clipmap, bricks, scene, card_rows, history_resampling, ray_resampling, clusters, bounce_first, bounce_fallback, exposure }: {
243
+ graph_update({ graph, wants, response_frames, ray_budget, rays_per_probe, brick_clipmap, bricks, scene, material, history_resampling, ray_resampling, clusters, bounce_first, bounce_fallback, exposure }: {
237
244
  graph: FrameGraph;
238
245
  wants: ProbeClipmapWants;
239
246
  response_frames: number;
@@ -242,7 +249,9 @@ export class GPUProbeClipmap {
242
249
  brick_clipmap: import("../brick/GPUBrickClipmap.js").GPUBrickClipmap;
243
250
  bricks: number;
244
251
  scene: import("../../../scene/GPUSceneContext.js").GPUSceneContext;
245
- card_rows: GPUBuffer;
252
+ material: {
253
+ write_bindings: (arg0: any) => any;
254
+ };
246
255
  history_resampling: boolean;
247
256
  ray_resampling: boolean;
248
257
  clusters: {
@@ -1 +1 @@
1
- {"version":3,"file":"GPUProbeClipmap.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js"],"names":[],"mappings":"AAiIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH;IA4QI;;;;;;;;;;;;;;;;;OAiBG;IACH;QAf2B,aAAa,EAA7B,MAAM;QAEU,UAAU,EAA1B,MAAM;QAGU,OAAO,EAAvB,MAAM;QACU,mBAAmB,EAAnC,MAAM;QAEU,gBAAgB,EAAhC,MAAM;QACW,cAAc,EAA/B,OAAO;QAES,KAAK,EAArB,MAAM;QACU,QAAQ,EAAxB,MAAM;OA8GhB;IAxYD;;;OAGG;IACH,wBAHU,MAAM,CAGF;IAEd;;;;OAIG;IACH,qBAHU,MAAM,CAGL;IAEX;;;;OAIG;IACH,kBAHU,MAAM,CAGR;IAER;;;;OAIG;IACH,8BAHU,MAAM,CAGI;IAEpB;;;;OAIG;IACH,2BAHU,MAAM,CAGC;IAEjB;;;;;OAKG;IACH,yBAHU,OAAO,CAGF;IAEf;;;;OAIG;IACH,gBAHU,MAAM,CAGV;IA2VN;;;;;;;;OAQG;IACH,4CAUC;IAED;;OAEG;IACH,8BAEC;IAED;;;;;OAKG;IACH,uBAEC;IAED;;;OAGG;IACH,yBAEC;IAED;;;OAGG;IACH,sBAEC;IAGD;;;OAGG;IACH,0BAEC;IAED;;;;;OAKG;IACH,wBAEC;IAED;;;OAGG;IACH,uBAEC;IAED;;;;OAIG;IACH,gBAJW,MAAM,QACN,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,mBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,oBAHW,oBAAoB,GAClB,OAAO,CAQnB;IAED;;;;;;;OAOG;IACH,SAJW,MAAM,KACN,MAAM,KACN,MAAM,QA6BhB;IAED;;;;;;;OAOG;IACH,sBAFW,eAAe,QA2BzB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH;QAxB+B,KAAK,EAAzB,UAAU;QACiB,KAAK,EAAhC,iBAAiB;QACD,eAAe,EAA/B,MAAM;QACU,UAAU,EAA1B,MAAM;QACU,cAAc,EAA9B,MAAM;QACyD,aAAa,EAA5E,OAAO,6BAA6B,EAAE,eAAe;QAErC,MAAM,EAAtB,MAAM;QAE+D,KAAK,EAA1E,OAAO,mCAAmC,EAAE,eAAe;QAExC,SAAS;QACX,kBAAkB,EAAnC,OAAO;QAEU,cAAc,EAA/B,OAAO;QAEiC,QAAQ,EAAhD;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAC;QAEL,YAAY,EAArC,eAAe;QACU,eAAe,EAAxC,eAAe;QACC,QAAQ,EAAxB,MAAM;aAmOhB;IAqhBD,gBAcC;;CACJ;mCA17CY,OAAO,4BAA4B,EAAE,oBAAoB;yBACzD,OAAO,iEAAiE,EAAE,UAAU;gCACpF,OAAO,8BAA8B,EAAE,uBAAuB,GAAC,OAAO,2BAA2B,EAAE,oBAAoB"}
1
+ {"version":3,"file":"GPUProbeClipmap.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js"],"names":[],"mappings":"AA0HA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH;IAqRI;;;;;;;;;;;;;;;;;;;OAmBG;IACH;QAjB2B,aAAa,EAA7B,MAAM;QAEU,UAAU,EAA1B,MAAM;QAKU,OAAO,EAAvB,MAAM;QACU,mBAAmB,EAAnC,MAAM;QAEU,gBAAgB,EAAhC,MAAM;QACW,cAAc,EAA/B,OAAO;QAES,KAAK,EAArB,MAAM;QACU,QAAQ,EAAxB,MAAM;OAmHhB;IAxZD;;;OAGG;IACH,wBAHU,MAAM,CAGF;IAEd;;;;OAIG;IACH,qBAHU,MAAM,CAGL;IAEX;;;;OAIG;IACH,kBAHU,MAAM,CAGR;IAER;;;;OAIG;IACH,8BAHU,MAAM,CAGI;IAEpB;;;;OAIG;IACH,2BAHU,MAAM,CAGC;IAEjB;;;;;OAKG;IACH,yBAHU,OAAO,CAGF;IAEf;;;;OAIG;IACH,gBAHU,MAAM,CAGV;IA2WN;;;;;;;;OAQG;IACH,4CAUC;IAED;;OAEG;IACH,8BAEC;IAED;;;;;OAKG;IACH,uBAEC;IAED;;;OAGG;IACH,yBAEC;IAED;;;OAGG;IACH,sBAEC;IAGD;;;OAGG;IACH,0BAEC;IAED;;;;;OAKG;IACH,wBAEC;IAED;;;OAGG;IACH,uBAEC;IAED;;;;OAIG;IACH,gBAJW,MAAM,QACN,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,mBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,oBAHW,oBAAoB,GAClB,OAAO,CAQnB;IAED;;;;;;;OAOG;IACH,SAJW,MAAM,KACN,MAAM,KACN,MAAM,QAkChB;IAED;;;;;;;;OAQG;IACH,sBAFW,eAAe,QA+BzB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH;QAzB+B,KAAK,EAAzB,UAAU;QACiB,KAAK,EAAhC,iBAAiB;QACD,eAAe,EAA/B,MAAM;QACU,UAAU,EAA1B,MAAM;QACU,cAAc,EAA9B,MAAM;QACyD,aAAa,EAA5E,OAAO,6BAA6B,EAAE,eAAe;QAErC,MAAM,EAAtB,MAAM;QAE+D,KAAK,EAA1E,OAAO,mCAAmC,EAAE,eAAe;QAEP,QAAQ,EAA5D;YAAC,cAAc,qBAA0B;SAAC;QAEzB,kBAAkB,EAAnC,OAAO;QAEU,cAAc,EAA/B,OAAO;QAEiC,QAAQ,EAAhD;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAC;QAEL,YAAY,EAArC,eAAe;QACU,eAAe,EAAxC,eAAe;QACC,QAAQ,EAAxB,MAAM;aAuOhB;IA6gBD,gBAcC;;CACJ;mCA18CY,OAAO,4BAA4B,EAAE,oBAAoB;yBACzD,OAAO,iEAAiE,EAAE,UAAU;gCACpF,OAAO,8BAA8B,EAAE,uBAAuB,GAAC,OAAO,2BAA2B,EAAE,oBAAoB"}