@woosh/meep-engine 3.61.1 → 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 (474) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/package.json +1 -1
  3. package/src/engine/network/sim/SimActionExecutor.d.ts +4 -0
  4. package/src/engine/network/sim/SimActionExecutor.d.ts.map +1 -1
  5. package/src/engine/network/sim/SimActionExecutor.js +4 -0
  6. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  7. package/src/generation/foliage/material/foliage_atlas_cutout.d.ts.map +1 -1
  8. package/src/generation/foliage/material/foliage_atlas_cutout.js +21 -5
  9. package/src/generation/foliage/mesh/tree_cluster_representatives.d.ts +8 -0
  10. package/src/generation/foliage/mesh/tree_cluster_representatives.d.ts.map +1 -1
  11. package/src/generation/foliage/mesh/tree_cluster_representatives.js +178 -78
  12. package/src/generation/foliage/mesh/tree_mesh_build_bark.d.ts.map +1 -1
  13. package/src/generation/foliage/mesh/tree_mesh_build_bark.js +178 -97
  14. package/src/generation/foliage/skeleton/ShootLightField.d.ts +1 -0
  15. package/src/generation/foliage/skeleton/ShootLightField.d.ts.map +1 -1
  16. package/src/generation/foliage/skeleton/ShootLightField.js +88 -17
  17. package/src/generation/foliage/skeleton/ShootWoodHash.d.ts +5 -2
  18. package/src/generation/foliage/skeleton/ShootWoodHash.d.ts.map +1 -1
  19. package/src/generation/foliage/skeleton/ShootWoodHash.js +191 -25
  20. package/src/shade/playground/probe_clipmap/README.md +3 -4
  21. package/src/shade/playground/probe_clipmap/index.html +5 -13
  22. package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -1
  23. package/src/shade/playground/probe_clipmap/main.js +4 -5
  24. package/src/shade/playground/probe_clipmap_box/README.md +55 -0
  25. package/src/shade/playground/probe_clipmap_box/index.html +185 -0
  26. package/src/shade/playground/probe_clipmap_box/main.d.ts +8 -0
  27. package/src/shade/playground/probe_clipmap_box/main.d.ts.map +1 -0
  28. package/src/shade/playground/probe_clipmap_box/main.js +323 -0
  29. package/src/shade/playground/probe_clipmap_box/scene.d.ts +93 -0
  30. package/src/shade/playground/probe_clipmap_box/scene.d.ts.map +1 -0
  31. package/src/shade/playground/probe_clipmap_box/scene.js +256 -0
  32. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  33. package/src/shade/renderer/Renderer.js +56 -12
  34. package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
  35. package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
  36. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +6 -6
  37. package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
  38. package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
  39. package/src/shade/renderer/geometry/meshlet/meshlet_batch_colored.d.ts +10 -0
  40. package/src/shade/renderer/geometry/meshlet/meshlet_batch_colored.d.ts.map +1 -0
  41. package/src/shade/renderer/geometry/meshlet/meshlet_batch_colored.js +54 -0
  42. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts +85 -36
  43. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts.map +1 -1
  44. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +813 -412
  45. package/src/shade/renderer/geometry/sdf/MESH_SDF.d.ts +7 -0
  46. package/src/shade/renderer/geometry/sdf/MESH_SDF.d.ts.map +1 -1
  47. package/src/shade/renderer/geometry/sdf/MESH_SDF.js +8 -0
  48. package/src/shade/renderer/geometry/sdf/MESH_SDF_BRICK_KEY.d.ts +14 -0
  49. package/src/shade/renderer/geometry/sdf/MESH_SDF_BRICK_KEY.d.ts.map +1 -0
  50. package/src/shade/renderer/geometry/sdf/MESH_SDF_BRICK_KEY.js +35 -0
  51. package/src/shade/renderer/geometry/sdf/MESH_SDF_STRUCT.d.ts.map +1 -1
  52. package/src/shade/renderer/geometry/sdf/MESH_SDF_STRUCT.js +0 -4
  53. package/src/shade/renderer/geometry/sdf/bake/MESH_SDF_BAKE.d.ts +55 -10
  54. package/src/shade/renderer/geometry/sdf/bake/MESH_SDF_BAKE.d.ts.map +1 -1
  55. package/src/shade/renderer/geometry/sdf/bake/MESH_SDF_BAKE.js +86 -16
  56. package/src/shade/renderer/geometry/sdf/bake/chunk_mesh_sdf_bake.d.ts +2 -2
  57. package/src/shade/renderer/geometry/sdf/bake/chunk_mesh_sdf_bake.d.ts.map +1 -1
  58. package/src/shade/renderer/geometry/sdf/bake/chunk_mesh_sdf_bake.js +28 -2
  59. package/src/shade/renderer/geometry/sdf/bake/chunk_mesh_sdf_contents.d.ts +54 -0
  60. package/src/shade/renderer/geometry/sdf/bake/chunk_mesh_sdf_contents.d.ts.map +1 -0
  61. package/src/shade/renderer/geometry/sdf/bake/chunk_mesh_sdf_contents.js +146 -0
  62. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.d.ts +1 -1
  63. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.d.ts.map +1 -1
  64. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.js +2 -1
  65. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_content_rehash.d.ts +18 -0
  66. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_content_rehash.d.ts.map +1 -0
  67. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_content_rehash.js +66 -0
  68. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_count.d.ts +17 -0
  69. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_count.d.ts.map +1 -0
  70. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_count.js +66 -0
  71. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.d.ts +5 -3
  72. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.d.ts.map +1 -1
  73. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.js +15 -14
  74. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_free.d.ts +2 -1
  75. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_free.d.ts.map +1 -1
  76. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_free.js +12 -3
  77. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_key.d.ts +21 -0
  78. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_key.d.ts.map +1 -0
  79. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_key.js +84 -0
  80. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_resolve.d.ts +53 -0
  81. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_resolve.d.ts.map +1 -0
  82. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_resolve.js +343 -0
  83. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_store.d.ts +3 -3
  84. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_store.d.ts.map +1 -1
  85. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_store.js +9 -5
  86. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_take.d.ts +2 -2
  87. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_take.d.ts.map +1 -1
  88. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_take.js +3 -2
  89. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_upload.d.ts +69 -0
  90. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_upload.d.ts.map +1 -0
  91. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_upload.js +294 -0
  92. package/src/shade/renderer/geometry/sdf/bundle/MODEL_CACHE_BUNDLE.d.ts +16 -0
  93. package/src/shade/renderer/geometry/sdf/bundle/MODEL_CACHE_BUNDLE.d.ts.map +1 -0
  94. package/src/shade/renderer/geometry/sdf/bundle/MODEL_CACHE_BUNDLE.js +36 -0
  95. package/src/shade/renderer/geometry/sdf/bundle/ModelCacheBundle.d.ts +126 -0
  96. package/src/shade/renderer/geometry/sdf/bundle/ModelCacheBundle.d.ts.map +1 -0
  97. package/src/shade/renderer/geometry/sdf/bundle/ModelCacheBundle.js +148 -0
  98. package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_read.d.ts +10 -0
  99. package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_read.d.ts.map +1 -0
  100. package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_read.js +140 -0
  101. package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_write.d.ts +8 -0
  102. package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_write.d.ts.map +1 -0
  103. package/src/shade/renderer/geometry/sdf/bundle/model_cache_bundle_write.js +76 -0
  104. package/src/shade/renderer/geometry/sdf/chunk_mesh_sdf.d.ts +9 -0
  105. package/src/shade/renderer/geometry/sdf/chunk_mesh_sdf.d.ts.map +1 -1
  106. package/src/shade/renderer/geometry/sdf/chunk_mesh_sdf.js +23 -0
  107. package/src/shade/renderer/geometry/sdf/chunk_mesh_sdf_brick_key.d.ts +13 -0
  108. package/src/shade/renderer/geometry/sdf/chunk_mesh_sdf_brick_key.d.ts.map +1 -0
  109. package/src/shade/renderer/geometry/sdf/chunk_mesh_sdf_brick_key.js +23 -0
  110. package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.d.ts +262 -0
  111. package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.d.ts.map +1 -0
  112. package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.js +1819 -0
  113. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BAKE.d.ts +118 -0
  114. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BAKE.d.ts.map +1 -0
  115. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BAKE.js +204 -0
  116. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BLOCK.d.ts +66 -0
  117. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BLOCK.d.ts.map +1 -0
  118. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BLOCK.js +103 -0
  119. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_RESOURCES.d.ts +19 -0
  120. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_RESOURCES.d.ts.map +1 -0
  121. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_RESOURCES.js +23 -0
  122. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_STRUCT.d.ts +15 -0
  123. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_STRUCT.d.ts.map +1 -0
  124. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_STRUCT.js +70 -0
  125. package/src/shade/renderer/geometry/sdf/surface/SURFACE_MATERIAL.d.ts +13 -0
  126. package/src/shade/renderer/geometry/sdf/surface/SURFACE_MATERIAL.d.ts.map +1 -0
  127. package/src/shade/renderer/geometry/sdf/surface/SURFACE_MATERIAL.js +35 -0
  128. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_block.d.ts +32 -0
  129. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_block.d.ts.map +1 -0
  130. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_block.js +111 -0
  131. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_listed.d.ts +17 -0
  132. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_listed.d.ts.map +1 -0
  133. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_listed.js +49 -0
  134. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_run_find.d.ts +13 -0
  135. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_run_find.d.ts.map +1 -0
  136. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_run_find.js +35 -0
  137. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_sample.d.ts +24 -0
  138. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_sample.d.ts.map +1 -0
  139. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_sample.js +169 -0
  140. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_texel_ray.d.ts +19 -0
  141. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_texel_ray.d.ts.map +1 -0
  142. package/src/shade/renderer/geometry/sdf/surface/chunk_mesh_surface_texel_ray.js +49 -0
  143. package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_fit.d.ts +19 -0
  144. package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_fit.d.ts.map +1 -0
  145. package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_fit.js +67 -0
  146. package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_read.d.ts +78 -0
  147. package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_read.d.ts.map +1 -0
  148. package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_read.js +320 -0
  149. package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_store.d.ts +15 -0
  150. package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_store.d.ts.map +1 -0
  151. package/src/shade/renderer/geometry/sdf/surface/chunk_surface_material_store.js +48 -0
  152. package/src/shade/renderer/geometry/sdf/surface/mesh_surface_channels.d.ts +51 -0
  153. package/src/shade/renderer/geometry/sdf/surface/mesh_surface_channels.d.ts.map +1 -0
  154. package/src/shade/renderer/geometry/sdf/surface/mesh_surface_channels.js +109 -0
  155. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_command.d.ts +11 -0
  156. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_command.d.ts.map +1 -0
  157. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_command.js +51 -0
  158. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_encode.d.ts +26 -0
  159. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_encode.d.ts.map +1 -0
  160. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_encode.js +453 -0
  161. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_list.d.ts +12 -0
  162. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_list.d.ts.map +1 -0
  163. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_list.js +99 -0
  164. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_survey.d.ts +22 -0
  165. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_survey.d.ts.map +1 -0
  166. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_survey.js +140 -0
  167. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_trace.d.ts +32 -0
  168. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_trace.d.ts.map +1 -0
  169. package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_trace.js +261 -0
  170. package/src/shade/renderer/geometry/virtual/runtime/VirtualGeometry.d.ts +2 -2
  171. package/src/shade/renderer/geometry/virtual/runtime/VirtualGeometry.js +2 -2
  172. package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.d.ts +6 -6
  173. package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.js +7 -7
  174. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_brick4_sh3_color_decode.d.ts +12 -0
  175. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_brick4_sh3_color_decode.d.ts.map +1 -1
  176. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_brick4_sh3_color_decode.js +49 -24
  177. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_brick4_sh3_color_encode.d.ts +12 -0
  178. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_brick4_sh3_color_encode.d.ts.map +1 -1
  179. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_brick4_sh3_color_encode.js +50 -19
  180. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_sh3_compress.d.ts.map +1 -1
  181. package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_sh3_compress.js +6 -2
  182. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +20 -8
  183. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
  184. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +89 -20
  185. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.d.ts +26 -19
  186. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.d.ts.map +1 -1
  187. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.js +226 -148
  188. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +25 -52
  189. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
  190. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +29 -69
  191. package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.d.ts +19 -16
  192. package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.d.ts.map +1 -1
  193. package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_CLIPMAP.js +24 -21
  194. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts +46 -22
  195. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts.map +1 -1
  196. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.js +49 -36
  197. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.d.ts +3 -2
  198. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.d.ts.map +1 -1
  199. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap.js +7 -6
  200. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +8 -22
  201. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts.map +1 -1
  202. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +15 -51
  203. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts +1 -6
  204. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts.map +1 -1
  205. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.js +6 -13
  206. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.d.ts.map +1 -1
  207. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.js +0 -2
  208. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.d.ts +4 -4
  209. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.d.ts.map +1 -1
  210. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_batch.js +9 -34
  211. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.d.ts +4 -6
  212. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.d.ts.map +1 -1
  213. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_resolve.js +15 -39
  214. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_clear.d.ts +1 -1
  215. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_clear.js +1 -1
  216. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_store.d.ts +1 -2
  217. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_store.d.ts.map +1 -1
  218. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_store.js +2 -6
  219. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_take.d.ts +2 -2
  220. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_take.d.ts.map +1 -1
  221. package/src/shade/renderer/global_illumination/probe_clipmap/brick/shader_brick_clipmap_take.js +5 -2
  222. package/src/shade/renderer/global_illumination/probe_clipmap/debug/ProbeClipmapDebugView.d.ts +5 -1
  223. package/src/shade/renderer/global_illumination/probe_clipmap/debug/ProbeClipmapDebugView.js +16 -2
  224. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_brick_material.d.ts +45 -0
  225. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_brick_material.d.ts.map +1 -0
  226. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_brick_material.js +208 -0
  227. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_indirect.d.ts +24 -0
  228. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_indirect.d.ts.map +1 -0
  229. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_indirect.js +40 -0
  230. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_surfaces.d.ts +34 -0
  231. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_surfaces.d.ts.map +1 -0
  232. 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
  233. package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.d.ts +61 -0
  234. package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.d.ts.map +1 -0
  235. package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.js +193 -0
  236. package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material.d.ts +67 -0
  237. package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material.d.ts.map +1 -0
  238. package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material.js +142 -0
  239. package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material_cell.d.ts +32 -0
  240. package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material_cell.d.ts.map +1 -0
  241. package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material_cell.js +70 -0
  242. package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material_store.d.ts +30 -0
  243. package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material_store.d.ts.map +1 -0
  244. package/src/shade/renderer/global_illumination/probe_clipmap/material/chunk_brick_material_store.js +71 -0
  245. package/src/shade/renderer/global_illumination/probe_clipmap/material/shader_brick_material_gather.d.ts +26 -0
  246. package/src/shade/renderer/global_illumination/probe_clipmap/material/shader_brick_material_gather.d.ts.map +1 -0
  247. package/src/shade/renderer/global_illumination/probe_clipmap/material/shader_brick_material_gather.js +176 -0
  248. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts +23 -12
  249. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts.map +1 -1
  250. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js +72 -52
  251. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts +32 -0
  252. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts.map +1 -1
  253. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.js +37 -0
  254. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_INDIRECT_LOBE.d.ts +10 -0
  255. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_INDIRECT_LOBE.d.ts.map +1 -0
  256. package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP_INDIRECT_LOBE.js +11 -0
  257. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapIndirectLobe.d.ts +11 -0
  258. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapIndirectLobe.d.ts.map +1 -0
  259. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapIndirectLobe.js +15 -0
  260. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts +55 -23
  261. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts.map +1 -1
  262. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.js +134 -69
  263. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_material.d.ts +43 -0
  264. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_material.d.ts.map +1 -0
  265. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_material.js +138 -0
  266. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_indirect_lobe.d.ts +21 -0
  267. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_indirect_lobe.d.ts.map +1 -0
  268. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_indirect_lobe.js +49 -0
  269. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.d.ts +4 -3
  270. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.d.ts.map +1 -1
  271. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.js +19 -24
  272. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.d.ts +2 -2
  273. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.d.ts.map +1 -1
  274. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.js +14 -19
  275. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_select.d.ts +22 -0
  276. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_select.d.ts.map +1 -0
  277. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_select.js +50 -0
  278. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.d.ts +4 -4
  279. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.d.ts.map +1 -1
  280. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_want.js +8 -8
  281. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts +1 -1
  282. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts.map +1 -1
  283. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.js +8 -4
  284. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.js +1 -1
  285. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.d.ts +5 -4
  286. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.d.ts.map +1 -1
  287. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.js +18 -23
  288. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.d.ts +1 -1
  289. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.d.ts.map +1 -1
  290. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.js +4 -2
  291. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_diffuse.d.ts.map +1 -1
  292. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_diffuse.js +4 -6
  293. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.d.ts +2 -0
  294. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.d.ts.map +1 -1
  295. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.js +9 -8
  296. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts +1 -1
  297. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.js +2 -2
  298. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts +4 -3
  299. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts.map +1 -1
  300. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.js +14 -13
  301. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.d.ts +7 -4
  302. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.d.ts.map +1 -1
  303. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_shade.js +30 -26
  304. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts +6 -6
  305. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts.map +1 -1
  306. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.js +19 -21
  307. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.d.ts.map +1 -1
  308. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want.js +6 -2
  309. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.d.ts +2 -2
  310. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_want_hits.js +6 -6
  311. package/src/shade/renderer/gpu_primitive/hash_table/chunk_generate_next_linear_congruential_index.d.ts +14 -0
  312. package/src/shade/renderer/gpu_primitive/hash_table/chunk_generate_next_linear_congruential_index.d.ts.map +1 -0
  313. package/src/shade/renderer/gpu_primitive/hash_table/chunk_generate_next_linear_congruential_index.js +22 -0
  314. package/src/shade/renderer/gpu_primitive/hash_table/chunk_hash_table_atomic.d.ts +37 -0
  315. package/src/shade/renderer/gpu_primitive/hash_table/chunk_hash_table_atomic.d.ts.map +1 -0
  316. package/src/shade/renderer/gpu_primitive/hash_table/chunk_hash_table_atomic.js +122 -0
  317. package/src/shade/renderer/gpu_primitive/hash_table/chunk_hash_table_get.d.ts.map +1 -1
  318. package/src/shade/renderer/gpu_primitive/hash_table/chunk_hash_table_get.js +1 -11
  319. package/src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.d.ts +8 -0
  320. package/src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.d.ts.map +1 -1
  321. package/src/shade/renderer/gpu_primitive/hash_table/cpu_build_hash_table.js +6 -4
  322. package/src/shade/renderer/light/environment/shader_downsample_environment_map.d.ts.map +1 -1
  323. package/src/shade/renderer/light/environment/shader_downsample_environment_map.js +5 -1
  324. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  325. package/src/shade/renderer/material/resident/GPUResidentMaterialContext.d.ts +1 -1
  326. package/src/shade/renderer/material/resident/GPUResidentMaterialContext.d.ts.map +1 -1
  327. package/src/shade/renderer/material/resident/GPUResidentMaterialContext.js +2 -18
  328. package/src/shade/renderer/material/resident/NEUTRAL_SURFACE.d.ts +17 -0
  329. package/src/shade/renderer/material/resident/NEUTRAL_SURFACE.d.ts.map +1 -0
  330. package/src/shade/renderer/material/resident/NEUTRAL_SURFACE.js +16 -0
  331. package/src/shade/renderer/path_tracer/shader/INDIRECT_TEXTURE_FILTER.d.ts +1 -1
  332. package/src/shade/renderer/path_tracer/shader/INDIRECT_TEXTURE_FILTER.js +1 -1
  333. package/src/shade/renderer/path_tracer/shader/IndirectTextureFilter.js +1 -1
  334. package/src/shade/renderer/path_tracer/shader/chunk_beam_texture_level.d.ts +20 -0
  335. package/src/shade/renderer/path_tracer/shader/chunk_beam_texture_level.d.ts.map +1 -0
  336. package/src/shade/renderer/path_tracer/shader/chunk_beam_texture_level.js +65 -0
  337. package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.d.ts +26 -8
  338. package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.d.ts.map +1 -1
  339. package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.js +170 -142
  340. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  341. package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect_probe_clipmap.d.ts +1 -1
  342. package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect_probe_clipmap.d.ts.map +1 -1
  343. package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect_probe_clipmap.js +5 -8
  344. package/src/shade/renderer/scene/GPUSceneContext.d.ts +1 -1
  345. package/src/shade/renderer/scene/GPUSceneContext.js +1 -1
  346. package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts +15 -4
  347. package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts.map +1 -1
  348. package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.js +33 -7
  349. package/src/shade/renderer/shader/chunk/material/albedo_compress.d.ts +12 -0
  350. package/src/shade/renderer/shader/chunk/material/albedo_compress.d.ts.map +1 -0
  351. package/src/shade/renderer/shader/chunk/material/albedo_compress.js +26 -0
  352. package/src/shade/renderer/shader/chunk/material/chunk_albedo_compress.d.ts +16 -0
  353. package/src/shade/renderer/shader/chunk/material/chunk_albedo_compress.d.ts.map +1 -0
  354. package/src/shade/renderer/shader/chunk/material/chunk_albedo_compress.js +22 -0
  355. package/src/shade/renderer/shader/chunk/material/chunk_albedo_uncompress.d.ts +15 -0
  356. package/src/shade/renderer/shader/chunk/material/chunk_albedo_uncompress.d.ts.map +1 -0
  357. package/src/shade/renderer/shader/chunk/material/chunk_albedo_uncompress.js +23 -0
  358. package/src/shade/renderer/shader/chunk/material/chunk_metal_rough_compress.d.ts +16 -0
  359. package/src/shade/renderer/shader/chunk/material/chunk_metal_rough_compress.d.ts.map +1 -0
  360. package/src/shade/renderer/shader/chunk/material/chunk_metal_rough_compress.js +25 -0
  361. package/src/shade/renderer/shader/chunk/material/chunk_metal_rough_uncompress.d.ts +25 -0
  362. package/src/shade/renderer/shader/chunk/material/chunk_metal_rough_uncompress.d.ts.map +1 -0
  363. package/src/shade/renderer/shader/chunk/material/chunk_metal_rough_uncompress.js +36 -0
  364. package/src/shade/renderer/shader/chunk/material/metal_rough_compress.d.ts +11 -0
  365. package/src/shade/renderer/shader/chunk/material/metal_rough_compress.d.ts.map +1 -0
  366. package/src/shade/renderer/shader/chunk/material/metal_rough_compress.js +38 -0
  367. package/src/shade/renderer/shader/chunk/noise/chunk_sobol_sample_vec2.d.ts +40 -0
  368. package/src/shade/renderer/shader/chunk/noise/chunk_sobol_sample_vec2.d.ts.map +1 -0
  369. package/src/shade/renderer/shader/chunk/noise/chunk_sobol_sample_vec2.js +75 -0
  370. package/src/shade/renderer/shader/chunk/noise/chunk_vdc_radical_inverse.d.ts.map +1 -1
  371. package/src/shade/renderer/shader/chunk/noise/chunk_vdc_radical_inverse.js +3 -1
  372. package/src/shade/renderer/shader/chunk/random/chunk_hash_lk.d.ts +28 -0
  373. package/src/shade/renderer/shader/chunk/random/chunk_hash_lk.d.ts.map +1 -0
  374. package/src/shade/renderer/shader/chunk/random/chunk_hash_lk.js +41 -0
  375. package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh3_color_add_scaled.d.ts +12 -0
  376. package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh3_color_add_scaled.d.ts.map +1 -0
  377. package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh3_color_add_scaled.js +24 -0
  378. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot.d.ts +20 -0
  379. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot.d.ts.map +1 -0
  380. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot.js +35 -0
  381. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_compress.d.ts +28 -0
  382. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_compress.d.ts.map +1 -0
  383. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_compress.js +79 -0
  384. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_fit.d.ts +25 -0
  385. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_fit.d.ts.map +1 -0
  386. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_fit.js +89 -0
  387. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_uncompress.d.ts +31 -0
  388. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_uncompress.d.ts.map +1 -0
  389. package/src/shade/renderer/shader/chunk/spherical_harmonics/pivot/chunk_sh2_color_pivot_uncompress.js +66 -0
  390. package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_atomic_add.d.ts.map +1 -1
  391. package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_atomic_add.js +2 -0
  392. package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_atomic_load.d.ts +17 -0
  393. package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_atomic_load.d.ts.map +1 -0
  394. package/src/shade/renderer/shader/chunk/subgroup/chunk_subgroup_atomic_load.js +34 -0
  395. package/src/shade/renderer/volumetrics/chunk_frustum_unit_box_coverage_multisample.d.ts +18 -0
  396. package/src/shade/renderer/volumetrics/chunk_frustum_unit_box_coverage_multisample.d.ts.map +1 -1
  397. package/src/shade/renderer/volumetrics/chunk_frustum_unit_box_coverage_multisample.js +31 -23
  398. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts +3 -2
  399. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts.map +1 -1
  400. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.js +4 -0
  401. package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.d.ts +2 -5
  402. package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.d.ts.map +1 -1
  403. package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.js +3 -20
  404. package/src/shade/renderer/volumetrics/shader_volumetrics_build_participating_media.d.ts.map +1 -1
  405. package/src/shade/renderer/volumetrics/shader_volumetrics_build_participating_media.js +5 -6
  406. package/src/shade/renderer/water/chunk_water_gi.d.ts +1 -1
  407. package/src/shade/renderer/water/chunk_water_gi.d.ts.map +1 -1
  408. package/src/shade/renderer/water/chunk_water_gi.js +6 -8
  409. package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
  410. package/src/shade/renderer/wind/GPUSceneWind.d.ts +1 -1
  411. package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
  412. package/src/shade/wgsl/emulator/WGSLLanguageCore.js +76 -32
  413. package/src/core/math/hash/squirrel3.d.ts +0 -17
  414. package/src/core/math/hash/squirrel3.d.ts.map +0 -1
  415. package/src/core/math/hash/squirrel3.js +0 -30
  416. package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.d.ts +0 -213
  417. package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.d.ts.map +0 -1
  418. package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.js +0 -1468
  419. package/src/shade/renderer/geometry/sdf/cards/MESH_CARDS.d.ts +0 -82
  420. package/src/shade/renderer/geometry/sdf/cards/MESH_CARDS.d.ts.map +0 -1
  421. package/src/shade/renderer/geometry/sdf/cards/MESH_CARDS.js +0 -127
  422. package/src/shade/renderer/geometry/sdf/cards/MESH_CARD_RESOURCES.d.ts +0 -24
  423. package/src/shade/renderer/geometry/sdf/cards/MESH_CARD_RESOURCES.d.ts.map +0 -1
  424. package/src/shade/renderer/geometry/sdf/cards/MESH_CARD_RESOURCES.js +0 -29
  425. package/src/shade/renderer/geometry/sdf/cards/MESH_CARD_SET_STRUCT.d.ts +0 -12
  426. package/src/shade/renderer/geometry/sdf/cards/MESH_CARD_SET_STRUCT.d.ts.map +0 -1
  427. package/src/shade/renderer/geometry/sdf/cards/MESH_CARD_SET_STRUCT.js +0 -31
  428. package/src/shade/renderer/geometry/sdf/cards/MeshCardCaptureMode.d.ts +0 -11
  429. package/src/shade/renderer/geometry/sdf/cards/MeshCardCaptureMode.d.ts.map +0 -1
  430. package/src/shade/renderer/geometry/sdf/cards/MeshCardCaptureMode.js +0 -21
  431. package/src/shade/renderer/geometry/sdf/cards/chunk_mesh_card_surface.d.ts +0 -29
  432. package/src/shade/renderer/geometry/sdf/cards/chunk_mesh_card_surface.d.ts.map +0 -1
  433. package/src/shade/renderer/geometry/sdf/cards/chunk_mesh_card_surface.js +0 -179
  434. package/src/shade/renderer/geometry/sdf/cards/chunk_mesh_cards.d.ts +0 -17
  435. package/src/shade/renderer/geometry/sdf/cards/chunk_mesh_cards.d.ts.map +0 -1
  436. package/src/shade/renderer/geometry/sdf/cards/chunk_mesh_cards.js +0 -107
  437. package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.d.ts +0 -65
  438. package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.d.ts.map +0 -1
  439. package/src/shade/renderer/geometry/sdf/cards/mesh_cards_raster_pass_descriptor.js +0 -376
  440. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_capture.d.ts +0 -40
  441. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_capture.d.ts.map +0 -1
  442. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_capture.js +0 -301
  443. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_compact.d.ts +0 -19
  444. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_compact.d.ts.map +0 -1
  445. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_compact.js +0 -61
  446. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_histogram.d.ts +0 -18
  447. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_histogram.d.ts.map +0 -1
  448. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_histogram.js +0 -102
  449. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_log.d.ts +0 -15
  450. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_log.d.ts.map +0 -1
  451. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_log.js +0 -65
  452. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_merge.d.ts +0 -22
  453. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_merge.d.ts.map +0 -1
  454. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_merge.js +0 -136
  455. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_pages.d.ts +0 -20
  456. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_pages.d.ts.map +0 -1
  457. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_pages.js +0 -104
  458. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_args.d.ts +0 -20
  459. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_args.d.ts.map +0 -1
  460. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_args.js +0 -80
  461. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_scatter.d.ts +0 -18
  462. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_scatter.d.ts.map +0 -1
  463. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_raster_scatter.js +0 -113
  464. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_split.d.ts +0 -30
  465. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_split.d.ts.map +0 -1
  466. package/src/shade/renderer/geometry/sdf/cards/shader_mesh_cards_split.js +0 -146
  467. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_cards.d.ts +0 -34
  468. package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_cards.d.ts.map +0 -1
  469. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_surface.d.ts +0 -31
  470. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_surface.d.ts.map +0 -1
  471. package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_surface.js +0 -82
  472. package/src/shade/renderer/shader/chunk/random/chunk_hash_squirrel3.d.ts +0 -12
  473. package/src/shade/renderer/shader/chunk/random/chunk_hash_squirrel3.d.ts.map +0 -1
  474. package/src/shade/renderer/shader/chunk/random/chunk_hash_squirrel3.js +0 -30
@@ -1,32 +1,38 @@
1
1
  /**
2
2
  * What the probe clipmap GI holds of one scene's geometry caches (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md
3
- * §6.1, §6.5), kept by entity and moved as the rows' events say, O(changes):
3
+ * §6.1), kept by entity and moved as the rows' events say, O(changes):
4
4
  *
5
5
  * - a hold on the cache of the geometry each mesh row in the SDF world draws, drawing both sides
6
6
  * when the row's material does;
7
- * - one card set per (geometry, material) pair those rows draw, with the rows drawing each pair;
8
- * - the row → card set table readers find a row's card set in: the pair's once it is resident,
7
+ * - one Model Surface Cache per (geometry, material) pair those rows draw, with the rows drawing each
8
+ * pair, which the brick material is gathered from;
9
+ * - the row → surface cache table readers find a row's cache in: the pair's once it is resident,
9
10
  * `GPU_DATABASE_NULL` until then and for a row out of the SDF world.
10
11
  *
11
12
  * A row is in the SDF world when its `flags` carry `MESH_FLAG_SDF_WORLD`, whatever its geometry: a
12
13
  * virtual geometry's cache is held as a mesh's is, and is its proxy's once `VGeoSDFProxies` aliases it: the
13
- * hold and its side move to the proxy, and the pair's card set captures the proxy's layout.
14
+ * hold and its side move to the proxy, and the pair's cache follows the proxy's field.
14
15
  * A skinned row draws a clone: the hold and the pair are its source's,
15
- * whose unskinned field and cards the clone's header is aliased to (§6.3). A row written again moves
16
- * its hold and its pair, the new ones taken before the old ones go, so a cache or card set a row keeps
17
- * drawing is never let go in between.
16
+ * whose unskinned field and caches the clone's header is aliased to (§6.3). A row written again moves
17
+ * its hold and its pair, the new ones taken before the old ones go, so a cache a row keeps drawing is
18
+ * never let go in between.
19
+ *
20
+ * Rows the world's bricks must be built again over are kept until drained: a row whose geometry's field
21
+ * turned resident, one that joined or left the SDF world (§6.4, §7.4), and each row of a pair whose
22
+ * surface cache a bake completed, the first and every one after, since the bricks hold the materials
23
+ * their caches held when each was gathered.
18
24
  *
19
25
  * When the material manager restages a material whose version moved, each of that material's pairs
20
- * is recaptured (§6.5), and the holds of its rows move to the side it draws now.
26
+ * is baked again, and the holds of its rows move to the side it draws now.
21
27
  *
22
- * {@link attach} subscribes and walks the rows already there; {@link detach} gives every hold and card
23
- * set back. Neither trims: a cache with no holder stays until its user trims, so leaving the mode keeps
24
- * the caches for the next time (D28). Card sets go with their last row, and are captured again.
28
+ * {@link attach} subscribes and walks the rows already there; {@link detach} gives every hold and cache
29
+ * back. Neither trims: a field with no holder stays until its user trims, so leaving the mode keeps
30
+ * the fields for the next time (D28). Caches go with their last row, and are made again.
25
31
  */
26
32
  export class ProbeClipmapSceneHolds {
27
33
  /**
28
34
  * @param {GPUSceneContext} scene
29
- * @param {GraphicsContext} graphics whose material manager's restages recapture the pairs of the material
35
+ * @param {GraphicsContext} graphics whose material manager's restages bake the pairs of the material again
30
36
  */
31
37
  constructor(scene: GPUSceneContext, graphics: GraphicsContext);
32
38
  /**
@@ -39,12 +45,12 @@ export class ProbeClipmapSceneHolds {
39
45
  */
40
46
  get hold_count(): number;
41
47
  /**
42
- * (geometry, material) pairs the rows draw, a card set each.
48
+ * (geometry, material) pairs the rows draw, a cache each.
43
49
  * @returns {number}
44
50
  */
45
51
  get pair_count(): number;
46
52
  /**
47
- * Recaptures asked for, a pair each time its material was restaged.
53
+ * Bakes again asked for, a pair each time its material was restaged.
48
54
  * @returns {number}
49
55
  */
50
56
  get recaptures_requested(): number;
@@ -55,19 +61,20 @@ export class ProbeClipmapSceneHolds {
55
61
  get invalidated(): readonly number[];
56
62
  clear_invalidated(): void;
57
63
  /**
58
- * The card set of the pair `material` makes with a geometry, or undefined when no row draws it.
64
+ * The Model Surface Cache of the pair `material` makes with a geometry, or undefined when no row
65
+ * draws it.
59
66
  *
60
67
  * @param {GPUGeometryMetadata} record
61
68
  * @param {ShadeMaterial} material
62
69
  * @returns {number|undefined}
63
70
  */
64
- card_set_of(record: GPUGeometryMetadata, material: ShadeMaterial): number | undefined;
71
+ surface_cache_of(record: GPUGeometryMetadata, material: ShadeMaterial): number | undefined;
65
72
  /**
66
- * The row → card set table: a word a `meshes` row. Made on first use, replaced when it grows; take it
67
- * each frame, after {@link flush}.
73
+ * The row → Model Surface Cache table: a word a `meshes` row. Made on first use, replaced when it
74
+ * grows; take it each frame, after {@link flush}.
68
75
  * @returns {GPUBuffer}
69
76
  */
70
- get rows_buffer(): GPUBuffer;
77
+ get surface_rows_buffer(): GPUBuffer;
71
78
  attach(): void;
72
79
  detach(): void;
73
80
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ProbeClipmapSceneHolds.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.js"],"names":[],"mappings":"AAwDA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH;IAwEI;;;OAGG;IACH,mBAHW,eAAe,YACf,eAAe,EASzB;IAED;;OAEG;IACH,sEAEC;IAED;;;OAGG;IACH,yBAEC;IAED;;;OAGG;IACH,yBAEC;IAED;;;OAGG;IACH,mCAEC;IAED;;;OAGG;IACH,qCAEC;IAED,0BAEC;IAED;;;;;;OAMG;IACH,oBAJW,mBAAmB,YACnB,aAAa,GACX,MAAM,GAAC,SAAS,CAI5B;IAED;;;;OAIG;IACH,6BAIC;IAED,eAiBC;IAED,eAuCC;IAED;;OAEG;IACH,cAiBC;;CA4TJ;8BA3mBY,OAAO,gCAAgC,EAAE,eAAe;8BACxD,OAAO,mCAAmC,EAAE,eAAe;kCAC3D,OAAO,uCAAuC,EAAE,mBAAmB;4BACnE,OAAO,iCAAiC,EAAE,aAAa;iCACvD,OAAO,sCAAsC,EAAE,kBAAkB;8BACjE,OAAO,0BAA0B,EAAE,eAAe"}
1
+ {"version":3,"file":"ProbeClipmapSceneHolds.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.js"],"names":[],"mappings":"AAyLA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH;IAiEI;;;OAGG;IACH,mBAHW,eAAe,YACf,eAAe,EASzB;IAED;;OAEG;IACH,sEAEC;IAED;;;OAGG;IACH,yBAEC;IAED;;;OAGG;IACH,yBAEC;IAED;;;OAGG;IACH,mCAEC;IAED;;;OAGG;IACH,qCAEC;IAED,0BAEC;IAED;;;;;;;OAOG;IACH,yBAJW,mBAAmB,YACnB,aAAa,GACX,MAAM,GAAC,SAAS,CAI5B;IAED;;;;OAIG;IACH,qCAEC;IAED,eAmBC;IAED,eAoCC;IAED;;OAEG;IACH,cAEC;;CA2RJ;8BAzrBY,OAAO,gCAAgC,EAAE,eAAe;8BACxD,OAAO,mCAAmC,EAAE,eAAe;kCAC3D,OAAO,uCAAuC,EAAE,mBAAmB;4BACnE,OAAO,iCAAiC,EAAE,aAAa;iCACvD,OAAO,sCAAsC,EAAE,kBAAkB;8BACjE,OAAO,0BAA0B,EAAE,eAAe"}
@@ -22,13 +22,14 @@ import { row_of_entity } from "../../scene/rows/GPUSceneRows.js";
22
22
  const PAIR_KEY_MATERIAL_SPAN = 2 ** 20;
23
23
 
24
24
  /**
25
- * Rows the row → card set table starts with room for; it doubles past that.
25
+ * Rows a row table starts with room for; it doubles past that.
26
26
  * @type {number}
27
27
  */
28
28
  const INITIAL_ROW_CAPACITY = 256;
29
29
 
30
30
  /**
31
- * A (geometry, material) pair some row in the SDF world draws, and the card set capturing it.
31
+ * A (geometry, material) pair some row in the SDF world draws, and the Model Surface Cache of it the
32
+ * holds keep.
32
33
  */
33
34
  class Pair {
34
35
  /** @type {number} */
@@ -38,7 +39,7 @@ class Pair {
38
39
  material = undefined;
39
40
 
40
41
  /** @type {number} */
41
- card_set = 0;
42
+ cache = 0;
42
43
 
43
44
  /**
44
45
  * Whether its rows hold the geometry's cache as drawing both sides: the material's side, as it was
@@ -54,30 +55,164 @@ class Pair {
54
55
  rows = new Set();
55
56
  }
56
57
 
58
+ /**
59
+ * A row → cache table: a word a `meshes` row, mirrored on the host and put on the device by changed
60
+ * range. A row with nothing is `GPU_DATABASE_NULL`.
61
+ */
62
+ class RowTable {
63
+ #mirror = new Uint32Array(0);
64
+ /** @type {GPUBuffer|null} */
65
+ #buffer = null;
66
+ #dirty_low = Infinity;
67
+ #dirty_high = -1;
68
+ #label;
69
+
70
+ /**
71
+ * @param {string} label
72
+ */
73
+ constructor(label) {
74
+ this.#label = label;
75
+ }
76
+
77
+ /**
78
+ * @param {number} row
79
+ * @param {number} value
80
+ */
81
+ write(row, value) {
82
+ if (row >= this.#mirror.length) {
83
+ this.#grow_mirror(row + 1);
84
+ }
85
+
86
+ if (this.#mirror[row] === value) {
87
+ return;
88
+ }
89
+
90
+ this.#mirror[row] = value;
91
+
92
+ this.#dirty_low = Math.min(this.#dirty_low, row);
93
+ this.#dirty_high = Math.max(this.#dirty_high, row);
94
+ }
95
+
96
+ /**
97
+ * @param {GPUDevice} device
98
+ * @returns {GPUBuffer}
99
+ */
100
+ buffer(device) {
101
+ this.#ensure(device, 1);
102
+
103
+ return this.#buffer;
104
+ }
105
+
106
+ /**
107
+ * @param {GPUDevice} device
108
+ */
109
+ flush(device) {
110
+ const low = this.#dirty_low;
111
+ const high = this.#dirty_high;
112
+
113
+ if (high < low) {
114
+ return;
115
+ }
116
+
117
+ this.#dirty_low = Infinity;
118
+ this.#dirty_high = -1;
119
+
120
+ if (this.#ensure(device, high + 1)) {
121
+ // a new table took the whole mirror
122
+ return;
123
+ }
124
+
125
+ device.queue.writeBuffer(this.#buffer, 4 * low, this.#mirror, low, high + 1 - low);
126
+ }
127
+
128
+ clear() {
129
+ this.#buffer?.destroy();
130
+ this.#buffer = null;
131
+ this.#mirror = new Uint32Array(0);
132
+ this.#dirty_low = Infinity;
133
+ this.#dirty_high = -1;
134
+ }
135
+
136
+ /**
137
+ * @param {number} length
138
+ */
139
+ #grow_mirror(length) {
140
+ let capacity = Math.max(INITIAL_ROW_CAPACITY, this.#mirror.length);
141
+
142
+ while (capacity < length) {
143
+ capacity *= 2;
144
+ }
145
+
146
+ const grown = new Uint32Array(capacity).fill(GPU_DATABASE_NULL);
147
+
148
+ grown.set(this.#mirror);
149
+
150
+ this.#mirror = grown;
151
+ }
152
+
153
+ /**
154
+ * A table buffer for at least `rows` rows; a new one gets the whole mirror.
155
+ *
156
+ * @param {GPUDevice} device
157
+ * @param {number} rows
158
+ * @returns {boolean} whether the buffer is new
159
+ */
160
+ #ensure(device, rows) {
161
+ if (rows > this.#mirror.length) {
162
+ this.#grow_mirror(rows);
163
+ }
164
+
165
+ if (this.#buffer !== null && this.#buffer.size >= 4 * this.#mirror.length) {
166
+ return false;
167
+ }
168
+
169
+ this.#buffer?.destroy();
170
+
171
+ this.#buffer = device.createBuffer(BufferDescriptor.fromJSON({
172
+ label: this.#label,
173
+ size: 4 * this.#mirror.length,
174
+ usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,
175
+ }));
176
+
177
+ device.queue.writeBuffer(this.#buffer, 0, this.#mirror);
178
+
179
+ this.#dirty_low = Infinity;
180
+ this.#dirty_high = -1;
181
+
182
+ return true;
183
+ }
184
+ }
185
+
57
186
  /**
58
187
  * What the probe clipmap GI holds of one scene's geometry caches (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md
59
- * §6.1, §6.5), kept by entity and moved as the rows' events say, O(changes):
188
+ * §6.1), kept by entity and moved as the rows' events say, O(changes):
60
189
  *
61
190
  * - a hold on the cache of the geometry each mesh row in the SDF world draws, drawing both sides
62
191
  * when the row's material does;
63
- * - one card set per (geometry, material) pair those rows draw, with the rows drawing each pair;
64
- * - the row → card set table readers find a row's card set in: the pair's once it is resident,
192
+ * - one Model Surface Cache per (geometry, material) pair those rows draw, with the rows drawing each
193
+ * pair, which the brick material is gathered from;
194
+ * - the row → surface cache table readers find a row's cache in: the pair's once it is resident,
65
195
  * `GPU_DATABASE_NULL` until then and for a row out of the SDF world.
66
196
  *
67
197
  * A row is in the SDF world when its `flags` carry `MESH_FLAG_SDF_WORLD`, whatever its geometry: a
68
198
  * virtual geometry's cache is held as a mesh's is, and is its proxy's once `VGeoSDFProxies` aliases it: the
69
- * hold and its side move to the proxy, and the pair's card set captures the proxy's layout.
199
+ * hold and its side move to the proxy, and the pair's cache follows the proxy's field.
70
200
  * A skinned row draws a clone: the hold and the pair are its source's,
71
- * whose unskinned field and cards the clone's header is aliased to (§6.3). A row written again moves
72
- * its hold and its pair, the new ones taken before the old ones go, so a cache or card set a row keeps
73
- * drawing is never let go in between.
201
+ * whose unskinned field and caches the clone's header is aliased to (§6.3). A row written again moves
202
+ * its hold and its pair, the new ones taken before the old ones go, so a cache a row keeps drawing is
203
+ * never let go in between.
204
+ *
205
+ * Rows the world's bricks must be built again over are kept until drained: a row whose geometry's field
206
+ * turned resident, one that joined or left the SDF world (§6.4, §7.4), and each row of a pair whose
207
+ * surface cache a bake completed, the first and every one after, since the bricks hold the materials
208
+ * their caches held when each was gathered.
74
209
  *
75
210
  * When the material manager restages a material whose version moved, each of that material's pairs
76
- * is recaptured (§6.5), and the holds of its rows move to the side it draws now.
211
+ * is baked again, and the holds of its rows move to the side it draws now.
77
212
  *
78
- * {@link attach} subscribes and walks the rows already there; {@link detach} gives every hold and card
79
- * set back. Neither trims: a cache with no holder stays until its user trims, so leaving the mode keeps
80
- * the caches for the next time (D28). Card sets go with their last row, and are captured again.
213
+ * {@link attach} subscribes and walks the rows already there; {@link detach} gives every hold and cache
214
+ * back. Neither trims: a field with no holder stays until its user trims, so leaving the mode keeps
215
+ * the fields for the next time (D28). Caches go with their last row, and are made again.
81
216
  */
82
217
  export class ProbeClipmapSceneHolds {
83
218
 
@@ -126,34 +261,27 @@ export class ProbeClipmapSceneHolds {
126
261
  #pairs_of_geometry = new Map();
127
262
 
128
263
  /**
129
- * Rows the world's bricks must be built again over, since they were last drained: a row whose
130
- * geometry's field turned resident, and one that joined or left the SDF world (§6.4, §7.4). Rows
131
- * as the GPU's tables address them (`row_of_entity`), not entities.
264
+ * Rows the world's bricks must be built again over, since they were last drained. Rows as the GPU's
265
+ * tables address them (`row_of_entity`), not entities.
132
266
  * @type {number[]}
133
267
  */
134
268
  #invalidated = [];
135
269
 
136
270
  /**
137
- * Each card set's pair, by card set id.
271
+ * Each cache's pair, by cache id.
138
272
  * @type {(Pair|undefined)[]}
139
273
  */
140
- #pair_of_card_set = [];
274
+ #pair_of_cache = [];
141
275
 
142
276
  #recaptures_requested = 0;
143
277
 
144
- // ---- the row → card set table ----
145
-
146
- #rows_mirror = new Uint32Array(0);
147
- /** @type {GPUBuffer|null} */
148
- #rows_buffer = null;
149
- #rows_dirty_low = Infinity;
150
- #rows_dirty_high = -1;
278
+ #surface_rows = new RowTable("ProbeClipmapSceneHolds/surface rows");
151
279
 
152
280
  #attached = false;
153
281
 
154
282
  /**
155
283
  * @param {GPUSceneContext} scene
156
- * @param {GraphicsContext} graphics whose material manager's restages recapture the pairs of the material
284
+ * @param {GraphicsContext} graphics whose material manager's restages bake the pairs of the material again
157
285
  */
158
286
  constructor(scene, graphics) {
159
287
  assert.defined(scene, 'scene');
@@ -180,7 +308,7 @@ export class ProbeClipmapSceneHolds {
180
308
  }
181
309
 
182
310
  /**
183
- * (geometry, material) pairs the rows draw, a card set each.
311
+ * (geometry, material) pairs the rows draw, a cache each.
184
312
  * @returns {number}
185
313
  */
186
314
  get pair_count() {
@@ -188,7 +316,7 @@ export class ProbeClipmapSceneHolds {
188
316
  }
189
317
 
190
318
  /**
191
- * Recaptures asked for, a pair each time its material was restaged.
319
+ * Bakes again asked for, a pair each time its material was restaged.
192
320
  * @returns {number}
193
321
  */
194
322
  get recaptures_requested() {
@@ -208,25 +336,24 @@ export class ProbeClipmapSceneHolds {
208
336
  }
209
337
 
210
338
  /**
211
- * The card set of the pair `material` makes with a geometry, or undefined when no row draws it.
339
+ * The Model Surface Cache of the pair `material` makes with a geometry, or undefined when no row
340
+ * draws it.
212
341
  *
213
342
  * @param {GPUGeometryMetadata} record
214
343
  * @param {ShadeMaterial} material
215
344
  * @returns {number|undefined}
216
345
  */
217
- card_set_of(record, material) {
218
- return this.#pairs.get(record.index * PAIR_KEY_MATERIAL_SPAN + material.id)?.card_set;
346
+ surface_cache_of(record, material) {
347
+ return this.#pairs.get(record.index * PAIR_KEY_MATERIAL_SPAN + material.id)?.cache;
219
348
  }
220
349
 
221
350
  /**
222
- * The row → card set table: a word a `meshes` row. Made on first use, replaced when it grows; take it
223
- * each frame, after {@link flush}.
351
+ * The row → Model Surface Cache table: a word a `meshes` row. Made on first use, replaced when it
352
+ * grows; take it each frame, after {@link flush}.
224
353
  * @returns {GPUBuffer}
225
354
  */
226
- get rows_buffer() {
227
- this.#ensure_rows(1);
228
-
229
- return this.#rows_buffer;
355
+ get surface_rows_buffer() {
356
+ return this.#surface_rows.buffer(this.#device);
230
357
  }
231
358
 
232
359
  attach() {
@@ -235,13 +362,15 @@ export class ProbeClipmapSceneHolds {
235
362
  this.#attached = true;
236
363
 
237
364
  const rows = this.#scene.rows;
238
- const cards = this.#scene.geometries.sdf.cards;
365
+ const sdf = this.#scene.geometries.sdf;
239
366
 
240
367
  rows.onMeshWritten.add(this.#written, this);
241
368
  rows.onMeshReleased.add(this.#released, this);
242
- this.#scene.geometries.sdf.onBaked.add(this.#baked, this);
243
- cards.onResident.add(this.#card_set_resident, this);
244
- cards.onWithdrawn.add(this.#card_set_withdrawn, this);
369
+ sdf.onBaked.add(this.#baked, this);
370
+
371
+ sdf.surfaces.onBaked.add(this.#surface_baked, this);
372
+ sdf.surfaces.onWithdrawn.add(this.#cache_withdrawn, this);
373
+
245
374
  this.#materials.onMaterialRestaged.add(this.#restaged, this);
246
375
 
247
376
  // a row not yet written is taken now, and moved when it is
@@ -257,13 +386,14 @@ export class ProbeClipmapSceneHolds {
257
386
 
258
387
  const rows = this.#scene.rows;
259
388
  const sdf = this.#scene.geometries.sdf;
260
- const cards = sdf.cards;
261
389
 
262
390
  rows.onMeshWritten.remove(this.#written, this);
263
391
  rows.onMeshReleased.remove(this.#released, this);
264
392
  sdf.onBaked.remove(this.#baked, this);
265
- cards.onResident.remove(this.#card_set_resident, this);
266
- cards.onWithdrawn.remove(this.#card_set_withdrawn, this);
393
+
394
+ sdf.surfaces.onBaked.remove(this.#surface_baked, this);
395
+ sdf.surfaces.onWithdrawn.remove(this.#cache_withdrawn, this);
396
+
267
397
  this.#materials.onMaterialRestaged.remove(this.#restaged, this);
268
398
 
269
399
  for (const [entity, record] of this.#held) {
@@ -271,7 +401,7 @@ export class ProbeClipmapSceneHolds {
271
401
  }
272
402
 
273
403
  for (const pair of this.#pairs.values()) {
274
- cards.release(pair.card_set);
404
+ this.#release_cache(pair.cache);
275
405
  }
276
406
 
277
407
  this.#held.clear();
@@ -279,36 +409,17 @@ export class ProbeClipmapSceneHolds {
279
409
  this.#pairs.clear();
280
410
  this.#pairs_of_material.clear();
281
411
  this.#pairs_of_geometry.clear();
282
- this.#pair_of_card_set.length = 0;
412
+ this.#pair_of_cache.length = 0;
283
413
  this.#invalidated.length = 0;
284
414
 
285
- this.#rows_buffer?.destroy();
286
- this.#rows_buffer = null;
287
- this.#rows_mirror = new Uint32Array(0);
288
- this.#rows_dirty_low = Infinity;
289
- this.#rows_dirty_high = -1;
415
+ this.#surface_rows.clear();
290
416
  }
291
417
 
292
418
  /**
293
419
  * Put the table's changed rows on the device, ahead of the frame's commands.
294
420
  */
295
421
  flush() {
296
- const low = this.#rows_dirty_low;
297
- const high = this.#rows_dirty_high;
298
-
299
- if (high < low) {
300
- return;
301
- }
302
-
303
- this.#rows_dirty_low = Infinity;
304
- this.#rows_dirty_high = -1;
305
-
306
- if (this.#ensure_rows(high + 1)) {
307
- // a new table took the whole mirror
308
- return;
309
- }
310
-
311
- this.#device.queue.writeBuffer(this.#rows_buffer, 4 * low, this.#rows_mirror, low, high + 1 - low);
422
+ this.#surface_rows.flush(this.#device);
312
423
  }
313
424
 
314
425
  /**
@@ -359,7 +470,7 @@ export class ProbeClipmapSceneHolds {
359
470
  }
360
471
  }
361
472
 
362
- this.#write_row(entity, pair !== undefined && sdf.cards.is_resident(pair.card_set) ? pair.card_set : GPU_DATABASE_NULL);
473
+ this.#write_row(entity, pair !== undefined && this.#is_resident(pair.cache) ? pair.cache : GPU_DATABASE_NULL);
363
474
 
364
475
  // in the SDF world or out of it now: the bricks its box reaches are built again
365
476
  if ((previous === undefined) !== (record === undefined)) {
@@ -384,9 +495,7 @@ export class ProbeClipmapSceneHolds {
384
495
  }
385
496
 
386
497
  for (const pair of pairs) {
387
- for (const entity of pair.rows) {
388
- this.#invalidated.push(row_of_entity(entity));
389
- }
498
+ this.#invalidate_pair(pair);
390
499
  }
391
500
  }
392
501
 
@@ -427,15 +536,17 @@ export class ProbeClipmapSceneHolds {
427
536
  return pair;
428
537
  }
429
538
 
539
+ const sdf = this.#scene.geometries.sdf;
540
+
430
541
  pair = new Pair();
431
542
 
432
543
  pair.key = key;
433
544
  pair.material = material;
434
545
  pair.two_sided = material.draw_side === ShadeDrawSide.Double;
435
- pair.card_set = this.#scene.geometries.sdf.cards.acquire(record.index, material);
546
+ pair.cache = sdf.surfaces.acquire(record.index, material);
436
547
 
437
548
  this.#pairs.set(key, pair);
438
- this.#pair_of_card_set[pair.card_set] = pair;
549
+ this.#pair_of_cache[pair.cache] = pair;
439
550
 
440
551
  let of_material = this.#pairs_of_material.get(material.id);
441
552
 
@@ -469,10 +580,10 @@ export class ProbeClipmapSceneHolds {
469
580
  return;
470
581
  }
471
582
 
472
- this.#scene.geometries.sdf.cards.release(pair.card_set);
583
+ this.#release_cache(pair.cache);
473
584
 
474
585
  this.#pairs.delete(pair.key);
475
- this.#pair_of_card_set[pair.card_set] = undefined;
586
+ this.#pair_of_cache[pair.cache] = undefined;
476
587
 
477
588
  const of_material = this.#pairs_of_material.get(pair.material.id);
478
589
 
@@ -493,25 +604,54 @@ export class ProbeClipmapSceneHolds {
493
604
  }
494
605
 
495
606
  /**
496
- * @param {number} card_set
607
+ * @param {number} cache
497
608
  */
498
- #card_set_resident(card_set) {
499
- const pair = this.#pair_of_card_set[card_set];
609
+ #release_cache(cache) {
610
+ this.#scene.geometries.sdf.surfaces.release(cache);
611
+ }
612
+
613
+ /**
614
+ * @param {number} cache
615
+ * @returns {boolean}
616
+ */
617
+ #is_resident(cache) {
618
+ return this.#scene.geometries.sdf.surfaces.is_resident(cache);
619
+ }
620
+
621
+ /**
622
+ * @param {Pair} pair
623
+ */
624
+ #invalidate_pair(pair) {
625
+ for (const entity of pair.rows) {
626
+ this.#invalidated.push(row_of_entity(entity));
627
+ }
628
+ }
629
+
630
+ /**
631
+ * A bake of a surface cache is recorded in full: its rows find it, and the bricks they reach gather
632
+ * what it holds now.
633
+ *
634
+ * @param {number} cache
635
+ */
636
+ #surface_baked(cache) {
637
+ const pair = this.#pair_of_cache[cache];
500
638
 
501
639
  if (pair === undefined) {
502
640
  return;
503
641
  }
504
642
 
505
643
  for (const entity of pair.rows) {
506
- this.#write_row(entity, card_set);
644
+ this.#write_row(entity, cache);
507
645
  }
646
+
647
+ this.#invalidate_pair(pair);
508
648
  }
509
649
 
510
650
  /**
511
- * @param {number} card_set
651
+ * @param {number} cache
512
652
  */
513
- #card_set_withdrawn(card_set) {
514
- const pair = this.#pair_of_card_set[card_set];
653
+ #cache_withdrawn(cache) {
654
+ const pair = this.#pair_of_cache[cache];
515
655
 
516
656
  if (pair === undefined) {
517
657
  return;
@@ -536,7 +676,8 @@ export class ProbeClipmapSceneHolds {
536
676
  const two_sided = material.draw_side === ShadeDrawSide.Double;
537
677
 
538
678
  for (const pair of of_material) {
539
- sdf.cards.recapture(pair.card_set);
679
+ sdf.surfaces.recapture(pair.cache);
680
+
540
681
  this.#recaptures_requested++;
541
682
 
542
683
  if (pair.two_sided === two_sided) {
@@ -560,69 +701,6 @@ export class ProbeClipmapSceneHolds {
560
701
  * @param {number} value
561
702
  */
562
703
  #write_row(entity, value) {
563
- const row = row_of_entity(entity);
564
-
565
- if (row >= this.#rows_mirror.length) {
566
- this.#grow_mirror(row + 1);
567
- }
568
-
569
- if (this.#rows_mirror[row] === value) {
570
- return;
571
- }
572
-
573
- this.#rows_mirror[row] = value;
574
-
575
- this.#rows_dirty_low = Math.min(this.#rows_dirty_low, row);
576
- this.#rows_dirty_high = Math.max(this.#rows_dirty_high, row);
577
- }
578
-
579
- /**
580
- * @param {number} length
581
- */
582
- #grow_mirror(length) {
583
- let capacity = Math.max(INITIAL_ROW_CAPACITY, this.#rows_mirror.length);
584
-
585
- while (capacity < length) {
586
- capacity *= 2;
587
- }
588
-
589
- const grown = new Uint32Array(capacity).fill(GPU_DATABASE_NULL);
590
-
591
- grown.set(this.#rows_mirror);
592
-
593
- this.#rows_mirror = grown;
594
- }
595
-
596
- /**
597
- * A table buffer for at least `rows` rows; a new one gets the whole mirror.
598
- *
599
- * @param {number} rows
600
- * @returns {boolean} whether the buffer is new
601
- */
602
- #ensure_rows(rows) {
603
- if (rows > this.#rows_mirror.length) {
604
- this.#grow_mirror(rows);
605
- }
606
-
607
- if (this.#rows_buffer !== null && this.#rows_buffer.size >= 4 * this.#rows_mirror.length) {
608
- return false;
609
- }
610
-
611
- this.#rows_buffer?.destroy();
612
-
613
- const device = this.#device;
614
-
615
- this.#rows_buffer = device.createBuffer(BufferDescriptor.fromJSON({
616
- label: "ProbeClipmapSceneHolds/rows",
617
- size: 4 * this.#rows_mirror.length,
618
- usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,
619
- }));
620
-
621
- device.queue.writeBuffer(this.#rows_buffer, 0, this.#rows_mirror);
622
-
623
- this.#rows_dirty_low = Infinity;
624
- this.#rows_dirty_high = -1;
625
-
626
- return true;
704
+ this.#surface_rows.write(row_of_entity(entity), value);
627
705
  }
628
706
  }