@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,24 @@
1
+ /**
2
+ * @typedef {import("../../../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph} FrameGraph
3
+ */
4
+ /**
5
+ * The light one lobe of the probe clipmap's indirect light is made of, before the surface's material and occlusion:
6
+ * the fused indirect pass's variant that writes only that ({@link PROBE_CLIPMAP_INDIRECT_LOBE}), drawn over opaque black, so the background, which the pass does
7
+ * not draw, stays black.
8
+ *
9
+ * @param {Object} options
10
+ * @param {FrameGraph} options.graph
11
+ * @param {ProbeClipmapIndirectLobe} options.lobe
12
+ * @param {Object} options.inputs the fused pass's inputs, the probes' sampling bindings among them
13
+ * @param {number[]} options.resolution the G-buffer's
14
+ * @returns {number} graph handle of the `rgba16float` image
15
+ */
16
+ export function graph_probe_clipmap_debug_indirect({ graph, lobe, inputs, resolution }: {
17
+ graph: FrameGraph;
18
+ lobe: ProbeClipmapIndirectLobe;
19
+ inputs: any;
20
+ resolution: number[];
21
+ }): number;
22
+ export type FrameGraph = import("../../../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph;
23
+ import { ProbeClipmapIndirectLobe } from "../probe/ProbeClipmapIndirectLobe.js";
24
+ //# sourceMappingURL=graph_probe_clipmap_debug_indirect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph_probe_clipmap_debug_indirect.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_indirect.js"],"names":[],"mappings":"AAOA;;GAEG;AAEH;;;;;;;;;;;GAWG;AACH;IAN+B,KAAK,EAAzB,UAAU;IACwB,IAAI,EAAtC,wBAAwB;IACR,MAAM;IACJ,UAAU,EAA5B,MAAM,EAAE;IACN,MAAM,CAkBlB;yBA/BY,OAAO,iEAAiE,EAAE,UAAU;yCAJxD,sCAAsC"}
@@ -0,0 +1,40 @@
1
+ import { assert } from "../../../../../core/assert.js";
2
+ import { ShaderSwitchSet } from "../../../shader/compiler/ShaderSwitchSet.js";
3
+ import { graph_image_pass } from "../../../shader/graph/graph_image_pass.js";
4
+ import { PROBE_CLIPMAP_INDIRECT_LOBE } from "../probe/PROBE_CLIPMAP_INDIRECT_LOBE.js";
5
+ import { ProbeClipmapIndirectLobe } from "../probe/ProbeClipmapIndirectLobe.js";
6
+ import { shader_probe_clipmap_indirect_lighting } from "../probe/shader_probe_clipmap_indirect_lighting.js";
7
+
8
+ /**
9
+ * @typedef {import("../../../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph} FrameGraph
10
+ */
11
+
12
+ /**
13
+ * The light one lobe of the probe clipmap's indirect light is made of, before the surface's material and occlusion:
14
+ * the fused indirect pass's variant that writes only that ({@link PROBE_CLIPMAP_INDIRECT_LOBE}), drawn over opaque black, so the background, which the pass does
15
+ * not draw, stays black.
16
+ *
17
+ * @param {Object} options
18
+ * @param {FrameGraph} options.graph
19
+ * @param {ProbeClipmapIndirectLobe} options.lobe
20
+ * @param {Object} options.inputs the fused pass's inputs, the probes' sampling bindings among them
21
+ * @param {number[]} options.resolution the G-buffer's
22
+ * @returns {number} graph handle of the `rgba16float` image
23
+ */
24
+ export function graph_probe_clipmap_debug_indirect({ graph, lobe, inputs, resolution }) {
25
+ assert.defined(graph, 'graph');
26
+ assert.enum(lobe, ProbeClipmapIndirectLobe, 'lobe');
27
+ assert.defined(inputs, 'inputs');
28
+ assert.isArrayLike(resolution, 'resolution');
29
+
30
+ const [image] = graph_image_pass({
31
+ graph,
32
+ shader: shader_probe_clipmap_indirect_lighting.variant(ShaderSwitchSet.EMPTY.with(PROBE_CLIPMAP_INDIRECT_LOBE, lobe)),
33
+ inputs,
34
+ input_depth: inputs.tDepth,
35
+ output_resolution: resolution,
36
+ clear_value: [0, 0, 0, 1],
37
+ });
38
+
39
+ return image;
40
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @param {Object} options
3
+ * @param {FrameGraph} options.graph
4
+ * @param {GPUViewContext} options.view
5
+ * @param {number[]} options.resolution
6
+ * @param {GPUMeshSurfaceCaches} options.surfaces
7
+ * @param {GPUBuffer} options.rows the row → surface cache table
8
+ * @returns {number} graph handle of the `rgba8unorm` image
9
+ */
10
+ export function graph_probe_clipmap_debug_mesh_surfaces({ graph, view, resolution, surfaces, rows }: {
11
+ graph: FrameGraph;
12
+ view: GPUViewContext;
13
+ resolution: number[];
14
+ surfaces: GPUMeshSurfaceCaches;
15
+ rows: GPUBuffer;
16
+ }): number;
17
+ /**
18
+ * The view's scene through its geometry caches and Model Surface Caches: each pixel's camera ray is
19
+ * marched through the meshes' sparse fields as in {@link ProbeClipmapDebugView.MeshSDF}, and at the
20
+ * nearest hit the row's surface cache is read at the field's finest level (`mesh_surface_sample`), as
21
+ * the brick material's gather reads it for a texel. It shows the diffuse albedo plus emissive the cache
22
+ * holds.
23
+ *
24
+ * Purple is a row with no surface cache readers may use yet; dark red a point no texel of the cache
25
+ * holds, which a GI hit takes as black.
26
+ *
27
+ * @type {ImageShader}
28
+ */
29
+ export const shader_probe_clipmap_debug_mesh_surfaces: ImageShader;
30
+ export type FrameGraph = import("../../../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph;
31
+ export type GPUViewContext = import("../../../view/GPUViewContext.js").GPUViewContext;
32
+ export type GPUMeshSurfaceCaches = import("../../../geometry/sdf/surface/GPUMeshSurfaceCaches.js").GPUMeshSurfaceCaches;
33
+ import { ImageShader } from "../../../shader/ImageShader.js";
34
+ //# sourceMappingURL=graph_probe_clipmap_debug_mesh_surfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph_probe_clipmap_debug_mesh_surfaces.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_surfaces.js"],"names":[],"mappings":"AA2HA;;;;;;;;GAQG;AACH;IAP+B,KAAK,EAAzB,UAAU;IACc,IAAI,EAA5B,cAAc;IACI,UAAU,EAA5B,MAAM,EAAE;IACsB,QAAQ,EAAtC,oBAAoB;IACD,IAAI;IACrB,MAAM,CAuClB;AArED;;;;;;;;;;;GAWG;AACH,uDAFU,WAAW,CAWlB;yBAzFU,OAAO,iEAAiE,EAAE,UAAU;6BACpF,OAAO,iCAAiC,EAAE,cAAc;mCACxD,OAAO,uDAAuD,EAAE,oBAAoB;4BAVrE,gCAAgC"}
@@ -2,14 +2,6 @@ import { assert } from "../../../../../core/assert.js";
2
2
  import { TextureResourceDescriptor } from "../../../../device/graph/TextureResourceDescriptor.js";
3
3
  import { GPU_DATABASE_NULL } from "../../../buffer/table/GPU_DATABASE_NULL.js";
4
4
  import { CAMERA_UNIFORM_STRUCT } from "../../../camera/CAMERA_UNIFORM_STRUCT.js";
5
- import { chunk_mesh_card_surface } from "../../../geometry/sdf/cards/chunk_mesh_card_surface.js";
6
- import {
7
- MESH_CARD_ALBEDO_RESOURCE,
8
- MESH_CARD_EMISSIVE_RESOURCE,
9
- MESH_CARD_ROWS_RESOURCE,
10
- MESH_CARD_SETS_RESOURCE
11
- } from "../../../geometry/sdf/cards/MESH_CARD_RESOURCES.js";
12
- import { chunk_mesh_sdf_normal } from "../../../geometry/sdf/chunk_mesh_sdf_normal.js";
13
5
  import { chunk_mesh_sdf_header } from "../../../geometry/sdf/chunk_mesh_sdf_sample.js";
14
6
  import {
15
7
  MESH_SDF_ATLAS_RESOURCE,
@@ -17,6 +9,12 @@ import {
17
9
  MESH_SDF_INDIRECTION_RESOURCE,
18
10
  MESH_SDF_SAMPLER_RESOURCE
19
11
  } from "../../../geometry/sdf/MESH_SDF_RESOURCES.js";
12
+ import { chunk_mesh_surface_sample } from "../../../geometry/sdf/surface/chunk_mesh_surface_sample.js";
13
+ import {
14
+ MESH_SURFACE_DATA_RESOURCE,
15
+ MESH_SURFACE_RECORDS_RESOURCE,
16
+ MESH_SURFACE_ROWS_RESOURCE
17
+ } from "../../../geometry/sdf/surface/MESH_SURFACE_RESOURCES.js";
20
18
  import { chunk_scene_database_access } from "../../../scene/chunk_scene_database_access.js";
21
19
  import { BVH_STRUCT } from "../../../shader/chunk/bvh/BVH_STRUCT.js";
22
20
  import { chunk_mat4_inverse } from "../../../shader/chunk/geometry/mat4/chunk_mat4_inverse.js";
@@ -29,19 +27,13 @@ import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderReso
29
27
  import { ShaderDescriptor } from "../../../shader/ShaderDescriptor.js";
30
28
  import { u32 } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
31
29
  import { WebGPUArray } from "../../../shader/type/WebGPUArray.js";
30
+ import { BRICK_TRACE_HIT_VOXELS } from "../brick/chunk_brick_clipmap_trace.js";
32
31
 
33
32
  /**
34
33
  * @typedef {import("../../../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph} FrameGraph
35
34
  * @typedef {import("../../../view/GPUViewContext.js").GPUViewContext} GPUViewContext
36
- * @typedef {import("../../../geometry/sdf/cards/GPUMeshCardSets.js").GPUMeshCardSets} GPUMeshCardSets
37
- */
38
-
39
- /**
40
- * The tolerance a card's depth is held to, in voxels of the hit's geometry: a hit marched through a
41
- * mesh's own field is as exact as its finest cascade would be (§6.6).
42
- * @type {number}
35
+ * @typedef {import("../../../geometry/sdf/surface/GPUMeshSurfaceCaches.js").GPUMeshSurfaceCaches} GPUMeshSurfaceCaches
43
36
  */
44
- const TOLERANCE_VOXELS = 1.5;
45
37
 
46
38
  const resources = new ShaderResourceSetDescriptor();
47
39
 
@@ -54,10 +46,9 @@ resources.createGroup()
54
46
  .addStorageBuffer("tlas", BVH_STRUCT);
55
47
 
56
48
  resources.createGroup()
57
- .add(MESH_CARD_SETS_RESOURCE)
58
- .add(MESH_CARD_ROWS_RESOURCE)
59
- .add(MESH_CARD_ALBEDO_RESOURCE)
60
- .add(MESH_CARD_EMISSIVE_RESOURCE)
49
+ .add(MESH_SURFACE_RECORDS_RESOURCE)
50
+ .add(MESH_SURFACE_ROWS_RESOURCE)
51
+ .add(MESH_SURFACE_DATA_RESOURCE)
61
52
  .addUniform("camera", CAMERA_UNIFORM_STRUCT);
62
53
 
63
54
  const body = CodeChunk.from(
@@ -76,31 +67,26 @@ fn main(
76
67
  return vec4<f32>(0.08, 0.08, 0.1, 1.0);
77
68
  }
78
69
 
79
- let point = ray.origin + hit.t * ray.direction;
80
- let card_set = mesh_card_rows[hit.mesh];
70
+ let cache = mesh_surface_rows[hit.mesh];
81
71
 
82
- if (card_set == ${GPU_DATABASE_NULL}u) {
83
- // no card set readers may use yet: the pair is waiting or capturing
72
+ if (cache == ${GPU_DATABASE_NULL}u) {
73
+ // no surface cache readers may use yet: the pair is waiting or baking
84
74
  return vec4<f32>(0.3, 0.0, 0.3, 1.0);
85
75
  }
86
76
 
87
77
  let mesh = scene_read_mesh(&scene_database, hit.mesh);
88
78
  let node = scene_read_node(&scene_database, mesh.node);
89
79
 
90
- let p = (mat4_inverse(node.global) * vec4<f32>(point, 1.0)).xyz;
91
-
92
- // the field's own normal there: a screen-space one turns to the wrong axis at grazing angles
93
- let header = mesh_sdf_header(mesh.geometry);
94
- let n = mesh_sdf_normal(header, 0u, p);
80
+ let p = (mat4_inverse(node.global) * vec4<f32>(ray.origin + hit.t * ray.direction, 1.0)).xyz;
95
81
 
96
- let surface = mesh_card_surface(card_set, p, n, ${TOLERANCE_VOXELS.toFixed(1)} * header.voxel);
82
+ let seen = mesh_surface_sample(mesh_surface_records[cache], mesh_sdf_header(mesh.geometry), 0u, p, ${BRICK_TRACE_HIT_VOXELS});
97
83
 
98
- if (!surface.found) {
99
- // no card sees the point: the hit would take the material's mean
84
+ if (!seen.found) {
85
+ // no texel of the cache holds the point's surface: a GI hit there is black
100
86
  return vec4<f32>(0.3, 0.0, 0.0, 1.0);
101
87
  }
102
88
 
103
- return vec4<f32>(surface.albedo + surface.emissive, 1.0);
89
+ return vec4<f32>(seen.albedo + seen.emissive, 1.0);
104
90
  }
105
91
  `, [
106
92
  F32_MAX_DEFINITION,
@@ -109,25 +95,24 @@ fn main(
109
95
  chunk_mat4_inverse,
110
96
  chunk_scene_sdf_raymarch_hit,
111
97
  chunk_mesh_sdf_header,
112
- chunk_mesh_sdf_normal,
113
- chunk_mesh_card_surface,
98
+ chunk_mesh_surface_sample,
114
99
  ]);
115
100
 
116
101
  /**
117
- * The view's scene through its geometry caches and cards: each pixel's camera ray is marched through
118
- * the meshes' sparse fields as in {@link ProbeClipmapDebugView.MeshSDF}, and at the nearest hit the
119
- * row's card set is asked what the surface is (`mesh_card_surface`), with the field's normal there
120
- * and at the tolerance of a hit as exact as the mesh's own voxel. It shows the diffuse albedo plus
121
- * emissive the cards hold.
102
+ * The view's scene through its geometry caches and Model Surface Caches: each pixel's camera ray is
103
+ * marched through the meshes' sparse fields as in {@link ProbeClipmapDebugView.MeshSDF}, and at the
104
+ * nearest hit the row's surface cache is read at the field's finest level (`mesh_surface_sample`), as
105
+ * the brick material's gather reads it for a texel. It shows the diffuse albedo plus emissive the cache
106
+ * holds.
122
107
  *
123
- * Purple is a row with no card set readers may use yet; dark red a point no card sees, which a GI
124
- * hit would give the material's mean.
108
+ * Purple is a row with no surface cache readers may use yet; dark red a point no texel of the cache
109
+ * holds, which a GI hit takes as black.
125
110
  *
126
111
  * @type {ImageShader}
127
112
  */
128
- export const shader_probe_clipmap_debug_mesh_cards = new ImageShader({
113
+ export const shader_probe_clipmap_debug_mesh_surfaces = new ImageShader({
129
114
  descriptor: ShaderDescriptor.from({
130
- label: "Probe Clipmap Debug / Mesh Cards",
115
+ label: "Probe Clipmap Debug / Mesh Surfaces",
131
116
  resources,
132
117
  body,
133
118
  }),
@@ -141,35 +126,31 @@ export const shader_probe_clipmap_debug_mesh_cards = new ImageShader({
141
126
  * @param {FrameGraph} options.graph
142
127
  * @param {GPUViewContext} options.view
143
128
  * @param {number[]} options.resolution
144
- * @param {GPUMeshCardSets} options.cards
145
- * @param {GPUBuffer} options.rows the row → card set table
129
+ * @param {GPUMeshSurfaceCaches} options.surfaces
130
+ * @param {GPUBuffer} options.rows the row → surface cache table
146
131
  * @returns {number} graph handle of the `rgba8unorm` image
147
132
  */
148
- export function graph_probe_clipmap_debug_mesh_cards({ graph, view, resolution, cards, rows }) {
133
+ export function graph_probe_clipmap_debug_mesh_surfaces({ graph, view, resolution, surfaces, rows }) {
149
134
  assert.defined(graph, 'graph');
150
135
  assert.defined(view, 'view');
151
136
  assert.isArrayLike(resolution, 'resolution');
152
- assert.defined(cards, 'cards');
137
+ assert.defined(surfaces, 'surfaces');
153
138
  assert.defined(rows, 'rows');
154
139
 
155
140
  const data = {};
156
141
 
157
- const pass = graph.add("Probe Clipmap Debug / Mesh Cards", data, (data, resources, context) => {
142
+ const pass = graph.add("Probe Clipmap Debug / Mesh Surfaces", data, (data, resources, context) => {
158
143
  const scene = view.scene;
159
144
  const output = resources.get(data.output);
160
- const atlas = cards.atlas;
161
145
 
162
- shader_probe_clipmap_debug_mesh_cards.draw({
146
+ shader_probe_clipmap_debug_mesh_surfaces.draw({
163
147
  encoder: context.encoder,
164
- bindings: scene.geometries.sdf.write_bindings({
148
+ bindings: surfaces.write_bindings(scene.geometries.sdf.write_bindings({
165
149
  scene_database: scene.scene_database_buffer,
166
150
  tlas: scene.tlas.buffer,
167
151
  camera: view.camera.buffer,
168
- mesh_card_sets: cards.records,
169
- mesh_card_rows: rows,
170
- mesh_card_albedo: atlas.texture_at(0).obtainView(),
171
- mesh_card_emissive: atlas.texture_at(1).obtainView(),
172
- }),
152
+ mesh_surface_rows: rows,
153
+ })),
173
154
  colorAttachments: [{
174
155
  loadOp: "clear",
175
156
  storeOp: "store",
@@ -0,0 +1,61 @@
1
+ /**
2
+ * The brick clipmap's surface material (`chunk_brick_material.js`): a texel of material a texel of
3
+ * every brick, gathered from the Model Surface Caches of the surfaces the brick's texels hold when the
4
+ * brick is built.
5
+ *
6
+ * **Storage**: a {@link GPUTileAtlas3D} of the planes `SURFACE_MATERIAL_FORMATS` lists, 8³ a tile, a tile
7
+ * for each of the brick clipmap's slots, at the slot's index: it reserves the clipmap's capacity at
8
+ * every build, so it grows when the clipmap does. Readers bind its planes through
9
+ * {@link write_bindings}.
10
+ *
11
+ * **A frame**: the brick clipmap runs it after its store ({@link graph_write_material}), over the
12
+ * cells the frame took: the gather (`shader_brick_material_gather`) clears their texels and gives each
13
+ * that holds a surface the material of that surface's cache, through {@link surface_rows}. It reads the
14
+ * caches, the fields and the transforms the mesh provider read: no ray, no BLAS, no material table.
15
+ *
16
+ * A cell that is not rebuilt keeps its material: a cache baked again reaches the bricks through its
17
+ * rows being invalidated (`ProbeClipmapSceneHolds`).
18
+ */
19
+ export class GPUBrickMaterial {
20
+ /**
21
+ * @param {GPUDevice} device
22
+ * @param {object} options
23
+ * @param {number} options.capacity slots to start with: the brick clipmap's
24
+ */
25
+ constructor(device: GPUDevice, { capacity }: {
26
+ capacity: number;
27
+ });
28
+ /**
29
+ * The row → Model Surface Cache table the gather finds a texel's cache in, a word a `meshes` row
30
+ * (`ProbeClipmapSceneHolds#surface_rows_buffer`). Replaced when it grows: set it each frame.
31
+ * @type {GPUBuffer|null}
32
+ */
33
+ surface_rows: GPUBuffer | null;
34
+ /**
35
+ * @returns {GPUTileAtlas3D}
36
+ */
37
+ get atlas(): GPUTileAtlas3D;
38
+ /**
39
+ * Put what the material's readers (`chunk_brick_material.js`) take into their bindings, under the
40
+ * names they take. The planes are replaced when the capacity grows: take them each frame.
41
+ *
42
+ * @param {Object} bindings
43
+ * @returns {Object} bindings
44
+ */
45
+ write_bindings(bindings: any): any;
46
+ /**
47
+ * Record the gather of the frame's taken cells, after the brick clipmap's store: `GPUBrickClipmap`
48
+ * calls it from its build with the build's context, the store's state handle in it, and its handle
49
+ * is replaced with this pass's, which the bricks' readers come after.
50
+ *
51
+ * @param {FrameGraph} graph
52
+ * @param {BrickProviderContext} context
53
+ */
54
+ graph_write_material(graph: FrameGraph, context: BrickProviderContext): void;
55
+ destroy(): void;
56
+ #private;
57
+ }
58
+ export type FrameGraph = import("../../../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph;
59
+ export type BrickProviderContext = import("../brick/GPUBrickClipmap.js").BrickProviderContext;
60
+ import { GPUTileAtlas3D } from "../../../texture/atlas/GPUTileAtlas3D.js";
61
+ //# sourceMappingURL=GPUBrickMaterial.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GPUBrickMaterial.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.js"],"names":[],"mappings":"AAuBA;;;;;;;;;;;;;;;;;GAiBG;AACH;IAyBI;;;;OAIG;IACH;QAF2B,QAAQ,EAAxB,MAAM;OAsBhB;IAhCD;;;;OAIG;IACH,cAFU,YAAU,IAAI,CAEJ;IA6BpB;;OAEG;IACH,4BAEC;IAED;;;;;;OAMG;IACH,mCAMC;IAED;;;;;;;OAOG;IACH,4BAHW,UAAU,WACV,oBAAoB,QAuB9B;IAuCD,gBAQC;;CACJ;yBAnLY,OAAO,iEAAiE,EAAE,UAAU;mCACpF,OAAO,6BAA6B,EAAE,oBAAoB;+BANxC,0CAA0C"}
@@ -0,0 +1,193 @@
1
+ import { assert } from "../../../../../core/assert.js";
2
+ import { MESH_SDF_BRICK_TEXELS } from "../../../geometry/sdf/MESH_SDF.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 { GPUTileAtlas3D } from "../../../texture/atlas/GPUTileAtlas3D.js";
10
+ import { BRICK_TAKE_TEXEL_DISPATCH } from "../brick/BRICK_CLIPMAP.js";
11
+ import { shader_brick_material_gather } from "./shader_brick_material_gather.js";
12
+
13
+ /**
14
+ * @typedef {import("../../../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph} FrameGraph
15
+ * @typedef {import("../brick/GPUBrickClipmap.js").BrickProviderContext} BrickProviderContext
16
+ */
17
+
18
+ /**
19
+ * Tiles of the material atlas along x and y; it grows in layers of these, as the brick atlas does.
20
+ * @type {number}
21
+ */
22
+ const BRICK_MATERIAL_SLOTS_XY = 16;
23
+
24
+ /**
25
+ * The brick clipmap's surface material (`chunk_brick_material.js`): a texel of material a texel of
26
+ * every brick, gathered from the Model Surface Caches of the surfaces the brick's texels hold when the
27
+ * brick is built.
28
+ *
29
+ * **Storage**: a {@link GPUTileAtlas3D} of the planes `SURFACE_MATERIAL_FORMATS` lists, 8³ a tile, a tile
30
+ * for each of the brick clipmap's slots, at the slot's index: it reserves the clipmap's capacity at
31
+ * every build, so it grows when the clipmap does. Readers bind its planes through
32
+ * {@link write_bindings}.
33
+ *
34
+ * **A frame**: the brick clipmap runs it after its store ({@link graph_write_material}), over the
35
+ * cells the frame took: the gather (`shader_brick_material_gather`) clears their texels and gives each
36
+ * that holds a surface the material of that surface's cache, through {@link surface_rows}. It reads the
37
+ * caches, the fields and the transforms the mesh provider read: no ray, no BLAS, no material table.
38
+ *
39
+ * A cell that is not rebuilt keeps its material: a cache baked again reaches the bricks through its
40
+ * rows being invalidated (`ProbeClipmapSceneHolds`).
41
+ */
42
+ export class GPUBrickMaterial {
43
+ /** @type {GPUDevice} */
44
+ #device;
45
+
46
+ /** @type {GPUTileAtlas3D} */
47
+ #atlas;
48
+
49
+ /** @type {BrickProviderContext|null} */
50
+ #context = null;
51
+
52
+ #data = { take: -1, staging: -1, state: -1 };
53
+
54
+ #settings = { ring_capacity: 0, resolution: 0 };
55
+
56
+ #bindings = {};
57
+
58
+ #destroyed = false;
59
+
60
+ /**
61
+ * The row → Model Surface Cache table the gather finds a texel's cache in, a word a `meshes` row
62
+ * (`ProbeClipmapSceneHolds#surface_rows_buffer`). Replaced when it grows: set it each frame.
63
+ * @type {GPUBuffer|null}
64
+ */
65
+ surface_rows = null;
66
+
67
+ /**
68
+ * @param {GPUDevice} device
69
+ * @param {object} options
70
+ * @param {number} options.capacity slots to start with: the brick clipmap's
71
+ */
72
+ constructor(device, { capacity }) {
73
+ assert.defined(device, 'device');
74
+ assert.isPositiveInteger(capacity, 'capacity');
75
+
76
+ this.#device = device;
77
+
78
+ this.#atlas = new GPUTileAtlas3D({
79
+ device,
80
+ formats: [...SURFACE_MATERIAL_FORMATS],
81
+ content_size: [MESH_SDF_BRICK_TEXELS, MESH_SDF_BRICK_TEXELS, MESH_SDF_BRICK_TEXELS],
82
+ border: 0,
83
+ slots_x: BRICK_MATERIAL_SLOTS_XY,
84
+ slots_y: BRICK_MATERIAL_SLOTS_XY,
85
+ capacity,
86
+ // loaded by the hits' readers, stored into by the gather
87
+ usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.STORAGE_BINDING,
88
+ label: 'Probe clipmap / brick material',
89
+ });
90
+
91
+ this.#atlas.reserve(capacity);
92
+ }
93
+
94
+ /**
95
+ * @returns {GPUTileAtlas3D}
96
+ */
97
+ get atlas() {
98
+ return this.#atlas;
99
+ }
100
+
101
+ /**
102
+ * Put what the material's readers (`chunk_brick_material.js`) take into their bindings, under the
103
+ * names they take. The planes are replaced when the capacity grows: take them each frame.
104
+ *
105
+ * @param {Object} bindings
106
+ * @returns {Object} bindings
107
+ */
108
+ write_bindings(bindings) {
109
+ bindings.brick_material_albedo_codes = this.#atlas.texture_at(SURFACE_MATERIAL_ALBEDO_PLANE).obtainView();
110
+ bindings.brick_material_metal_rough_codes = this.#atlas.texture_at(SURFACE_MATERIAL_METAL_ROUGH_PLANE).obtainView();
111
+ bindings.brick_material_emissive_codes = this.#atlas.texture_at(SURFACE_MATERIAL_EMISSIVE_PLANE).obtainView();
112
+
113
+ return bindings;
114
+ }
115
+
116
+ /**
117
+ * Record the gather of the frame's taken cells, after the brick clipmap's store: `GPUBrickClipmap`
118
+ * calls it from its build with the build's context, the store's state handle in it, and its handle
119
+ * is replaced with this pass's, which the bricks' readers come after.
120
+ *
121
+ * @param {FrameGraph} graph
122
+ * @param {BrickProviderContext} context
123
+ */
124
+ graph_write_material(graph, context) {
125
+ assert.notOk(this.#destroyed, 'destroyed');
126
+ assert.defined(context.clipmap, 'context.clipmap');
127
+ assert.defined(context.scene, 'context.scene');
128
+ assert.notNull(this.surface_rows, 'surface_rows');
129
+
130
+ // a tile for each of the clipmap's slots, however it has grown
131
+ this.#atlas.reserve(context.clipmap.capacity);
132
+
133
+ const data = this.#data;
134
+ const pass = graph.add("Brick Clipmap Material", data, this.#execute);
135
+
136
+ data.take = pass.read(context.take);
137
+ data.staging = pass.read(context.staging);
138
+ data.state = pass.write(context.state);
139
+
140
+ pass.make_side_effect();
141
+
142
+ context.state = data.state;
143
+
144
+ this.#context = context;
145
+ }
146
+
147
+ #execute = (data, resources, context) => {
148
+ const frame = this.#context;
149
+ const scene = frame.scene;
150
+ const sdf = scene.geometries.sdf;
151
+ const b = this.#bindings;
152
+
153
+ const take = resources.get(data.take);
154
+
155
+ frame.clipmap.write_bindings(b);
156
+ sdf.write_bindings(b);
157
+ sdf.surfaces.write_bindings(b);
158
+
159
+ b.brick_take = take;
160
+ b.brick_ring = frame.ring;
161
+ b.brick_staging = resources.get(data.staging);
162
+ b.brick_material_albedo_store = this.#atlas.texture_at(SURFACE_MATERIAL_ALBEDO_PLANE).obtainView();
163
+ b.brick_material_metal_rough_store = this.#atlas.texture_at(SURFACE_MATERIAL_METAL_ROUGH_PLANE).obtainView();
164
+ b.brick_material_emissive_store = this.#atlas.texture_at(SURFACE_MATERIAL_EMISSIVE_PLANE).obtainView();
165
+
166
+ // the instances the mesh provider read, and the row → cache table
167
+ b.scene_database = scene.scene_database_buffer;
168
+ b.mesh_surface_rows = this.surface_rows;
169
+
170
+ const settings = this.#settings;
171
+
172
+ settings.ring_capacity = frame.ring_capacity;
173
+ settings.resolution = frame.resolution;
174
+ b.settings = settings;
175
+
176
+ shader_brick_material_gather.dispatchIndirect({
177
+ encoder: context.encoder,
178
+ bindings: b,
179
+ command: take,
180
+ command_offset: 4 * BRICK_TAKE_TEXEL_DISPATCH,
181
+ });
182
+ };
183
+
184
+ destroy() {
185
+ if (this.#destroyed) {
186
+ return;
187
+ }
188
+
189
+ this.#destroyed = true;
190
+
191
+ this.#atlas.destroy();
192
+ }
193
+ }
@@ -0,0 +1,67 @@
1
+ /**
2
+ * @type {ShaderResourceDescriptor}
3
+ */
4
+ export const BRICK_MATERIAL_ALBEDO_RESOURCE: ShaderResourceDescriptor;
5
+ /**
6
+ * @type {ShaderResourceDescriptor}
7
+ */
8
+ export const BRICK_MATERIAL_METAL_ROUGH_RESOURCE: ShaderResourceDescriptor;
9
+ /**
10
+ * @type {ShaderResourceDescriptor}
11
+ */
12
+ export const BRICK_MATERIAL_EMISSIVE_RESOURCE: ShaderResourceDescriptor;
13
+ /**
14
+ * Where a reader stands among a slot's material texels, and which of them hold the surface it is on
15
+ * (`surface_material_corners`), the albedo plane saying which hold a material
16
+ * (`surface_material_present`):
17
+ *
18
+ * ```wgsl
19
+ * fn brick_material_tile(slot: u32) -> vec3<u32>
20
+ * fn brick_material_corners(slot: u32, local: vec3<f32>, normal: vec3<f32>) -> SurfaceMaterialCorners
21
+ * ```
22
+ *
23
+ * `brick_material_tile` is the slot's tile's origin in the planes. `local` is a point by the surface in
24
+ * voxels from the cell's corner, a hit's position, and `normal` the field's normal there. Surfaces
25
+ * within {@link BRICK_TRACE_HIT_VOXELS} of each other are one: a ray stands on a surface from anywhere
26
+ * that far out of it, so it cannot tell closer ones apart.
27
+ *
28
+ * @type {CodeChunk}
29
+ */
30
+ export const chunk_brick_material_corners: CodeChunk;
31
+ /**
32
+ * What a hit's light takes from the brick material, its diffuse albedo and its emissive
33
+ * (`surface_material_surface`):
34
+ *
35
+ * ```wgsl
36
+ * fn brick_material_surface(slot: u32, local: vec3<f32>, normal: vec3<f32>) -> SurfaceMaterialSurface
37
+ * ```
38
+ *
39
+ * @type {CodeChunk}
40
+ */
41
+ export const chunk_brick_material_surface: CodeChunk;
42
+ /**
43
+ * What a hit's light takes from one texel of the brick material, drawn by `u` in [0, 1) in proportion
44
+ * to its weight in {@link chunk_brick_material_surface}'s blend (`surface_material_pick`): the blend on
45
+ * average, over the reads a probe's rays make:
46
+ *
47
+ * ```wgsl
48
+ * fn brick_material_surface_pick(slot: u32, local: vec3<f32>, normal: vec3<f32>, u: f32) -> SurfaceMaterialSurface
49
+ * ```
50
+ *
51
+ * @type {CodeChunk}
52
+ */
53
+ export const chunk_brick_material_surface_pick: CodeChunk;
54
+ /**
55
+ * A hit's metalness and roughness from the brick material (`surface_material_metal_rough`), over the
56
+ * texels {@link chunk_brick_material_surface} takes:
57
+ *
58
+ * ```wgsl
59
+ * fn brick_material_metal_rough(slot: u32, local: vec3<f32>, normal: vec3<f32>) -> SurfaceMaterialMetalRough
60
+ * ```
61
+ *
62
+ * @type {CodeChunk}
63
+ */
64
+ export const chunk_brick_material_metal_rough: CodeChunk;
65
+ import { ShaderResourceDescriptor } from "../../../shader/resource/ShaderResourceDescriptor.js";
66
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
67
+ //# sourceMappingURL=chunk_brick_material.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_brick_material.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material.js"],"names":[],"mappings":"AAgBA;;GAEG;AACH,6CAFU,wBAAwB,CAE0F;AAE5H;;GAEG;AACH,kDAFU,wBAAwB,CAEoG;AAEtI;;GAEG;AACH,+CAFU,wBAAwB,CAE8F;AAEhI;;;;;;;;;;;;;;;;GAgBG;AACH,2CAFU,SAAS,CAqBZ;AAIP;;;;;;;;;GASG;AACH,2CAFU,SAAS,CAWZ;AAIP;;;;;;;;;;GAUG;AACH,gDAFU,SAAS,CAaZ;AAIP;;;;;;;;;GASG;AACH,+CAFU,SAAS,CAWZ;yCArIkC,sDAAsD;0BADrE,uCAAuC"}