@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,99 @@
1
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
2
+ import { ComputeShader } from "../../../shader/ComputeShader.js";
3
+ import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
4
+ import { MESH_SDF_BAKE_WORKGROUP_SIZE } from "../bake/MESH_SDF_BAKE.js";
5
+ import { chunk_mesh_sdf } from "../chunk_mesh_sdf.js";
6
+ import { MESH_SDF_BRICK_TEXEL_COUNT, MESH_SDF_BRICK_TEXELS } from "../MESH_SDF.js";
7
+ import {
8
+ MESH_SDF_ATLAS_RESOURCE,
9
+ MESH_SDF_HEADERS_RESOURCE,
10
+ MESH_SDF_INDIRECTION_RESOURCE,
11
+ MESH_SDF_SAMPLER_RESOURCE
12
+ } from "../MESH_SDF_RESOURCES.js";
13
+ import { chunk_mesh_surface_listed } from "./chunk_mesh_surface_listed.js";
14
+ import { chunk_mesh_surface_run_find } from "./chunk_mesh_surface_run_find.js";
15
+ import {
16
+ MESH_SURFACE_COUNTER_LISTED,
17
+ MESH_SURFACE_COUNTER_RESOURCE,
18
+ MESH_SURFACE_LIST_SETTINGS,
19
+ MESH_SURFACE_RUNS_RESOURCE,
20
+ MESH_SURFACE_STAGING_WORDS,
21
+ MESH_SURFACE_STAGING_WRITE_RESOURCE,
22
+ MESH_SURFACE_TEXEL_STRUCT,
23
+ MESH_SURFACE_TEXELS_WRITE_RESOURCE
24
+ } from "./MESH_SURFACE_BAKE.js";
25
+ import { MESH_SURFACE_RECORDS_RESOURCE } from "./MESH_SURFACE_RESOURCES.js";
26
+ import { MESH_SURFACE_STRUCT } from "./MESH_SURFACE_STRUCT.js";
27
+
28
+ const resources = new ShaderResourceSetDescriptor();
29
+
30
+ resources.setImmediate("settings", MESH_SURFACE_LIST_SETTINGS);
31
+
32
+ resources.createGroup()
33
+ .add(MESH_SDF_HEADERS_RESOURCE)
34
+ .add(MESH_SDF_INDIRECTION_RESOURCE)
35
+ .add(MESH_SDF_ATLAS_RESOURCE)
36
+ .add(MESH_SDF_SAMPLER_RESOURCE)
37
+ .add(MESH_SURFACE_RECORDS_RESOURCE)
38
+ .add(MESH_SURFACE_RUNS_RESOURCE)
39
+ .add(MESH_SURFACE_TEXELS_WRITE_RESOURCE)
40
+ .add(MESH_SURFACE_COUNTER_RESOURCE)
41
+ .add(MESH_SURFACE_STAGING_WRITE_RESOURCE);
42
+
43
+ /**
44
+ * Model Surface Cache bake, first pass (`MESH_SURFACE_BAKE.js`): a thread a texel of the frame's runs'
45
+ * bricks, the bricks a run's cache's field numbered from the run's first number on.
46
+ *
47
+ * Every texel's staging, the slot of its thread, is cleared to no surface. A texel that can hold surface
48
+ * (`mesh_surface_listed`) is listed for the trace, with what it resolved.
49
+ *
50
+ * @type {ComputeShader}
51
+ */
52
+ export const shader_mesh_surface_list = ComputeShader.from({
53
+ label: "Mesh Surface List",
54
+ resources,
55
+ body: CodeChunk.from(
56
+ //language=WGSL
57
+ `
58
+ @compute @workgroup_size(${MESH_SDF_BAKE_WORKGROUP_SIZE})
59
+ fn main(
60
+ @builtin(workgroup_id) workgroup_id: vec3<u32>,
61
+ @builtin(local_invocation_index) lane: u32,
62
+ ) {
63
+ let thread = (workgroup_id.y * settings.groups_x + workgroup_id.x) * ${MESH_SDF_BAKE_WORKGROUP_SIZE}u + lane;
64
+
65
+ if (thread >= settings.thread_count) {
66
+ return;
67
+ }
68
+
69
+ let run = mesh_surface_runs[mesh_surface_run_find(settings.run_count, thread)];
70
+ let offset = thread - run.x;
71
+ let number = run.z + offset / ${MESH_SDF_BRICK_TEXEL_COUNT}u;
72
+ let index = offset % ${MESH_SDF_BRICK_TEXEL_COUNT}u;
73
+
74
+ let record = mesh_surface_records[run.y];
75
+ let header = mesh_sdf_headers[record.geometry];
76
+ let b = mesh_sdf_indirection[mesh_sdf_numbered(header) + number];
77
+
78
+ let t = ${MESH_SDF_BRICK_TEXELS}u;
79
+ let texel = vec3<u32>(index % t, (index / t) % t, index / (t * t));
80
+
81
+ // the albedo word says whether the trace found surface
82
+ mesh_surface_staging[${MESH_SURFACE_STAGING_WORDS}u * thread] = 0u;
83
+
84
+ if (mesh_surface_listed(header, b, texel)) {
85
+ let listed = atomicAdd(&mesh_surface_counter[${MESH_SURFACE_COUNTER_LISTED}u], 1u);
86
+
87
+ if (listed < settings.capacity) {
88
+ mesh_surface_texels[listed] = ${MESH_SURFACE_TEXEL_STRUCT.wgsl_ref}(record.geometry, record.material, b, index, thread);
89
+ }
90
+ }
91
+ }
92
+ `, [
93
+ MESH_SURFACE_STRUCT.declaration_chunk,
94
+ MESH_SURFACE_TEXEL_STRUCT.declaration_chunk,
95
+ chunk_mesh_sdf,
96
+ chunk_mesh_surface_listed,
97
+ chunk_mesh_surface_run_find,
98
+ ]),
99
+ });
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Model Surface Cache survey, first pass (`MESH_SURFACE_BAKE.js`): a thread a texel of the frame's
3
+ * survey runs' bricks, a run a stretch of one field's stored bricks by number. A texel that can hold
4
+ * surface (`mesh_surface_listed`, as the bake lists it) sets its block's bit in its brick's table word,
5
+ * which the host cleared before the field's first run.
6
+ *
7
+ * @type {ComputeShader}
8
+ */
9
+ export const shader_mesh_surface_survey: ComputeShader;
10
+ /**
11
+ * Model Surface Cache survey, second pass: a thread a brick of each field whose survey the frame
12
+ * completes, a run a field's bricks, with its table's word, its result and the ticket the host asked
13
+ * for it under. Each brick takes as many block numbers as its mask has blocks, counted out of its
14
+ * field's result, and its table word becomes its first number above its mask; brick 0 writes the
15
+ * ticket beside the count, so a result no pass wrote is told apart. The numbers of a field's bricks
16
+ * follow the order they are taken in, which nothing reads into.
17
+ *
18
+ * @type {ComputeShader}
19
+ */
20
+ export const shader_mesh_surface_number: ComputeShader;
21
+ import { ComputeShader } from "../../../shader/ComputeShader.js";
22
+ //# sourceMappingURL=shader_mesh_surface_survey.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shader_mesh_surface_survey.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_survey.js"],"names":[],"mappings":"AAoCA;;;;;;;GAOG;AACH,yCAFU,aAAa,CAyCpB;AAWH;;;;;;;;;GASG;AACH,yCAFU,aAAa,CAqCpB;8BA1I2B,kCAAkC"}
@@ -0,0 +1,140 @@
1
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
2
+ import { ComputeShader } from "../../../shader/ComputeShader.js";
3
+ import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
4
+ import { MESH_SDF_BAKE_WORKGROUP_SIZE } from "../bake/MESH_SDF_BAKE.js";
5
+ import { chunk_mesh_sdf } from "../chunk_mesh_sdf.js";
6
+ import { MESH_SDF_BRICK_TEXEL_COUNT, MESH_SDF_BRICK_TEXELS } from "../MESH_SDF.js";
7
+ import {
8
+ MESH_SDF_ATLAS_RESOURCE,
9
+ MESH_SDF_HEADERS_RESOURCE,
10
+ MESH_SDF_INDIRECTION_RESOURCE,
11
+ MESH_SDF_SAMPLER_RESOURCE
12
+ } from "../MESH_SDF_RESOURCES.js";
13
+ import { chunk_mesh_surface_block_index } from "./chunk_mesh_surface_block.js";
14
+ import { chunk_mesh_surface_listed } from "./chunk_mesh_surface_listed.js";
15
+ import { chunk_mesh_surface_run_find } from "./chunk_mesh_surface_run_find.js";
16
+ import {
17
+ MESH_SURFACE_DATA_ATOMIC_RESOURCE,
18
+ MESH_SURFACE_RUNS_RESOURCE,
19
+ MESH_SURFACE_SURVEY_RESULT_WORDS,
20
+ MESH_SURFACE_SURVEY_RESULTS_RESOURCE,
21
+ MESH_SURFACE_SURVEY_SETTINGS
22
+ } from "./MESH_SURFACE_BAKE.js";
23
+ import { MESH_SURFACE_TABLE_MASK_BITS } from "./MESH_SURFACE_BLOCK.js";
24
+
25
+ const survey_resources = new ShaderResourceSetDescriptor();
26
+
27
+ survey_resources.setImmediate("settings", MESH_SURFACE_SURVEY_SETTINGS);
28
+
29
+ survey_resources.createGroup()
30
+ .add(MESH_SDF_HEADERS_RESOURCE)
31
+ .add(MESH_SDF_INDIRECTION_RESOURCE)
32
+ .add(MESH_SDF_ATLAS_RESOURCE)
33
+ .add(MESH_SDF_SAMPLER_RESOURCE)
34
+ .add(MESH_SURFACE_RUNS_RESOURCE)
35
+ .add(MESH_SURFACE_DATA_ATOMIC_RESOURCE);
36
+
37
+ /**
38
+ * Model Surface Cache survey, first pass (`MESH_SURFACE_BAKE.js`): a thread a texel of the frame's
39
+ * survey runs' bricks, a run a stretch of one field's stored bricks by number. A texel that can hold
40
+ * surface (`mesh_surface_listed`, as the bake lists it) sets its block's bit in its brick's table word,
41
+ * which the host cleared before the field's first run.
42
+ *
43
+ * @type {ComputeShader}
44
+ */
45
+ export const shader_mesh_surface_survey = ComputeShader.from({
46
+ label: "Mesh Surface Survey",
47
+ resources: survey_resources,
48
+ body: CodeChunk.from(
49
+ //language=WGSL
50
+ `
51
+ @compute @workgroup_size(${MESH_SDF_BAKE_WORKGROUP_SIZE})
52
+ fn main(
53
+ @builtin(workgroup_id) workgroup_id: vec3<u32>,
54
+ @builtin(local_invocation_index) lane: u32,
55
+ ) {
56
+ let thread = (workgroup_id.y * settings.groups_x + workgroup_id.x) * ${MESH_SDF_BAKE_WORKGROUP_SIZE}u + lane;
57
+
58
+ if (thread >= settings.thread_count) {
59
+ return;
60
+ }
61
+
62
+ // its first thread, the geometry, its first brick number, its table's word
63
+ let run = mesh_surface_runs[mesh_surface_run_find(settings.run_count, thread)];
64
+ let offset = thread - run.x;
65
+ let number = run.z + offset / ${MESH_SDF_BRICK_TEXEL_COUNT}u;
66
+ let index = offset % ${MESH_SDF_BRICK_TEXEL_COUNT}u;
67
+
68
+ let header = mesh_sdf_headers[run.y];
69
+ let b = mesh_sdf_indirection[mesh_sdf_numbered(header) + number];
70
+
71
+ let t = ${MESH_SDF_BRICK_TEXELS}u;
72
+ let texel = vec3<u32>(index % t, (index / t) % t, index / (t * t));
73
+
74
+ if (mesh_surface_listed(header, b, texel)) {
75
+ atomicOr(&mesh_surface_data[run.w + number], 1u << mesh_surface_block_of(texel));
76
+ }
77
+ }
78
+ `, [
79
+ chunk_mesh_sdf,
80
+ chunk_mesh_surface_listed,
81
+ chunk_mesh_surface_block_index,
82
+ chunk_mesh_surface_run_find,
83
+ ]),
84
+ });
85
+
86
+ const number_resources = new ShaderResourceSetDescriptor();
87
+
88
+ number_resources.setImmediate("settings", MESH_SURFACE_SURVEY_SETTINGS);
89
+
90
+ number_resources.createGroup()
91
+ .add(MESH_SURFACE_RUNS_RESOURCE)
92
+ .add(MESH_SURFACE_DATA_ATOMIC_RESOURCE)
93
+ .add(MESH_SURFACE_SURVEY_RESULTS_RESOURCE);
94
+
95
+ /**
96
+ * Model Surface Cache survey, second pass: a thread a brick of each field whose survey the frame
97
+ * completes, a run a field's bricks, with its table's word, its result and the ticket the host asked
98
+ * for it under. Each brick takes as many block numbers as its mask has blocks, counted out of its
99
+ * field's result, and its table word becomes its first number above its mask; brick 0 writes the
100
+ * ticket beside the count, so a result no pass wrote is told apart. The numbers of a field's bricks
101
+ * follow the order they are taken in, which nothing reads into.
102
+ *
103
+ * @type {ComputeShader}
104
+ */
105
+ export const shader_mesh_surface_number = ComputeShader.from({
106
+ label: "Mesh Surface Number",
107
+ resources: number_resources,
108
+ body: CodeChunk.from(
109
+ //language=WGSL
110
+ `
111
+ @compute @workgroup_size(${MESH_SDF_BAKE_WORKGROUP_SIZE})
112
+ fn main(
113
+ @builtin(workgroup_id) workgroup_id: vec3<u32>,
114
+ @builtin(local_invocation_index) lane: u32,
115
+ ) {
116
+ let thread = (workgroup_id.y * settings.groups_x + workgroup_id.x) * ${MESH_SDF_BAKE_WORKGROUP_SIZE}u + lane;
117
+
118
+ if (thread >= settings.thread_count) {
119
+ return;
120
+ }
121
+
122
+ // its first thread, its table's word, its result, its ticket
123
+ let run = mesh_surface_runs[mesh_surface_run_find(settings.run_count, thread)];
124
+ let number = thread - run.x;
125
+ let word = run.y + number;
126
+ let result = ${MESH_SURFACE_SURVEY_RESULT_WORDS}u * run.z;
127
+
128
+ let mask = atomicLoad(&mesh_surface_data[word]) & ${(1 << MESH_SURFACE_TABLE_MASK_BITS) - 1}u;
129
+ let first = atomicAdd(&mesh_surface_survey_results[result + 1u], countOneBits(mask));
130
+
131
+ atomicStore(&mesh_surface_data[word], (first << ${MESH_SURFACE_TABLE_MASK_BITS}u) | mask);
132
+
133
+ if (number == 0u) {
134
+ atomicStore(&mesh_surface_survey_results[result], run.w);
135
+ }
136
+ }
137
+ `, [
138
+ chunk_mesh_surface_run_find,
139
+ ]),
140
+ });
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Model Surface Cache bake, third pass (`MESH_SURFACE_BAKE.js`): a workgroup a texel the list pass
3
+ * listed, a thread a ray, dispatched through the command pass's command. All of it in the geometry's
4
+ * local space, against its own triangles: nothing else of the scene is there to be seen.
5
+ *
6
+ * - **The rays** look at the texel's nearest surface point, which the field puts d against n from the
7
+ * texel, from {@link MESH_SURFACE_LIFT_VOXELS} out from it along n. They leave along the texel's own
8
+ * Fibonacci set of {@link MESH_SURFACE_TEXEL_RAYS} directions over the hemisphere facing the surface
9
+ * (`mesh_surface_texel_ray`: turned about n and shifted through its bands by the texel's seed), into
10
+ * the geometry's BLAS (`ray_query_blas_nearest`), as far as the texel's tent reaches. A texel so holds the surface as a ray of the GI meets it, from outside the
11
+ * field: one in a gap the field closes sees the face the field puts there.
12
+ * - **A hit** is opaque with probability its opacity (`sample_material_alpha`), as the path tracer
13
+ * takes alpha; a transparent one is stepped past, {@link MESH_SURFACE_ALPHA_CONTINUATIONS} times at most.
14
+ * - **The sample** is the first opaque hit under the tent, weighted by the tent there, and the material
15
+ * there (`sample_material_data`): its diffuse albedo, albedo × (1 − metalness), its metalness and
16
+ * roughness, and its emissive. A hit the field says the ray met from behind gives no sample: the
17
+ * field's normal half a voxel back along the ray says so. The material's textures are read at a
18
+ * footprint a voxel of the level across on the triangle (`beam_texture_level`), filtered exactly
19
+ * ({@link IndirectTextureFilter.Exact}), since the sample is stored rather than averaged over frames.
20
+ * - **The fit**: the first thread adds the workgroup's samples into the texel's fit
21
+ * (`chunk_surface_material_fit`) and writes its codes into the texel's staging, which the encode
22
+ * takes into the cache's blocks. A texel no ray found surface under keeps the list pass's clear: no
23
+ * material.
24
+ *
25
+ * The draws are seeded by the geometry, the brick and the texel alone: a cache baked again over an
26
+ * unchanged geometry and material bakes the same codes.
27
+ *
28
+ * @type {ComputeShader}
29
+ */
30
+ export const shader_mesh_surface_trace: ComputeShader;
31
+ import { ComputeShader } from "../../../shader/ComputeShader.js";
32
+ //# sourceMappingURL=shader_mesh_surface_trace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shader_mesh_surface_trace.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_trace.js"],"names":[],"mappings":"AA8DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wCAFU,aAAa,CA2KsE;8BApP/D,kCAAkC"}
@@ -0,0 +1,261 @@
1
+ import { INDIRECT_MATERIAL_ARRAY_TYPE } from "../../../material/resident/INDIRECT_MATERIAL_ARRAY_TYPE.js";
2
+ import { chunk_beam_texture_level } from "../../../path_tracer/shader/chunk_beam_texture_level.js";
3
+ import { chunk_sample_material_alpha, chunk_sample_material_data } from "../../../path_tracer/shader/chunk_sample_material_data.js";
4
+ import { INDIRECT_TEXTURE_FILTER } from "../../../path_tracer/shader/INDIRECT_TEXTURE_FILTER.js";
5
+ import { IndirectTextureFilter } from "../../../path_tracer/shader/IndirectTextureFilter.js";
6
+ import { BVH_TRAVERSAL_STACK_SIZE } from "../../../shader/chunk/bvh/BVH_TRAVERSAL_STACK_SIZE.js";
7
+ import { chunk_geometry_read_triangle_vertices } from "../../../shader/chunk/geometry/format/chunk_geometry_read_triangle_vertices.js";
8
+ import { MAT4_IDENTITY_DEFINITION } from "../../../shader/chunk/geometry/mat4/MAT4_IDENTITY_DEFINITION.js";
9
+ import { chunk_build_orthonormal_matrix_n } from "../../../shader/chunk/geometry/normal/chunk_build_orthonormal_matrix_n.js";
10
+ import { chunk_ray_query_blas_nearest } from "../../../shader/chunk/geometry/ray/chunk_ray_query_blas_nearest.js";
11
+ import { RAY_STRUCT } from "../../../shader/chunk/geometry/ray/RAY_STRUCT.js";
12
+ import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
13
+ import { chunk_random } from "../../../shader/chunk/random/chunk_random.js";
14
+ import { chunk_random_initialize } from "../../../shader/chunk/random/chunk_random_initialize.js";
15
+ import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
16
+ import { ShaderSwitchSet } from "../../../shader/compiler/ShaderSwitchSet.js";
17
+ import { ComputeShader } from "../../../shader/ComputeShader.js";
18
+ import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
19
+ import { mesh_sdf_add_blas_resources } from "../bake/shader_mesh_sdf_classify.js";
20
+ import { chunk_mesh_sdf } from "../chunk_mesh_sdf.js";
21
+ import { chunk_mesh_sdf_normal } from "../chunk_mesh_sdf_normal.js";
22
+ import { chunk_mesh_surface_texel_ray } from "./chunk_mesh_surface_texel_ray.js";
23
+ import { MESH_SDF_BRICK_TEXELS } from "../MESH_SDF.js";
24
+ import {
25
+ MESH_SDF_ATLAS_RESOURCE,
26
+ MESH_SDF_HEADERS_RESOURCE,
27
+ MESH_SDF_INDIRECTION_RESOURCE,
28
+ MESH_SDF_SAMPLER_RESOURCE
29
+ } from "../MESH_SDF_RESOURCES.js";
30
+ import { chunk_rgbe9995_encode } from "../../../shader/chunk/color/rgbe9995/chunk_rgbe9995_encode.js";
31
+ import { chunk_albedo_compress } from "../../../shader/chunk/material/chunk_albedo_compress.js";
32
+ import { chunk_metal_rough_compress } from "../../../shader/chunk/material/chunk_metal_rough_compress.js";
33
+ import { chunk_surface_material_fit } from "./chunk_surface_material_fit.js";
34
+ import {
35
+ MESH_SURFACE_ALPHA_CONTINUATIONS,
36
+ MESH_SURFACE_COUNTER_READ_RESOURCE,
37
+ MESH_SURFACE_COUNTER_TRACED,
38
+ MESH_SURFACE_LIFT_VOXELS,
39
+ MESH_SURFACE_STAGING_WORDS,
40
+ MESH_SURFACE_STAGING_WRITE_RESOURCE,
41
+ MESH_SURFACE_TEXEL_RAYS,
42
+ MESH_SURFACE_TEXEL_STRUCT,
43
+ MESH_SURFACE_TEXELS_READ_RESOURCE
44
+ } from "./MESH_SURFACE_BAKE.js";
45
+
46
+ const resources = new ShaderResourceSetDescriptor();
47
+
48
+ resources.createGroup()
49
+ .add(MESH_SDF_HEADERS_RESOURCE)
50
+ .add(MESH_SDF_INDIRECTION_RESOURCE)
51
+ .add(MESH_SDF_ATLAS_RESOURCE)
52
+ .add(MESH_SDF_SAMPLER_RESOURCE)
53
+ .add(MESH_SURFACE_TEXELS_READ_RESOURCE)
54
+ .add(MESH_SURFACE_COUNTER_READ_RESOURCE)
55
+ .add(MESH_SURFACE_STAGING_WRITE_RESOURCE);
56
+
57
+ resources.createGroup({ label: "materials" })
58
+ .addUniform("materials", INDIRECT_MATERIAL_ARRAY_TYPE)
59
+ .addTexture("textures", "unfilterable-float", "2d-array", false);
60
+
61
+ mesh_sdf_add_blas_resources(resources.createGroup());
62
+
63
+ /**
64
+ * Model Surface Cache bake, third pass (`MESH_SURFACE_BAKE.js`): a workgroup a texel the list pass
65
+ * listed, a thread a ray, dispatched through the command pass's command. All of it in the geometry's
66
+ * local space, against its own triangles: nothing else of the scene is there to be seen.
67
+ *
68
+ * - **The rays** look at the texel's nearest surface point, which the field puts d against n from the
69
+ * texel, from {@link MESH_SURFACE_LIFT_VOXELS} out from it along n. They leave along the texel's own
70
+ * Fibonacci set of {@link MESH_SURFACE_TEXEL_RAYS} directions over the hemisphere facing the surface
71
+ * (`mesh_surface_texel_ray`: turned about n and shifted through its bands by the texel's seed), into
72
+ * the geometry's BLAS (`ray_query_blas_nearest`), as far as the texel's tent reaches. A texel so holds the surface as a ray of the GI meets it, from outside the
73
+ * field: one in a gap the field closes sees the face the field puts there.
74
+ * - **A hit** is opaque with probability its opacity (`sample_material_alpha`), as the path tracer
75
+ * takes alpha; a transparent one is stepped past, {@link MESH_SURFACE_ALPHA_CONTINUATIONS} times at most.
76
+ * - **The sample** is the first opaque hit under the tent, weighted by the tent there, and the material
77
+ * there (`sample_material_data`): its diffuse albedo, albedo × (1 − metalness), its metalness and
78
+ * roughness, and its emissive. A hit the field says the ray met from behind gives no sample: the
79
+ * field's normal half a voxel back along the ray says so. The material's textures are read at a
80
+ * footprint a voxel of the level across on the triangle (`beam_texture_level`), filtered exactly
81
+ * ({@link IndirectTextureFilter.Exact}), since the sample is stored rather than averaged over frames.
82
+ * - **The fit**: the first thread adds the workgroup's samples into the texel's fit
83
+ * (`chunk_surface_material_fit`) and writes its codes into the texel's staging, which the encode
84
+ * takes into the cache's blocks. A texel no ray found surface under keeps the list pass's clear: no
85
+ * material.
86
+ *
87
+ * The draws are seeded by the geometry, the brick and the texel alone: a cache baked again over an
88
+ * unchanged geometry and material bakes the same codes.
89
+ *
90
+ * @type {ComputeShader}
91
+ */
92
+ export const shader_mesh_surface_trace = ComputeShader.from({
93
+ label: "Mesh Surface Trace",
94
+ resources,
95
+ body: CodeChunk.from(
96
+ //language=WGSL
97
+ `
98
+ var<workgroup> traced_count: u32;
99
+
100
+ /** a ray's sample's weight, 0 for no sample */
101
+ var<workgroup> sample_weight: array<f32, ${MESH_SURFACE_TEXEL_RAYS}>;
102
+ /** diffuse albedo and metalness */
103
+ var<workgroup> sample_albedo: array<vec4<f32>, ${MESH_SURFACE_TEXEL_RAYS}>;
104
+ /** emissive and roughness */
105
+ var<workgroup> sample_emissive: array<vec4<f32>, ${MESH_SURFACE_TEXEL_RAYS}>;
106
+
107
+ fn mesh_surface_tent(d: vec3<f32>) -> f32 {
108
+ let w = max(vec3<f32>(0.0), vec3<f32>(1.0) - abs(d));
109
+
110
+ return w.x * w.y * w.z;
111
+ }
112
+
113
+ @compute @workgroup_size(${MESH_SURFACE_TEXEL_RAYS})
114
+ fn main(
115
+ @builtin(workgroup_id) workgroup_id: vec3<u32>,
116
+ @builtin(local_invocation_index) ray_index: u32,
117
+ ) {
118
+ let listed = folded_workgroup_index(workgroup_id);
119
+
120
+ if (ray_index == 0u) {
121
+ traced_count = mesh_surface_counter[${MESH_SURFACE_COUNTER_TRACED}u];
122
+ }
123
+
124
+ if (listed >= workgroupUniformLoad(&traced_count)) {
125
+ return;
126
+ }
127
+
128
+ let entry = mesh_surface_texels[listed];
129
+ let header = mesh_sdf_headers[entry.geometry];
130
+ let brick = mesh_sdf_brick_of(header, entry.brick);
131
+ let voxel = mesh_sdf_level_voxel(header, brick.x);
132
+
133
+ let s = ${MESH_SDF_BRICK_TEXELS}u;
134
+ let t = vec3<u32>(entry.texel % s, (entry.texel / s) % s, entry.texel / (s * s));
135
+ let texel = mesh_sdf_brick_corner(header, brick) + vec3<f32>(t) * voxel;
136
+
137
+ // the texel's nearest surface point, d against n, and how far out from it the rays leave
138
+ let d = mesh_sdf_sample(header, brick.x, texel);
139
+ let n = mesh_sdf_normal(header, brick.x, texel);
140
+ let lift = ${MESH_SURFACE_LIFT_VOXELS} * voxel - d;
141
+
142
+ // the texel's own set of directions, then each ray's own draws
143
+ let seed = vec3<u32>(entry.geometry, entry.brick, entry.texel);
144
+ let direction = mesh_surface_texel_ray(seed, ray_index, n);
145
+
146
+ random_initialize(seed, vec3<u32>(ray_index + 1u, 1u, 0u));
147
+
148
+ var ray: ${RAY_STRUCT.wgsl_ref};
149
+
150
+ ray.origin = texel + lift * n;
151
+ ray.direction = direction;
152
+ ray.tmax = abs(lift) + ${Math.sqrt(3).toFixed(6)} * voxel;
153
+
154
+ let material = materials[entry.material];
155
+
156
+ var stack: array<u32, ${BVH_TRAVERSAL_STACK_SIZE}>;
157
+
158
+ var weight = 0.0;
159
+ var albedo = vec4<f32>(0.0);
160
+ var emissive = vec4<f32>(0.0);
161
+
162
+ for (var step = 0u; step <= ${MESH_SURFACE_ALPHA_CONTINUATIONS}u; step++) {
163
+ let hit = ray_query_blas_nearest(ray, entry.geometry, &stack, 0u);
164
+
165
+ if (hit.t < 0.0) {
166
+ break;
167
+ }
168
+
169
+ let triangle = geometry_read_triangle_vertices(geometries[entry.geometry], hit.triangle);
170
+ let lambda = vec3<f32>(1.0 - hit.barycentrics.x - hit.barycentrics.y, hit.barycentrics.x, hit.barycentrics.y);
171
+
172
+ // a footprint a voxel of the level across on the triangle, whatever angle the ray came in at
173
+ let facing = normalize(cross(triangle.b.position - triangle.a.position, triangle.c.position - triangle.a.position));
174
+ let in_plane = build_orthonormal_matrix_n(facing);
175
+ let level = beam_texture_level(triangle, facing, in_plane[0] * voxel, in_plane[1] * voxel);
176
+
177
+ if (random() < sample_material_alpha(material, triangle, lambda, MAT4_IDENTITY, ray.direction, level).opacity) {
178
+ let local = ray.origin + hit.t * ray.direction;
179
+ let w = mesh_surface_tent((local - texel) / voxel);
180
+
181
+ if (w > 0.0) {
182
+ // the field's normal on the ray's side, where a ray of the GI on this path would stand
183
+ let field = mesh_sdf_normal(header, brick.x, local - ${MESH_SURFACE_LIFT_VOXELS} * voxel * ray.direction);
184
+
185
+ // a surface met from behind, from inside a solid, is one the GI never shades
186
+ if (dot(field, ray.direction) < 0.0) {
187
+ let data = sample_material_data(ray, material, triangle, lambda, MAT4_IDENTITY, level);
188
+
189
+ weight = w;
190
+ albedo = vec4<f32>(data.albedo * (1.0 - data.metalness), data.metalness);
191
+ emissive = vec4<f32>(data.emissive, data.roughness);
192
+ }
193
+ }
194
+
195
+ break;
196
+ }
197
+
198
+ // past the transparent hit, by a sliver of a voxel
199
+ let skip = hit.t + 1e-3 * voxel;
200
+
201
+ ray.origin += ray.direction * skip;
202
+ ray.tmax -= skip;
203
+
204
+ if (ray.tmax <= 0.0) {
205
+ break;
206
+ }
207
+ }
208
+
209
+ sample_weight[ray_index] = weight;
210
+ sample_albedo[ray_index] = albedo;
211
+ sample_emissive[ray_index] = emissive;
212
+
213
+ workgroupBarrier();
214
+
215
+ if (ray_index == 0u) {
216
+ var fit: SurfaceMaterialFit;
217
+
218
+ for (var i = 0u; i < ${MESH_SURFACE_TEXEL_RAYS}u; i++) {
219
+ let w = sample_weight[i];
220
+
221
+ if (w > 0.0) {
222
+ let a = sample_albedo[i];
223
+ let e = sample_emissive[i];
224
+
225
+ surface_material_fit_add(&fit, w, a.rgb, vec2<f32>(a.a, e.a), e.rgb);
226
+ }
227
+ }
228
+
229
+ let fitted = surface_material_fit_solve(fit);
230
+
231
+ if (fitted.covered) {
232
+ let at = ${MESH_SURFACE_STAGING_WORDS}u * entry.slot;
233
+
234
+ mesh_surface_staging[at] = albedo_compress(fitted.albedo);
235
+ mesh_surface_staging[at + 1u] = metal_rough_compress(fitted.metal_rough);
236
+ mesh_surface_staging[at + 2u] = rgbe9995_encode(fitted.emissive);
237
+ }
238
+ }
239
+ }
240
+ `, [
241
+ RAY_STRUCT.declaration_chunk,
242
+ MESH_SURFACE_TEXEL_STRUCT.declaration_chunk,
243
+ MAT4_IDENTITY_DEFINITION,
244
+ chunk_folded_workgroup_index,
245
+ chunk_mesh_sdf,
246
+ chunk_mesh_sdf_normal,
247
+ chunk_surface_material_fit,
248
+ chunk_albedo_compress,
249
+ chunk_metal_rough_compress,
250
+ chunk_rgbe9995_encode,
251
+ chunk_random,
252
+ chunk_random_initialize,
253
+ chunk_mesh_surface_texel_ray,
254
+ chunk_ray_query_blas_nearest,
255
+ chunk_geometry_read_triangle_vertices,
256
+ chunk_build_orthonormal_matrix_n,
257
+ chunk_beam_texture_level,
258
+ chunk_sample_material_alpha,
259
+ chunk_sample_material_data,
260
+ ]),
261
+ }).variant(ShaderSwitchSet.EMPTY.with(INDIRECT_TEXTURE_FILTER, IndirectTextureFilter.Exact));
@@ -37,8 +37,8 @@ export class VirtualGeometry extends MeshletGeometry {
37
37
  */
38
38
  vg_row: number;
39
39
  /**
40
- * An ordinary geometry standing in for this one where a plain mesh is needed: what its geometry cache is baked
41
- * from and its cards are drawn from. A cut of the container ({@link vgeo_to_proxy_mesh}) at
40
+ * An ordinary geometry standing in for this one where a plain mesh is needed: what its geometry cache and
41
+ * surface caches are baked from. A cut of the container ({@link vgeo_to_proxy_mesh}) at
42
42
  * {@link vgeo_proxy_triangle_limit} of the source's triangles, in the geometry's own space, with its attributes;
43
43
  * asked for once, and the same proxy every time after.
44
44
  *
@@ -74,8 +74,8 @@ export class VirtualGeometry extends MeshletGeometry {
74
74
  }
75
75
 
76
76
  /**
77
- * An ordinary geometry standing in for this one where a plain mesh is needed: what its geometry cache is baked
78
- * from and its cards are drawn from. A cut of the container ({@link vgeo_to_proxy_mesh}) at
77
+ * An ordinary geometry standing in for this one where a plain mesh is needed: what its geometry cache and
78
+ * surface caches are baked from. A cut of the container ({@link vgeo_to_proxy_mesh}) at
79
79
  * {@link vgeo_proxy_triangle_limit} of the source's triangles, in the geometry's own space, with its attributes;
80
80
  * asked for once, and the same proxy every time after.
81
81
  *
@@ -1,16 +1,16 @@
1
1
  /**
2
- * The geometry caches and cards of virtual geometry (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §7.8, §17).
3
- * {@link GPUGeometrySDFManager} bakes a geometry's field from its tree and captures its cards through its meshlets, and
4
- * a virtual geometry has neither.
2
+ * The geometry caches and surface caches of virtual geometry (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §7.8, §17).
3
+ * {@link GPUGeometrySDFManager} bakes a geometry's field and its surface caches from its tree, and a virtual geometry
4
+ * has none.
5
5
  *
6
6
  * Each virtual geometry whose cache is asked for gets its proxy ({@link VirtualGeometry#get_proxy}): an ordinary
7
7
  * geometry in the same local space, with its attributes. The proxy is added to the geometry manager and the virtual
8
8
  * geometry aliased to it ({@link GPUGeometrySDFManager#alias}). From there the proxy is any geometry: the virtual
9
- * geometry's holders hold its cache, baked from its tree, and the virtual geometry's card sets capture its layout,
10
- * drawn through its meshlets with the virtual geometry's own materials.
9
+ * geometry's holders hold its cache, baked from its tree, and the virtual geometry's surface caches follow its field,
10
+ * baked from its triangles with the virtual geometry's own materials.
11
11
  *
12
12
  * **The proxy's detail is its own**, not the cache's voxel's: a proxy coarser than the voxel bakes a coarser field and
13
- * coarser cards than the asset would. A known discrepancy, kept: a hit on virtual geometry has a material at all.
13
+ * coarser surface caches than the asset would. A known discrepancy, kept: a hit on virtual geometry has a material at all.
14
14
  *
15
15
  * A proxy is applied as it arrives, which is between frames: adding a geometry grows the geometry manager's buffers,
16
16
  * which a frame's passes must not find replaced under them. A virtual geometry the geometry manager lets go takes its
@@ -21,18 +21,18 @@ class VGeoProxyEntry {
21
21
  }
22
22
 
23
23
  /**
24
- * The geometry caches and cards of virtual geometry (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §7.8, §17).
25
- * {@link GPUGeometrySDFManager} bakes a geometry's field from its tree and captures its cards through its meshlets, and
26
- * a virtual geometry has neither.
24
+ * The geometry caches and surface caches of virtual geometry (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §7.8, §17).
25
+ * {@link GPUGeometrySDFManager} bakes a geometry's field and its surface caches from its tree, and a virtual geometry
26
+ * has none.
27
27
  *
28
28
  * Each virtual geometry whose cache is asked for gets its proxy ({@link VirtualGeometry#get_proxy}): an ordinary
29
29
  * geometry in the same local space, with its attributes. The proxy is added to the geometry manager and the virtual
30
30
  * geometry aliased to it ({@link GPUGeometrySDFManager#alias}). From there the proxy is any geometry: the virtual
31
- * geometry's holders hold its cache, baked from its tree, and the virtual geometry's card sets capture its layout,
32
- * drawn through its meshlets with the virtual geometry's own materials.
31
+ * geometry's holders hold its cache, baked from its tree, and the virtual geometry's surface caches follow its field,
32
+ * baked from its triangles with the virtual geometry's own materials.
33
33
  *
34
34
  * **The proxy's detail is its own**, not the cache's voxel's: a proxy coarser than the voxel bakes a coarser field and
35
- * coarser cards than the asset would. A known discrepancy, kept: a hit on virtual geometry has a material at all.
35
+ * coarser surface caches than the asset would. A known discrepancy, kept: a hit on virtual geometry has a material at all.
36
36
  *
37
37
  * A proxy is applied as it arrives, which is between frames: adding a geometry grows the geometry manager's buffers,
38
38
  * which a frame's passes must not find replaced under them. A virtual geometry the geometry manager lets go takes its
@@ -133,7 +133,7 @@ export class VGeoSDFProxies {
133
133
  this.#asked.delete(record.index);
134
134
  this.#failed_count++;
135
135
 
136
- console.warn('vgeo: no proxy, the geometry has no cache or cards', error);
136
+ console.warn('vgeo: no proxy, the geometry has no cache or surface caches', error);
137
137
  }
138
138
  }
139
139
  );