@woosh/meep-engine 3.24.0 → 3.25.0

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 (322) hide show
  1. package/package.json +1 -1
  2. package/src/engine/graphics3/PickingSystem.d.ts +3 -3
  3. package/src/engine/graphics3/PickingSystem.d.ts.map +1 -1
  4. package/src/engine/graphics3/PickingSystem.js +52 -55
  5. package/src/engine/graphics3/shader_picking_gather.d.ts +40 -0
  6. package/src/engine/graphics3/shader_picking_gather.d.ts.map +1 -0
  7. package/src/engine/graphics3/shader_picking_gather.js +120 -0
  8. package/src/engine/physics/cloth/MEASUREMENTS.md +1050 -0
  9. package/src/engine/physics/cloth/PLAN.md +411 -49
  10. package/src/engine/physics/cloth/ecs/ClothColliderSerializationAdapter.d.ts +52 -0
  11. package/src/engine/physics/cloth/ecs/ClothColliderSerializationAdapter.d.ts.map +1 -0
  12. package/src/engine/physics/cloth/ecs/ClothColliderSerializationAdapter.js +70 -0
  13. package/src/engine/physics/cloth/ecs/ClothDynamics.d.ts +12 -3
  14. package/src/engine/physics/cloth/ecs/ClothDynamics.d.ts.map +1 -1
  15. package/src/engine/physics/cloth/ecs/ClothDynamics.js +340 -331
  16. package/src/engine/physics/cloth/ecs/ClothInstance.d.ts +36 -22
  17. package/src/engine/physics/cloth/ecs/ClothInstance.d.ts.map +1 -1
  18. package/src/engine/physics/cloth/ecs/ClothInstance.js +38 -23
  19. package/src/engine/physics/cloth/ecs/ClothSerializationAdapter.d.ts +84 -0
  20. package/src/engine/physics/cloth/ecs/ClothSerializationAdapter.d.ts.map +1 -0
  21. package/src/engine/physics/cloth/ecs/ClothSerializationAdapter.js +141 -0
  22. package/src/engine/physics/cloth/ecs/ClothSystem.d.ts +51 -82
  23. package/src/engine/physics/cloth/ecs/ClothSystem.d.ts.map +1 -1
  24. package/src/engine/physics/cloth/ecs/ClothSystem.js +81 -869
  25. package/src/engine/physics/cloth/ecs/ClothWorkerCore.d.ts +48 -0
  26. package/src/engine/physics/cloth/ecs/ClothWorkerCore.d.ts.map +1 -0
  27. package/src/engine/physics/cloth/ecs/ClothWorkerCore.js +107 -0
  28. package/src/engine/physics/cloth/ecs/ClothWorld.d.ts +286 -0
  29. package/src/engine/physics/cloth/ecs/ClothWorld.d.ts.map +1 -0
  30. package/src/engine/physics/cloth/ecs/ClothWorld.js +1104 -0
  31. package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts +182 -0
  32. package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts.map +1 -0
  33. package/src/engine/physics/cloth/ecs/WorkerClothSystem.js +562 -0
  34. package/src/engine/physics/cloth/ecs/cloth.worker.d.ts +2 -0
  35. package/src/engine/physics/cloth/ecs/cloth.worker.d.ts.map +1 -0
  36. package/src/engine/physics/cloth/ecs/cloth.worker.js +12 -0
  37. package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts.map +1 -1
  38. package/src/engine/physics/cloth/ecs/cloth_build_rows.js +2 -1
  39. package/src/engine/physics/cloth/ecs/cloth_dynamics_map.d.ts +58 -0
  40. package/src/engine/physics/cloth/ecs/cloth_dynamics_map.d.ts.map +1 -1
  41. package/src/engine/physics/cloth/ecs/cloth_dynamics_map.js +341 -271
  42. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts +20 -2
  43. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts.map +1 -1
  44. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.js +39 -15
  45. package/src/engine/physics/cloth/ecs/cloth_worker_protocol.d.ts +29 -0
  46. package/src/engine/physics/cloth/ecs/cloth_worker_protocol.d.ts.map +1 -0
  47. package/src/engine/physics/cloth/ecs/cloth_worker_protocol.js +78 -0
  48. package/src/engine/physics/cloth/ecs/makeClothWorker.d.ts +17 -0
  49. package/src/engine/physics/cloth/ecs/makeClothWorker.d.ts.map +1 -0
  50. package/src/engine/physics/cloth/ecs/makeClothWorker.js +18 -0
  51. package/src/engine/physics/cloth/playground/README.md +73 -2
  52. package/src/engine/physics/cloth/playground/wind.html +166 -0
  53. package/src/engine/physics/cloth/playground/wind_build.d.ts +81 -0
  54. package/src/engine/physics/cloth/playground/wind_build.d.ts.map +1 -0
  55. package/src/engine/physics/cloth/playground/wind_build.js +141 -0
  56. package/src/engine/physics/cloth/playground/wind_main.d.ts +2 -0
  57. package/src/engine/physics/cloth/playground/wind_main.d.ts.map +1 -0
  58. package/src/engine/physics/cloth/playground/wind_main.js +681 -0
  59. package/src/engine/physics/cloth/solver/ClothState.d.ts +134 -79
  60. package/src/engine/physics/cloth/solver/ClothState.d.ts.map +1 -1
  61. package/src/engine/physics/cloth/solver/ClothState.js +273 -12
  62. package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts +33 -0
  63. package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts.map +1 -1
  64. package/src/engine/physics/cloth/solver/cloth_solver_constants.js +34 -0
  65. package/src/engine/physics/cloth/solver/cloth_step.d.ts +21 -2
  66. package/src/engine/physics/cloth/solver/cloth_step.d.ts.map +1 -1
  67. package/src/engine/physics/cloth/solver/cloth_step.js +173 -4
  68. package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts +40 -0
  69. package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts.map +1 -0
  70. package/src/engine/physics/cloth/solver/cloth_step_instance.js +284 -0
  71. package/src/engine/physics/cloth/solver/cloth_wind_accelerate.d.ts +107 -0
  72. package/src/engine/physics/cloth/solver/cloth_wind_accelerate.d.ts.map +1 -0
  73. package/src/engine/physics/cloth/solver/cloth_wind_accelerate.js +263 -0
  74. package/src/engine/physics/cloth/wind/AbstractClothWind.d.ts +88 -0
  75. package/src/engine/physics/cloth/wind/AbstractClothWind.d.ts.map +1 -0
  76. package/src/engine/physics/cloth/wind/AbstractClothWind.js +100 -0
  77. package/src/engine/physics/cloth/wind/ClothAmbientWind.d.ts +85 -0
  78. package/src/engine/physics/cloth/wind/ClothAmbientWind.d.ts.map +1 -0
  79. package/src/engine/physics/cloth/wind/ClothAmbientWind.js +182 -0
  80. package/src/engine/physics/cloth/wind/ClothFluidWind.d.ts +79 -0
  81. package/src/engine/physics/cloth/wind/ClothFluidWind.d.ts.map +1 -0
  82. package/src/engine/physics/cloth/wind/ClothFluidWind.js +210 -0
  83. package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts +101 -0
  84. package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts.map +1 -0
  85. package/src/engine/physics/cloth/wind/cloth_sample_air.js +290 -0
  86. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  87. package/src/shade/device/mock/texture_copy.d.ts.map +1 -1
  88. package/src/shade/device/mock/texture_copy.js +28 -0
  89. package/src/shade/playground/vgeo_runtime/README.md +94 -0
  90. package/src/shade/playground/vgeo_runtime/index.html +62 -0
  91. package/src/shade/playground/vgeo_runtime/main.d.ts +2 -0
  92. package/src/shade/playground/vgeo_runtime/main.d.ts.map +1 -0
  93. package/src/shade/playground/vgeo_runtime/main.js +399 -0
  94. package/src/shade/playground/vgeo_viewer/sample_asset.js +1 -1
  95. package/src/shade/renderer/camera/Camera.d.ts +14 -0
  96. package/src/shade/renderer/camera/Camera.d.ts.map +1 -1
  97. package/src/shade/renderer/camera/Camera.js +7 -1
  98. package/src/shade/renderer/geometry/GEOMETRY_METADATA_STRUCT.d.ts.map +1 -1
  99. package/src/shade/renderer/geometry/GEOMETRY_METADATA_STRUCT.js +16 -1
  100. package/src/shade/renderer/geometry/GPUGeometryManager.d.ts.map +1 -1
  101. package/src/shade/renderer/geometry/GPUGeometryManager.js +29 -9
  102. package/src/shade/renderer/geometry/GPUGeometryMetadata.d.ts +10 -0
  103. package/src/shade/renderer/geometry/GPUGeometryMetadata.d.ts.map +1 -1
  104. package/src/shade/renderer/geometry/GPUGeometryMetadata.js +13 -0
  105. package/src/shade/renderer/geometry/virtual/VGEO_FORMAT.md +46 -18
  106. package/src/shade/renderer/geometry/virtual/VIRTUAL_GEOMETRY_DESIGN.md +70 -22
  107. package/src/shade/renderer/geometry/virtual/VIRTUAL_GEOMETRY_PLAN.md +97 -19
  108. package/src/shade/renderer/geometry/virtual/build/VGeoBuildOptions.d.ts +12 -2
  109. package/src/shade/renderer/geometry/virtual/build/VGeoBuildOptions.d.ts.map +1 -1
  110. package/src/shade/renderer/geometry/virtual/build/VGeoBuildOptions.js +14 -3
  111. package/src/shade/renderer/geometry/virtual/build/vgeo_assemble_pages.d.ts +2 -2
  112. package/src/shade/renderer/geometry/virtual/build/vgeo_assemble_pages.d.ts.map +1 -1
  113. package/src/shade/renderer/geometry/virtual/build/vgeo_assemble_pages.js +124 -6
  114. package/src/shade/renderer/geometry/virtual/build/vgeo_page_node_count.d.ts +22 -0
  115. package/src/shade/renderer/geometry/virtual/build/vgeo_page_node_count.d.ts.map +1 -0
  116. package/src/shade/renderer/geometry/virtual/build/vgeo_page_node_count.js +53 -0
  117. package/src/shade/renderer/geometry/virtual/format/VGeoWriteOptions.d.ts +8 -1
  118. package/src/shade/renderer/geometry/virtual/format/VGeoWriteOptions.d.ts.map +1 -1
  119. package/src/shade/renderer/geometry/virtual/format/VGeoWriteOptions.js +8 -1
  120. package/src/shade/renderer/geometry/virtual/format/header/VGEO_FEATURE_IGNORABLE_BOUNDED_PAGES.d.ts +16 -0
  121. package/src/shade/renderer/geometry/virtual/format/header/VGEO_FEATURE_IGNORABLE_BOUNDED_PAGES.d.ts.map +1 -0
  122. package/src/shade/renderer/geometry/virtual/format/header/VGEO_FEATURE_IGNORABLE_BOUNDED_PAGES.js +15 -0
  123. package/src/shade/renderer/geometry/virtual/format/page/VGEO_DEFAULT_PAGE_SIZE.d.ts +54 -0
  124. package/src/shade/renderer/geometry/virtual/format/page/VGEO_DEFAULT_PAGE_SIZE.d.ts.map +1 -0
  125. package/src/shade/renderer/geometry/virtual/format/page/VGEO_DEFAULT_PAGE_SIZE.js +53 -0
  126. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerHeader.d.ts +13 -2
  127. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerHeader.d.ts.map +1 -1
  128. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerHeader.js +14 -2
  129. package/src/shade/renderer/geometry/virtual/format/read/VGeoPage.d.ts +100 -0
  130. package/src/shade/renderer/geometry/virtual/format/read/VGeoPage.d.ts.map +1 -1
  131. package/src/shade/renderer/geometry/virtual/format/read/VGeoPage.js +113 -0
  132. package/src/shade/renderer/geometry/virtual/format/read/vgeo_read_header.d.ts.map +1 -1
  133. package/src/shade/renderer/geometry/virtual/format/read/vgeo_read_header.js +5 -0
  134. package/src/shade/renderer/geometry/virtual/format/read/vgeo_read_page.d.ts.map +1 -1
  135. package/src/shade/renderer/geometry/virtual/format/read/vgeo_read_page.js +108 -0
  136. package/src/shade/renderer/geometry/virtual/format/vgeo_validate_container.d.ts.map +1 -1
  137. package/src/shade/renderer/geometry/virtual/format/vgeo_validate_container.js +23 -0
  138. package/src/shade/renderer/geometry/virtual/format/vgeo_write_container.d.ts.map +1 -1
  139. package/src/shade/renderer/geometry/virtual/format/vgeo_write_container.js +40 -0
  140. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryPool.d.ts +228 -0
  141. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryPool.d.ts.map +1 -0
  142. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryPool.js +932 -0
  143. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts +176 -0
  144. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts.map +1 -0
  145. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.js +425 -0
  146. package/src/shade/renderer/geometry/virtual/runtime/REVIEW_LEDGER.md +241 -0
  147. package/src/shade/renderer/geometry/virtual/runtime/RUNTIME_PLAN.md +574 -0
  148. package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.d.ts +120 -0
  149. package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.d.ts.map +1 -0
  150. package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.js +674 -0
  151. package/src/shade/renderer/geometry/virtual/runtime/VGeoRuntimeTables.d.ts +287 -0
  152. package/src/shade/renderer/geometry/virtual/runtime/VGeoRuntimeTables.d.ts.map +1 -0
  153. package/src/shade/renderer/geometry/virtual/runtime/VGeoRuntimeTables.js +976 -0
  154. package/src/shade/renderer/geometry/virtual/runtime/VirtualGeometry.d.ts +42 -0
  155. package/src/shade/renderer/geometry/virtual/runtime/VirtualGeometry.d.ts.map +1 -0
  156. package/src/shade/renderer/geometry/virtual/runtime/VirtualGeometry.js +96 -0
  157. package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_FLAG_CULL.d.ts +16 -0
  158. package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_FLAG_CULL.d.ts.map +1 -0
  159. package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_FLAG_CULL.js +15 -0
  160. package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_PARAMS_STRUCT.d.ts +19 -0
  161. package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_PARAMS_STRUCT.d.ts.map +1 -0
  162. package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_PARAMS_STRUCT.js +83 -0
  163. package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_WORKGROUP_SIZE.d.ts +9 -0
  164. package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_WORKGROUP_SIZE.d.ts.map +1 -0
  165. package/src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_WORKGROUP_SIZE.js +8 -0
  166. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_access.d.ts +19 -0
  167. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_access.d.ts.map +1 -0
  168. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_access.js +160 -0
  169. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_collect.d.ts +3 -0
  170. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_collect.d.ts.map +1 -0
  171. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_collect.js +255 -0
  172. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_queue_prepare.d.ts +3 -0
  173. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_queue_prepare.d.ts.map +1 -0
  174. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_queue_prepare.js +80 -0
  175. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_seed.d.ts +3 -0
  176. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_seed.d.ts.map +1 -0
  177. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_seed.js +144 -0
  178. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_traverse.d.ts +3 -0
  179. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_traverse.d.ts.map +1 -0
  180. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_traverse.js +530 -0
  181. package/src/shade/renderer/geometry/virtual/runtime/cut/vgeo_cut_feedback_layout.d.ts +39 -0
  182. package/src/shade/renderer/geometry/virtual/runtime/cut/vgeo_cut_feedback_layout.d.ts.map +1 -0
  183. package/src/shade/renderer/geometry/virtual/runtime/cut/vgeo_cut_feedback_layout.js +54 -0
  184. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_if_enabled.d.ts +41 -0
  185. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_if_enabled.d.ts.map +1 -0
  186. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_if_enabled.js +56 -0
  187. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.d.ts +49 -0
  188. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.d.ts.map +1 -0
  189. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.js +328 -0
  190. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CLUSTER_ROW_OFFSET.d.ts +10 -0
  191. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CLUSTER_ROW_OFFSET.d.ts.map +1 -0
  192. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CLUSTER_ROW_OFFSET.js +51 -0
  193. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CLUSTER_ROW_WORDS.d.ts +13 -0
  194. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CLUSTER_ROW_WORDS.d.ts.map +1 -0
  195. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CLUSTER_ROW_WORDS.js +12 -0
  196. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CUT_STAT.d.ts +17 -0
  197. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CUT_STAT.d.ts.map +1 -0
  198. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CUT_STAT.js +99 -0
  199. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CUT_STAT_COUNT.d.ts +9 -0
  200. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CUT_STAT_COUNT.d.ts.map +1 -0
  201. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_CUT_STAT_COUNT.js +8 -0
  202. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_FEEDBACK_OFFSET.d.ts +7 -0
  203. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_FEEDBACK_OFFSET.d.ts.map +1 -0
  204. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_FEEDBACK_OFFSET.js +27 -0
  205. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GEOMETRY_ROW_NONE.d.ts +14 -0
  206. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GEOMETRY_ROW_NONE.d.ts.map +1 -0
  207. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GEOMETRY_ROW_NONE.js +13 -0
  208. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GEOMETRY_ROW_OFFSET.d.ts +7 -0
  209. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GEOMETRY_ROW_OFFSET.d.ts.map +1 -0
  210. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GEOMETRY_ROW_OFFSET.js +35 -0
  211. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GEOMETRY_ROW_WORDS.d.ts +9 -0
  212. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GEOMETRY_ROW_WORDS.d.ts.map +1 -0
  213. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GEOMETRY_ROW_WORDS.js +8 -0
  214. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GROUP_FLAG_SELECTABLE.d.ts +15 -0
  215. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GROUP_FLAG_SELECTABLE.d.ts.map +1 -0
  216. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GROUP_FLAG_SELECTABLE.js +14 -0
  217. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GROUP_ROW_OFFSET.d.ts +7 -0
  218. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GROUP_ROW_OFFSET.d.ts.map +1 -0
  219. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GROUP_ROW_OFFSET.js +36 -0
  220. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GROUP_ROW_WORDS.d.ts +10 -0
  221. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GROUP_ROW_WORDS.d.ts.map +1 -0
  222. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_GROUP_ROW_WORDS.js +9 -0
  223. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_OFFSET.d.ts +11 -0
  224. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_OFFSET.d.ts.map +1 -0
  225. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_OFFSET.js +54 -0
  226. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_WORDS.d.ts +9 -0
  227. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_WORDS.d.ts.map +1 -0
  228. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_WORDS.js +8 -0
  229. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NODE_ROW_LEAF_BIT.d.ts +11 -0
  230. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NODE_ROW_LEAF_BIT.d.ts.map +1 -0
  231. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NODE_ROW_LEAF_BIT.js +10 -0
  232. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NODE_ROW_OFFSET.d.ts +7 -0
  233. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NODE_ROW_OFFSET.d.ts.map +1 -0
  234. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NODE_ROW_OFFSET.js +30 -0
  235. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NODE_ROW_WORDS.d.ts +9 -0
  236. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NODE_ROW_WORDS.d.ts.map +1 -0
  237. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NODE_ROW_WORDS.js +8 -0
  238. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NO_CHILD_PAGE.d.ts +13 -0
  239. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NO_CHILD_PAGE.d.ts.map +1 -0
  240. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_NO_CHILD_PAGE.js +12 -0
  241. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_PAGE_ROW_NONE.d.ts +14 -0
  242. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_PAGE_ROW_NONE.d.ts.map +1 -0
  243. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_PAGE_ROW_NONE.js +13 -0
  244. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_PAGE_ROW_OFFSET.d.ts +11 -0
  245. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_PAGE_ROW_OFFSET.d.ts.map +1 -0
  246. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_PAGE_ROW_OFFSET.js +61 -0
  247. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_PAGE_ROW_WORDS.d.ts +9 -0
  248. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_PAGE_ROW_WORDS.d.ts.map +1 -0
  249. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_PAGE_ROW_WORDS.js +8 -0
  250. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_QUEUE_ITEM_WORDS.d.ts +13 -0
  251. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_QUEUE_ITEM_WORDS.d.ts.map +1 -0
  252. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_QUEUE_ITEM_WORDS.js +12 -0
  253. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_QUEUE_TARGET_GROUP_BIT.d.ts +9 -0
  254. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_QUEUE_TARGET_GROUP_BIT.d.ts.map +1 -0
  255. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_QUEUE_TARGET_GROUP_BIT.js +8 -0
  256. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_WANT_WORDS.d.ts +20 -0
  257. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_WANT_WORDS.d.ts.map +1 -0
  258. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_WANT_WORDS.js +19 -0
  259. package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_meshlet_batch.d.ts +23 -0
  260. package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_meshlet_batch.d.ts.map +1 -0
  261. package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_meshlet_batch.js +70 -0
  262. package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_page_block_words.d.ts +18 -0
  263. package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_page_block_words.d.ts.map +1 -0
  264. package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_page_block_words.js +25 -0
  265. package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_page_slot_words.d.ts +35 -0
  266. package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_page_slot_words.d.ts.map +1 -0
  267. package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_page_slot_words.js +41 -0
  268. package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_write_page_block.d.ts +32 -0
  269. package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_write_page_block.d.ts.map +1 -0
  270. package/src/shade/renderer/geometry/virtual/runtime/vgeo_runtime_write_page_block.js +138 -0
  271. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  272. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  273. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
  274. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +9 -0
  275. package/src/shade/renderer/rasterize/fast/graph_rasterize_scene_fast.d.ts.map +1 -1
  276. package/src/shade/renderer/rasterize/fast/graph_rasterize_scene_fast.js +12 -1
  277. package/src/shade/renderer/rasterize/standard/graph_rasterize_partial_opaque.d.ts.map +1 -1
  278. package/src/shade/renderer/rasterize/standard/graph_rasterize_partial_opaque.js +12 -1
  279. package/src/shade/renderer/rasterize/standard/graph_rasterize_remaining_opaque.d.ts.map +1 -1
  280. package/src/shade/renderer/rasterize/standard/graph_rasterize_remaining_opaque.js +10 -0
  281. package/src/shade/renderer/scene/GPUSceneContext.d.ts +18 -0
  282. package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
  283. package/src/shade/renderer/scene/GPUSceneContext.js +647 -594
  284. package/src/shade/renderer/scene/rows/GPUSceneRows.d.ts.map +1 -1
  285. package/src/shade/renderer/scene/rows/GPUSceneRows.js +22 -0
  286. package/src/shade/renderer/shader/chunk/geometry/mat3/chunk_mat3_singular_values.d.ts +35 -0
  287. package/src/shade/renderer/shader/chunk/geometry/mat3/chunk_mat3_singular_values.d.ts.map +1 -0
  288. package/src/shade/renderer/shader/chunk/geometry/mat3/chunk_mat3_singular_values.js +91 -0
  289. package/src/engine/graphics3/instantiate_scene_bundle.d.ts +0 -54
  290. package/src/engine/graphics3/instantiate_scene_bundle.d.ts.map +0 -1
  291. package/src/engine/graphics3/shade_node_to_entity_composition.d.ts +0 -39
  292. package/src/engine/graphics3/shade_node_to_entity_composition.d.ts.map +0 -1
  293. package/src/shade/renderer/animation/compute_skin_world_bounds.d.ts +0 -35
  294. package/src/shade/renderer/animation/compute_skin_world_bounds.d.ts.map +0 -1
  295. package/src/shade/renderer/animation/compute_skinned_mesh_clip_bounding_sphere.d.ts +0 -96
  296. package/src/shade/renderer/animation/compute_skinned_mesh_clip_bounding_sphere.d.ts.map +0 -1
  297. package/src/shade/renderer/animation/pose/pose_evaluate_world.d.ts +0 -20
  298. package/src/shade/renderer/animation/pose/pose_evaluate_world.d.ts.map +0 -1
  299. package/src/shade/renderer/animation/skin_bind_transform.d.ts +0 -25
  300. package/src/shade/renderer/animation/skin_bind_transform.d.ts.map +0 -1
  301. package/src/shade/renderer/animation/skin_frame_defect.d.ts +0 -34
  302. package/src/shade/renderer/animation/skin_frame_defect.d.ts.map +0 -1
  303. package/src/shade/renderer/animation/skin_joint_matrix.d.ts +0 -24
  304. package/src/shade/renderer/animation/skin_joint_matrix.d.ts.map +0 -1
  305. package/src/shade/renderer/animation/skin_normalize_mesh_frame.d.ts +0 -70
  306. package/src/shade/renderer/animation/skin_normalize_mesh_frame.d.ts.map +0 -1
  307. package/src/shade/renderer/buffer/table/GPUReadbackStagingRing.d.ts +0 -96
  308. package/src/shade/renderer/buffer/table/GPUReadbackStagingRing.d.ts.map +0 -1
  309. package/src/shade/renderer/scene/InstanceBatch.d.ts +0 -92
  310. package/src/shade/renderer/scene/InstanceBatch.d.ts.map +0 -1
  311. package/src/shade/renderer/scene/Mesh.d.ts +0 -55
  312. package/src/shade/renderer/scene/Mesh.d.ts.map +0 -1
  313. package/src/shade/renderer/scene/Node3D.d.ts +0 -159
  314. package/src/shade/renderer/scene/Node3D.d.ts.map +0 -1
  315. package/src/shade/renderer/scene/Node3DDirtyList.d.ts +0 -59
  316. package/src/shade/renderer/scene/Node3DDirtyList.d.ts.map +0 -1
  317. package/src/shade/renderer/scene/SceneNodeBinding.d.ts +0 -52
  318. package/src/shade/renderer/scene/SceneNodeBinding.d.ts.map +0 -1
  319. package/src/shade/renderer/scene/SkinnedMesh.d.ts +0 -27
  320. package/src/shade/renderer/scene/SkinnedMesh.d.ts.map +0 -1
  321. package/src/shade/renderer/scene/TransformAuthority.d.ts +0 -19
  322. package/src/shade/renderer/scene/TransformAuthority.d.ts.map +0 -1
@@ -0,0 +1,42 @@
1
+ /**
2
+ * A `.vgeo` container, as the scene carries it.
3
+ *
4
+ * It is a {@link MeshletGeometry} on purpose rather than a parallel type: a `Mesh` binds one
5
+ * geometry to one material, the material buckets are keyed on the mesh, and design §7 is explicit
6
+ * that **VG carries geometry only** — a multi-material source splits into one geometry per material
7
+ * upstream of the builder. So a VG instance is an ordinary instance in every respect the scene
8
+ * cares about, and everything virtual about it lives behind `vg_row`.
9
+ *
10
+ * What it does not have is meshlets. `meshlets.count` is zero, which is not a placeholder: it is
11
+ * what makes `shader_meshes_to_meshlet_counts` contribute nothing for a VG instance without that
12
+ * shader knowing virtual geometry exists. Everything a VG instance draws comes from the cut
13
+ * selected for the view it is being drawn into.
14
+ *
15
+ * Bounds and the triangle count come from the container's header, where they describe the
16
+ * **normalized source mesh** — so an instance's world bounds are the asset's, not the cut's, which
17
+ * is what instance-level culling needs and what a cut must not be asked for before it is selected.
18
+ *
19
+ * @author Alex Goldring
20
+ * @copyright Company Named Limited (c) 2026
21
+ */
22
+ export class VirtualGeometry extends MeshletGeometry {
23
+ /**
24
+ * @param {VGeoContainerReader} reader an open container
25
+ */
26
+ constructor(reader: VGeoContainerReader);
27
+ /**
28
+ * The reader that owns the container's residency. One reader per asset, shared by every
29
+ * instance of it — design §6: instances of the same asset share pages and residency.
30
+ * @type {VGeoContainerReader}
31
+ */
32
+ reader: VGeoContainerReader;
33
+ /**
34
+ * Row in `GPUVirtualGeometryPool`'s geometry table, published into this geometry's
35
+ * `GEOMETRY_METADATA_STRUCT` row so a shader can find it from an instance.
36
+ * @type {number}
37
+ */
38
+ vg_row: number;
39
+ isVirtualGeometry: boolean;
40
+ }
41
+ import { MeshletGeometry } from "../../MeshletGeometry.js";
42
+ //# sourceMappingURL=VirtualGeometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VirtualGeometry.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/geometry/virtual/runtime/VirtualGeometry.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IAeI;;OAEG;IACH,yCAqBC;IAtCD;;;;OAIG;IACH,4BAAO;IAEP;;;;OAIG;IACH,QAFU,MAAM,CAEgB;IAyDpC,2BAA2C;CAF1C;gCA5F+B,0BAA0B"}
@@ -0,0 +1,96 @@
1
+ import { assert } from "../../../../../core/assert.js";
2
+ import { MeshletGeometry } from "../../MeshletGeometry.js";
3
+ import { VGEO_GEOMETRY_ROW_NONE } from "./layout/VGEO_GEOMETRY_ROW_NONE.js";
4
+
5
+ /**
6
+ * A `.vgeo` container, as the scene carries it.
7
+ *
8
+ * It is a {@link MeshletGeometry} on purpose rather than a parallel type: a `Mesh` binds one
9
+ * geometry to one material, the material buckets are keyed on the mesh, and design §7 is explicit
10
+ * that **VG carries geometry only** — a multi-material source splits into one geometry per material
11
+ * upstream of the builder. So a VG instance is an ordinary instance in every respect the scene
12
+ * cares about, and everything virtual about it lives behind `vg_row`.
13
+ *
14
+ * What it does not have is meshlets. `meshlets.count` is zero, which is not a placeholder: it is
15
+ * what makes `shader_meshes_to_meshlet_counts` contribute nothing for a VG instance without that
16
+ * shader knowing virtual geometry exists. Everything a VG instance draws comes from the cut
17
+ * selected for the view it is being drawn into.
18
+ *
19
+ * Bounds and the triangle count come from the container's header, where they describe the
20
+ * **normalized source mesh** — so an instance's world bounds are the asset's, not the cut's, which
21
+ * is what instance-level culling needs and what a cut must not be asked for before it is selected.
22
+ *
23
+ * @author Alex Goldring
24
+ * @copyright Company Named Limited (c) 2026
25
+ */
26
+ export class VirtualGeometry extends MeshletGeometry {
27
+ /**
28
+ * The reader that owns the container's residency. One reader per asset, shared by every
29
+ * instance of it — design §6: instances of the same asset share pages and residency.
30
+ * @type {VGeoContainerReader}
31
+ */
32
+ reader;
33
+
34
+ /**
35
+ * Row in `GPUVirtualGeometryPool`'s geometry table, published into this geometry's
36
+ * `GEOMETRY_METADATA_STRUCT` row so a shader can find it from an instance.
37
+ * @type {number}
38
+ */
39
+ vg_row = VGEO_GEOMETRY_ROW_NONE;
40
+
41
+ /**
42
+ * @param {VGeoContainerReader} reader an open container
43
+ */
44
+ constructor(reader) {
45
+ super();
46
+
47
+ assert.defined(reader, 'reader');
48
+ assert.defined(reader.header, 'reader.header — the container must be open');
49
+
50
+ this.reader = reader;
51
+
52
+ const header = reader.header;
53
+
54
+ this.name = `vgeo:${header.total_pages} pages`;
55
+
56
+ this.bounding_box.set(header.object_bounds);
57
+ this.bounding_sphere.set(header.object_sphere);
58
+
59
+ /*
60
+ The source's triangle count, not the cut's. Nothing renders from it — it is what
61
+ `getIndexCount` reports and what a statistics panel shows — and reporting the cut's would
62
+ make a geometry's size a function of where the camera is standing.
63
+ */
64
+ this.primitive_count = Number(header.source_face_count);
65
+ }
66
+
67
+ /**
68
+ * A virtual geometry's identity is its **container**, not its meshlets.
69
+ *
70
+ * `MeshletGeometry` hashes and compares `this.meshlets`, and a virtual geometry's `MeshletBatch`
71
+ * is deliberately empty — so every virtual geometry in a scene hashed and compared equal to
72
+ * every other one, and `GPUGeometryManager.add` keys its content index on exactly that. The
73
+ * second `.vgeo` asset registered became another name for the first's record and drew the
74
+ * first's cut (REVIEW_LEDGER C6).
75
+ *
76
+ * Two instances over the *same* reader genuinely are one geometry — one geometry row, one page
77
+ * lookup, one cut — so sharing there is right, and that is what this says.
78
+ *
79
+ * @returns {number}
80
+ */
81
+ hash() {
82
+ // the low 32 bits of the asset id, which is xxh3-128 of the whole file — two containers
83
+ // agree here only if they are the same bytes
84
+ return Number(this.reader.header.asset_id_low64 & 0xFFFFFFFFn) >>> 0;
85
+ }
86
+
87
+ /**
88
+ * @param {MeshletGeometry} other
89
+ * @returns {boolean}
90
+ */
91
+ equals(other) {
92
+ return other?.isVirtualGeometry === true && other.reader === this.reader;
93
+ }
94
+ }
95
+
96
+ VirtualGeometry.prototype.isVirtualGeometry = true;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * `VGEO_CUT_PARAMS_STRUCT.flags`: run the frustum test at every node.
3
+ *
4
+ * Off is not merely "slower and identical" — a frustum cull can leave a genuine hole, because the
5
+ * parent that would have stood in over the culled region is not drawn either (it failed
6
+ * `project(self) <= tau`) and the child is never reached. Everything involved is inside the culled
7
+ * sphere, so the hole is in geometry the frustum rejected, but that makes it a real difference in
8
+ * the selected set rather than a performance knob. The agreement spec therefore holds the kernel
9
+ * against `vgeo_select_cut` with this **off**, which is also how `VGeoCutView` defaults.
10
+ *
11
+ * @author Alex Goldring
12
+ * @copyright Company Named Limited (c) 2026
13
+ * @type {number}
14
+ */
15
+ export const VGEO_CUT_FLAG_CULL: number;
16
+ //# sourceMappingURL=VGEO_CUT_FLAG_CULL.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VGEO_CUT_FLAG_CULL.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_FLAG_CULL.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,iCAFU,MAAM,CAEoB"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * `VGEO_CUT_PARAMS_STRUCT.flags`: run the frustum test at every node.
3
+ *
4
+ * Off is not merely "slower and identical" — a frustum cull can leave a genuine hole, because the
5
+ * parent that would have stood in over the culled region is not drawn either (it failed
6
+ * `project(self) <= tau`) and the child is never reached. Everything involved is inside the culled
7
+ * sphere, so the hole is in geometry the frustum rejected, but that makes it a real difference in
8
+ * the selected set rather than a performance knob. The agreement spec therefore holds the kernel
9
+ * against `vgeo_select_cut` with this **off**, which is also how `VGeoCutView` defaults.
10
+ *
11
+ * @author Alex Goldring
12
+ * @copyright Company Named Limited (c) 2026
13
+ * @type {number}
14
+ */
15
+ export const VGEO_CUT_FLAG_CULL = 1;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * What every pass of one cut needs to know about the buffers it was handed.
3
+ *
4
+ * A **uniform** rather than immediate data, deliberately. Immediates would fit — twelve words
5
+ * against a guaranteed 64-byte budget — but `maxImmediateSize` is an adapter limit that some
6
+ * contexts report as zero, and a cut that silently fails to build on a device is worse than one
7
+ * small uniform buffer the runtime writes once a frame.
8
+ *
9
+ * Every capacity here is a **host-side decision about a graph resource**, which is exactly why it
10
+ * travels rather than being a constant: the kernel bounds-checks every append against these, and a
11
+ * kernel that assumed a size would read past a pooled buffer the first time the pool handed back
12
+ * something smaller.
13
+ *
14
+ * @author Alex Goldring
15
+ * @copyright Company Named Limited (c) 2026
16
+ */
17
+ export const VGEO_CUT_PARAMS_STRUCT: WebGPUStruct;
18
+ import { WebGPUStruct } from "../../../../shader/type/WebGPUStruct.js";
19
+ //# sourceMappingURL=VGEO_CUT_PARAMS_STRUCT.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VGEO_CUT_PARAMS_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_PARAMS_STRUCT.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AACH,kDA+D2B;6BAjFE,yCAAyC"}
@@ -0,0 +1,83 @@
1
+ import { f32, u32 } from "../../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
2
+ import { WebGPUStruct } from "../../../../shader/type/WebGPUStruct.js";
3
+
4
+ /**
5
+ * What every pass of one cut needs to know about the buffers it was handed.
6
+ *
7
+ * A **uniform** rather than immediate data, deliberately. Immediates would fit — twelve words
8
+ * against a guaranteed 64-byte budget — but `maxImmediateSize` is an adapter limit that some
9
+ * contexts report as zero, and a cut that silently fails to build on a device is worse than one
10
+ * small uniform buffer the runtime writes once a frame.
11
+ *
12
+ * Every capacity here is a **host-side decision about a graph resource**, which is exactly why it
13
+ * travels rather than being a constant: the kernel bounds-checks every append against these, and a
14
+ * kernel that assumed a size would read past a pooled buffer the first time the pool handed back
15
+ * something smaller.
16
+ *
17
+ * @author Alex Goldring
18
+ * @copyright Company Named Limited (c) 2026
19
+ */
20
+ export const VGEO_CUT_PARAMS_STRUCT = WebGPUStruct.from({
21
+ /**
22
+ * Pixels of permitted error — design §4's single quality/perf lever, defaulting to 1.
23
+ */
24
+ tau: f32,
25
+ /**
26
+ * `screen_height / (2 * tan(fov_y / 2))` — the projection's numerator, which is a property of
27
+ * the render target and the camera rather than of any instance.
28
+ *
29
+ * The collect pass multiplies it by each instance's own scale correction and stores the result
30
+ * per instance, so the traversal reads one number and never touches a transform.
31
+ */
32
+ projection_k: f32,
33
+ /**
34
+ * Items one queue holds. The wavefront clamps its own count to this, so an overflowing
35
+ * iteration loses work rather than dispatching over a buffer's end.
36
+ */
37
+ queue_capacity: u32,
38
+ /**
39
+ * Words in the claim bitmask. An instance whose slice does not fit is refused outright — see
40
+ * `VGEO_CUT_STAT.INSTANCES_DROPPED` for why that is the safe direction.
41
+ */
42
+ claim_word_count: u32,
43
+ /**
44
+ * How many clusters one group-chunk item covers.
45
+ */
46
+ cluster_chunk: u32,
47
+ /**
48
+ * Arena words one page slot holds — the stride a page row is multiplied by.
49
+ *
50
+ * A host-side decision, like every other capacity here: the tier derives it from the page size
51
+ * its containers are bounded at (`vgeo_runtime_page_slot_words`), and a kernel that baked it in
52
+ * would read another page's rows the first time a pool was built for a different page size.
53
+ */
54
+ page_slot_words: u32,
55
+ /**
56
+ * Word offset in the feedback buffer of the per-page-row touch stamps.
57
+ */
58
+ touch_stamp_base: u32,
59
+ /**
60
+ * Word offset in the feedback buffer of the per-lookup-word want stamps. A want's stamp index
61
+ * is this plus the geometry's lookup offset plus the child page index, which is why the page
62
+ * lookup has its own buffer and its own allocator: it makes that a compact, dense index.
63
+ */
64
+ want_stamp_base: u32,
65
+ want_base: u32,
66
+ want_capacity: u32,
67
+ touch_base: u32,
68
+ touch_capacity: u32,
69
+ /**
70
+ * Records the VG instance buffer holds, for the one append in the cut that had no bound.
71
+ */
72
+ instance_capacity: u32,
73
+ /**
74
+ * Records the shared meshlet collection holds — the collection this frame's expansion sites
75
+ * were actually handed, taken as the minimum across them, and **not** a frame-scoped constant.
76
+ * It was 1 << 20 against an engine default of 2e5.
77
+ */
78
+ meshlet_capacity: u32,
79
+ /**
80
+ * @see VGEO_CUT_FLAG_CULL
81
+ */
82
+ flags: u32,
83
+ }, "VGeoCutParams").pack();
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Lanes per workgroup of the traversal kernel — one queue item each.
3
+ *
4
+ * @author Alex Goldring
5
+ * @copyright Company Named Limited (c) 2026
6
+ * @type {number}
7
+ */
8
+ export const VGEO_CUT_WORKGROUP_SIZE: number;
9
+ //# sourceMappingURL=VGEO_CUT_WORKGROUP_SIZE.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VGEO_CUT_WORKGROUP_SIZE.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/runtime/cut/VGEO_CUT_WORKGROUP_SIZE.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,sCAFU,MAAM,CAE0B"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Lanes per workgroup of the traversal kernel — one queue item each.
3
+ *
4
+ * @author Alex Goldring
5
+ * @copyright Company Named Limited (c) 2026
6
+ * @type {number}
7
+ */
8
+ export const VGEO_CUT_WORKGROUP_SIZE = 64;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Addressing and arithmetic shared by every pass of the cut — how to find a row, and how to project
3
+ * an error.
4
+ *
5
+ * The arena is `array<u32>` with hand-written accessors rather than a marshalled struct array,
6
+ * because it holds three different row types in one allocation per page and no struct array can say
7
+ * that. The offsets it indexes with are the `layout/` constants, so the CPU writer and the kernel
8
+ * are reading the same numbers rather than two copies of them.
9
+ *
10
+ * Every buffer named here has to be declared by the importing shader. That is the price of sharing
11
+ * addressing across passes, and it is the same bargain `chunk_scene_database_access` makes.
12
+ *
13
+ * @author Alex Goldring
14
+ * @copyright Company Named Limited (c) 2026
15
+ * @type {CodeChunk}
16
+ */
17
+ export const chunk_vgeo_cut_access: CodeChunk;
18
+ import { CodeChunk } from "../../../../shader/compiler/CodeChunk.js";
19
+ //# sourceMappingURL=chunk_vgeo_cut_access.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_vgeo_cut_access.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_access.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;GAeG;AACH,oCAFU,SAAS,CAqIZ;0BA/JmB,0CAA0C"}
@@ -0,0 +1,160 @@
1
+ import { CodeChunk } from "../../../../shader/compiler/CodeChunk.js";
2
+ import { VGEO_CLUSTER_ROW_WORDS } from "../layout/VGEO_CLUSTER_ROW_WORDS.js";
3
+ import { VGEO_GEOMETRY_ROW_WORDS } from "../layout/VGEO_GEOMETRY_ROW_WORDS.js";
4
+ import { VGEO_GROUP_ROW_WORDS } from "../layout/VGEO_GROUP_ROW_WORDS.js";
5
+ import { VGEO_INSTANCE_OFFSET } from "../layout/VGEO_INSTANCE_OFFSET.js";
6
+ import { VGEO_INSTANCE_WORDS } from "../layout/VGEO_INSTANCE_WORDS.js";
7
+ import { VGEO_NODE_ROW_LEAF_BIT } from "../layout/VGEO_NODE_ROW_LEAF_BIT.js";
8
+ import { VGEO_NODE_ROW_OFFSET } from "../layout/VGEO_NODE_ROW_OFFSET.js";
9
+ import { VGEO_NODE_ROW_WORDS } from "../layout/VGEO_NODE_ROW_WORDS.js";
10
+ import { VGEO_PAGE_ROW_OFFSET } from "../layout/VGEO_PAGE_ROW_OFFSET.js";
11
+ import { VGEO_PAGE_ROW_WORDS } from "../layout/VGEO_PAGE_ROW_WORDS.js";
12
+
13
+ /**
14
+ * Addressing and arithmetic shared by every pass of the cut — how to find a row, and how to project
15
+ * an error.
16
+ *
17
+ * The arena is `array<u32>` with hand-written accessors rather than a marshalled struct array,
18
+ * because it holds three different row types in one allocation per page and no struct array can say
19
+ * that. The offsets it indexes with are the `layout/` constants, so the CPU writer and the kernel
20
+ * are reading the same numbers rather than two copies of them.
21
+ *
22
+ * Every buffer named here has to be declared by the importing shader. That is the price of sharing
23
+ * addressing across passes, and it is the same bargain `chunk_scene_database_access` makes.
24
+ *
25
+ * @author Alex Goldring
26
+ * @copyright Company Named Limited (c) 2026
27
+ * @type {CodeChunk}
28
+ */
29
+ export const chunk_vgeo_cut_access = CodeChunk.from(
30
+ //language=WGSL
31
+ `
32
+ const VG_PAGE_ROW_WORDS = ${VGEO_PAGE_ROW_WORDS}u;
33
+ const VG_NODE_ROW_WORDS = ${VGEO_NODE_ROW_WORDS}u;
34
+ const VG_GROUP_ROW_WORDS = ${VGEO_GROUP_ROW_WORDS}u;
35
+ const VG_CLUSTER_ROW_WORDS = ${VGEO_CLUSTER_ROW_WORDS}u;
36
+ const VG_INSTANCE_WORDS = ${VGEO_INSTANCE_WORDS}u;
37
+ const VG_GEOMETRY_ROW_WORDS = ${VGEO_GEOMETRY_ROW_WORDS}u;
38
+
39
+ const VG_NODE_LEAF_BIT = ${VGEO_NODE_ROW_LEAF_BIT}u;
40
+ const VG_NODE_CHILD_COUNT_MASK = 0xffu;
41
+
42
+ /**
43
+ * Any error at or above this is the root's +infinity, however the file spelled it.
44
+ *
45
+ * Tested rather than relied on: an infinity travels through \`error * k / d\` correctly on every
46
+ * conformant implementation, and a kernel whose root cluster stops refining on a device that
47
+ * flushes it is a failure nothing downstream could attribute.
48
+ */
49
+ const VG_ERROR_INFINITE = 3.0e38;
50
+ const VG_PROJECTION_MAX = 3.4e38;
51
+
52
+ /**
53
+ * A page's slot: its header, then its node, group and cluster rows.
54
+ *
55
+ * The stride is a uniform rather than a constant because the tier derives it from the page size its
56
+ * containers are bounded at, and it is a **multiply** rather than a table read because format
57
+ * §11.14 made that legal — design §6 asked for fixed-size page slots from the start and the bound
58
+ * is what it was waiting for. There is no page table, no allocator, and no second storage binding
59
+ * to keep coherent with this one.
60
+ */
61
+ fn vg_slot_base(page_row: u32) -> u32 {
62
+ return page_row * params.page_slot_words;
63
+ }
64
+
65
+ fn vg_page_field(page_row: u32, field: u32) -> u32 {
66
+ return vg_arena[vg_slot_base(page_row) + field];
67
+ }
68
+
69
+ fn vg_node_base(page_row: u32) -> u32 {
70
+ return vg_slot_base(page_row) + VG_PAGE_ROW_WORDS;
71
+ }
72
+
73
+ fn vg_group_base(page_row: u32) -> u32 {
74
+ return vg_node_base(page_row)
75
+ + vg_page_field(page_row, ${VGEO_PAGE_ROW_OFFSET.NODE_COUNT}u) * VG_NODE_ROW_WORDS;
76
+ }
77
+
78
+ fn vg_cluster_base(page_row: u32) -> u32 {
79
+ return vg_group_base(page_row)
80
+ + vg_page_field(page_row, ${VGEO_PAGE_ROW_OFFSET.GROUP_COUNT}u) * VG_GROUP_ROW_WORDS;
81
+ }
82
+
83
+ fn vg_arena_f32(word: u32) -> f32 {
84
+ return bitcast<f32>(vg_arena[word]);
85
+ }
86
+
87
+ fn vg_sphere_at(word: u32) -> vec4<f32> {
88
+ return vec4<f32>(
89
+ bitcast<f32>(vg_arena[word]),
90
+ bitcast<f32>(vg_arena[word + 1u]),
91
+ bitcast<f32>(vg_arena[word + 2u]),
92
+ bitcast<f32>(vg_arena[word + 3u])
93
+ );
94
+ }
95
+
96
+ fn vg_instance_f32(instance_base: u32, field: u32) -> f32 {
97
+ return bitcast<f32>(instances[instance_base + field]);
98
+ }
99
+
100
+ fn vg_instance_eye(instance_base: u32) -> vec3<f32> {
101
+ return vec3<f32>(
102
+ vg_instance_f32(instance_base, ${VGEO_INSTANCE_OFFSET.EYE}u),
103
+ vg_instance_f32(instance_base, ${VGEO_INSTANCE_OFFSET.EYE + 1}u),
104
+ vg_instance_f32(instance_base, ${VGEO_INSTANCE_OFFSET.EYE + 2}u)
105
+ );
106
+ }
107
+
108
+ /**
109
+ * \`err_px = r_e * screen_height / (2 * tan(fov_y / 2) * d)\`, with \`d\` the distance to the
110
+ * **closest point** of the sphere — design §4, and written in that order so that it agrees with
111
+ * \`select_cut.js\` term for term rather than merely in the limit.
112
+ *
113
+ * Two conventions carry real weight. A zero error projects to zero **unconditionally**, so a leaf
114
+ * — whose error is exactly zero — does not become undrawable the moment the camera enters its
115
+ * sphere. And a camera inside the sphere projects to the maximum when the error is not zero, so the
116
+ * cluster refines; the two rules meet at the same \`if\` and disagreeing about which comes first is
117
+ * how a leaf disappears at point-blank range.
118
+ */
119
+ fn vg_project(error: f32, sphere: vec4<f32>, eye: vec3<f32>, k: f32) -> f32 {
120
+ if (error == 0.0) {
121
+ return 0.0;
122
+ }
123
+
124
+ if (error >= VG_ERROR_INFINITE) {
125
+ return VG_PROJECTION_MAX;
126
+ }
127
+
128
+ let distance = length(eye - sphere.xyz) - sphere.w;
129
+
130
+ if (distance <= 0.0) {
131
+ return VG_PROJECTION_MAX;
132
+ }
133
+
134
+ return error * k / distance;
135
+ }
136
+
137
+ /**
138
+ * Whether a sphere is entirely outside the instance's object-space frustum.
139
+ *
140
+ * Five planes, not six. The projection is infinite reverse-Z, so the far plane's row is degenerate
141
+ * and normalizing it produces nothing a test can use; the instance record orders it last precisely
142
+ * so that "the first five" is true by construction.
143
+ */
144
+ fn vg_sphere_outside_frustum(instance_base: u32, sphere: vec4<f32>) -> bool {
145
+ for (var plane = 0u; plane < 5u; plane = plane + 1u) {
146
+ let word = instance_base + ${VGEO_INSTANCE_OFFSET.FRUSTUM}u + plane * 4u;
147
+
148
+ let distance = bitcast<f32>(instances[word]) * sphere.x
149
+ + bitcast<f32>(instances[word + 1u]) * sphere.y
150
+ + bitcast<f32>(instances[word + 2u]) * sphere.z
151
+ + bitcast<f32>(instances[word + 3u]);
152
+
153
+ if (distance < -sphere.w) {
154
+ return true;
155
+ }
156
+ }
157
+
158
+ return false;
159
+ }
160
+ `, []);
@@ -0,0 +1,3 @@
1
+ export const shader_vgeo_cut_collect: ComputeShader;
2
+ import { ComputeShader } from "../../../../shader/ComputeShader.js";
3
+ //# sourceMappingURL=shader_vgeo_cut_collect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shader_vgeo_cut_collect.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_collect.js"],"names":[],"mappings":"AA0PA,oDAIG;8BAxP2B,qCAAqC"}