@woosh/meep-engine 3.43.0 → 3.44.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 (287) hide show
  1. package/editor/prototypeEditorShell.d.ts.map +1 -1
  2. package/editor/prototypeEditorShell.js +4 -2
  3. package/package.json +1 -1
  4. package/src/engine/Clock.d.ts +15 -0
  5. package/src/engine/Clock.d.ts.map +1 -1
  6. package/src/engine/Clock.js +29 -5
  7. package/src/engine/Engine.d.ts.map +1 -1
  8. package/src/engine/Engine.js +11 -19
  9. package/src/engine/graphics/ecs/mesh-v2/MeshSkin.d.ts +57 -0
  10. package/src/engine/graphics/ecs/mesh-v2/MeshSkin.d.ts.map +1 -0
  11. package/src/engine/graphics/ecs/mesh-v2/MeshSkin.js +84 -0
  12. package/src/engine/graphics3/AnimationGraphSystem.d.ts +23 -13
  13. package/src/engine/graphics3/AnimationGraphSystem.d.ts.map +1 -1
  14. package/src/engine/graphics3/AnimationGraphSystem.js +61 -64
  15. package/src/engine/graphics3/AnimationSystem.d.ts +24 -15
  16. package/src/engine/graphics3/AnimationSystem.d.ts.map +1 -1
  17. package/src/engine/graphics3/AnimationSystem.js +67 -61
  18. package/src/engine/graphics3/MeshSkinSystem.d.ts +56 -0
  19. package/src/engine/graphics3/MeshSkinSystem.d.ts.map +1 -0
  20. package/src/engine/graphics3/MeshSkinSystem.js +317 -0
  21. package/src/engine/graphics3/MeshSystem.d.ts +15 -35
  22. package/src/engine/graphics3/MeshSystem.d.ts.map +1 -1
  23. package/src/engine/graphics3/MeshSystem.js +21 -298
  24. package/src/engine/graphics3/RowChains.d.ts +76 -0
  25. package/src/engine/graphics3/RowChains.d.ts.map +1 -0
  26. package/src/engine/graphics3/RowChains.js +347 -0
  27. package/src/engine/graphics3/ShadedGeometrySystem.d.ts +6 -0
  28. package/src/engine/graphics3/ShadedGeometrySystem.d.ts.map +1 -1
  29. package/src/engine/graphics3/ShadedGeometrySystem.js +329 -309
  30. package/src/engine/graphics3/animation/AnimationClips.d.ts +56 -0
  31. package/src/engine/graphics3/animation/AnimationClips.d.ts.map +1 -0
  32. package/src/engine/graphics3/animation/AnimationClips.js +79 -0
  33. package/src/engine/graphics3/animation/ClipListPlayer.d.ts +13 -14
  34. package/src/engine/graphics3/animation/ClipListPlayer.d.ts.map +1 -1
  35. package/src/engine/graphics3/animation/ClipListPlayer.js +262 -263
  36. package/src/engine/graphics3/animation/write_clip_playback.d.ts +3 -3
  37. package/src/engine/graphics3/animation/write_clip_playback.js +4 -4
  38. package/src/engine/graphics3/pose/query_entity_node_world_pose.d.ts +5 -0
  39. package/src/engine/graphics3/pose/query_entity_node_world_pose.d.ts.map +1 -1
  40. package/src/engine/graphics3/pose/query_entity_node_world_pose.js +80 -75
  41. package/src/engine/graphics3/prefab/PrefabInstance.d.ts +4 -24
  42. package/src/engine/graphics3/prefab/PrefabInstance.d.ts.map +1 -1
  43. package/src/engine/graphics3/prefab/PrefabInstance.js +60 -80
  44. package/src/engine/graphics3/prefab/prefab_instantiate.d.ts +16 -3
  45. package/src/engine/graphics3/prefab/prefab_instantiate.d.ts.map +1 -1
  46. package/src/engine/graphics3/prefab/prefab_instantiate.js +49 -12
  47. package/src/engine/graphics3/prefab/prefab_place.d.ts +31 -17
  48. package/src/engine/graphics3/prefab/prefab_place.d.ts.map +1 -1
  49. package/src/engine/graphics3/prefab/prefab_place.js +175 -130
  50. package/src/engine/graphics3/register_clips.d.ts +64 -0
  51. package/src/engine/graphics3/register_clips.d.ts.map +1 -0
  52. package/src/engine/graphics3/register_clips.js +114 -0
  53. package/src/engine/physics/cloth/MEASUREMENTS.md +795 -0
  54. package/src/engine/physics/cloth/PLAN.md +339 -9
  55. package/src/engine/physics/cloth/build/ClothProxy.d.ts +113 -61
  56. package/src/engine/physics/cloth/build/ClothProxy.d.ts.map +1 -1
  57. package/src/engine/physics/cloth/build/ClothProxy.js +142 -77
  58. package/src/engine/physics/cloth/build/cloth_bind_in_frame.d.ts +22 -0
  59. package/src/engine/physics/cloth/build/cloth_bind_in_frame.d.ts.map +1 -0
  60. package/src/engine/physics/cloth/build/cloth_bind_in_frame.js +75 -0
  61. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts +43 -30
  62. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts.map +1 -1
  63. package/src/engine/physics/cloth/build/cloth_proxy_from_joints.js +357 -284
  64. package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.d.ts +62 -0
  65. package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.d.ts.map +1 -0
  66. package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.js +280 -0
  67. package/src/engine/physics/cloth/collider/cloth_collider_sdf.d.ts +1 -1
  68. package/src/engine/physics/cloth/collider/cloth_collider_sdf.js +1 -1
  69. package/src/engine/physics/cloth/ecs/Cloth.d.ts +17 -9
  70. package/src/engine/physics/cloth/ecs/Cloth.d.ts.map +1 -1
  71. package/src/engine/physics/cloth/ecs/Cloth.js +220 -212
  72. package/src/engine/physics/cloth/ecs/ClothDynamicsFlags.js +6 -0
  73. package/src/engine/physics/cloth/ecs/ClothHold.d.ts +91 -0
  74. package/src/engine/physics/cloth/ecs/ClothHold.d.ts.map +1 -0
  75. package/src/engine/physics/cloth/ecs/ClothHold.js +103 -0
  76. package/src/engine/physics/cloth/ecs/ClothInstance.d.ts +254 -48
  77. package/src/engine/physics/cloth/ecs/ClothInstance.d.ts.map +1 -1
  78. package/src/engine/physics/cloth/ecs/ClothInstance.js +277 -47
  79. package/src/engine/physics/cloth/ecs/ClothPin.d.ts +73 -0
  80. package/src/engine/physics/cloth/ecs/ClothPin.d.ts.map +1 -0
  81. package/src/engine/physics/cloth/ecs/ClothPin.js +92 -0
  82. package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.d.ts +36 -0
  83. package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.d.ts.map +1 -0
  84. package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.js +61 -0
  85. package/src/engine/physics/cloth/ecs/ClothRig.d.ts +23 -17
  86. package/src/engine/physics/cloth/ecs/ClothRig.d.ts.map +1 -1
  87. package/src/engine/physics/cloth/ecs/ClothRig.js +29 -27
  88. package/src/engine/physics/cloth/ecs/ClothSystem.d.ts +12 -14
  89. package/src/engine/physics/cloth/ecs/ClothSystem.d.ts.map +1 -1
  90. package/src/engine/physics/cloth/ecs/ClothSystem.js +20 -15
  91. package/src/engine/physics/cloth/ecs/ClothWorld.d.ts +57 -36
  92. package/src/engine/physics/cloth/ecs/ClothWorld.d.ts.map +1 -1
  93. package/src/engine/physics/cloth/ecs/ClothWorld.js +816 -179
  94. package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts +12 -13
  95. package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts.map +1 -1
  96. package/src/engine/physics/cloth/ecs/WorkerClothSystem.js +20 -14
  97. package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts +63 -11
  98. package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts.map +1 -1
  99. package/src/engine/physics/cloth/ecs/cloth_build_rows.js +321 -84
  100. package/src/engine/physics/cloth/ecs/cloth_dynamics_map.d.ts +9 -7
  101. package/src/engine/physics/cloth/ecs/cloth_dynamics_map.d.ts.map +1 -1
  102. package/src/engine/physics/cloth/ecs/cloth_dynamics_map.js +9 -7
  103. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts +3 -3
  104. package/src/engine/physics/cloth/ecs/cloth_gather_colliders.js +30 -30
  105. package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts +37 -0
  106. package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts.map +1 -0
  107. package/src/engine/physics/cloth/ecs/cloth_geodesic.js +142 -0
  108. package/src/engine/physics/cloth/ecs/cloth_holds.d.ts +97 -0
  109. package/src/engine/physics/cloth/ecs/cloth_holds.d.ts.map +1 -0
  110. package/src/engine/physics/cloth/ecs/cloth_holds.js +608 -0
  111. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts +2 -2
  112. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts.map +1 -1
  113. package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.js +160 -9
  114. package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts +17 -22
  115. package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts.map +1 -1
  116. package/src/engine/physics/cloth/ecs/cloth_seed_rig.js +55 -117
  117. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts +21 -6
  118. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts.map +1 -1
  119. package/src/engine/physics/cloth/ecs/cloth_seed_subtree.js +44 -15
  120. package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts +5 -0
  121. package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts.map +1 -1
  122. package/src/engine/physics/cloth/ecs/cloth_write_back.js +60 -16
  123. package/src/engine/physics/cloth/ecs/cloth_write_back_rig.d.ts.map +1 -1
  124. package/src/engine/physics/cloth/ecs/cloth_write_back_rig.js +65 -58
  125. package/src/engine/physics/cloth/playground/collide_main.js +1 -1
  126. package/src/engine/physics/cloth/playground/garment_build.d.ts.map +1 -1
  127. package/src/engine/physics/cloth/playground/garment_build.js +17 -5
  128. package/src/engine/physics/cloth/playground/garment_main.js +1 -1
  129. package/src/engine/physics/cloth/playground/rig_build.d.ts.map +1 -1
  130. package/src/engine/physics/cloth/playground/rig_build.js +302 -296
  131. package/src/engine/physics/cloth/solver/ClothState.d.ts +45 -7
  132. package/src/engine/physics/cloth/solver/ClothState.d.ts.map +1 -1
  133. package/src/engine/physics/cloth/solver/ClothState.js +63 -7
  134. package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts +6 -1
  135. package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts.map +1 -1
  136. package/src/engine/physics/cloth/solver/cloth_contact_find.js +7 -2
  137. package/src/engine/physics/cloth/solver/cloth_hold_line.d.ts +114 -0
  138. package/src/engine/physics/cloth/solver/cloth_hold_line.d.ts.map +1 -0
  139. package/src/engine/physics/cloth/solver/cloth_hold_line.js +362 -0
  140. package/src/engine/physics/cloth/solver/cloth_self_find.d.ts +6 -2
  141. package/src/engine/physics/cloth/solver/cloth_self_find.d.ts.map +1 -1
  142. package/src/engine/physics/cloth/solver/cloth_self_find.js +13 -13
  143. package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts +24 -12
  144. package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts.map +1 -1
  145. package/src/engine/physics/cloth/solver/cloth_solver_constants.js +24 -12
  146. package/src/engine/physics/cloth/solver/cloth_step.d.ts +16 -0
  147. package/src/engine/physics/cloth/solver/cloth_step.d.ts.map +1 -1
  148. package/src/engine/physics/cloth/solver/cloth_step.js +183 -20
  149. package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts +1 -0
  150. package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts.map +1 -1
  151. package/src/engine/physics/cloth/solver/cloth_step_instance.js +10 -3
  152. package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.d.ts +1 -1
  153. package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.d.ts.map +1 -1
  154. package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.js +353 -346
  155. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts +7 -5
  156. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts.map +1 -1
  157. package/src/engine/physics/cloth/solver/constraint/cloth_self_row.js +7 -5
  158. package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts +9 -9
  159. package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts.map +1 -1
  160. package/src/engine/physics/cloth/wind/cloth_sample_air.js +26 -26
  161. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  162. package/src/engine/simulation/Ticker.d.ts +13 -0
  163. package/src/engine/simulation/Ticker.d.ts.map +1 -1
  164. package/src/engine/simulation/Ticker.js +43 -8
  165. package/src/shade/RENDERER_CONTRACT.md +8 -2
  166. package/src/shade/playground/mesh_row_ceiling/main.js +2 -1
  167. package/src/shade/playground/skinned_blas_refit/main.d.ts.map +1 -1
  168. package/src/shade/playground/skinned_blas_refit/main.js +11 -19
  169. package/src/shade/playground/skinned_blas_refit/place_character.d.ts +6 -3
  170. package/src/shade/playground/skinned_blas_refit/place_character.d.ts.map +1 -1
  171. package/src/shade/playground/skinned_blas_refit/place_character.js +90 -90
  172. package/src/shade/playground/skinned_mesh_soup/main.d.ts.map +1 -1
  173. package/src/shade/playground/skinned_mesh_soup/main.js +502 -509
  174. package/src/shade/playground/texture_encode/README.md +129 -109
  175. package/src/shade/playground/texture_encode/main.js +1430 -1430
  176. package/src/shade/renderer/animation/GPUAnimationManager.d.ts +45 -14
  177. package/src/shade/renderer/animation/GPUAnimationManager.d.ts.map +1 -1
  178. package/src/shade/renderer/animation/GPUAnimationManager.js +316 -64
  179. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts +5 -0
  180. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts.map +1 -1
  181. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +11 -1
  182. package/src/shade/renderer/geometry/BoxGeometry.d.ts +1 -11
  183. package/src/shade/renderer/geometry/BoxGeometry.d.ts.map +1 -1
  184. package/src/shade/renderer/geometry/BoxGeometry.js +6 -13
  185. package/src/shade/renderer/geometry/CapsuleGeometry.d.ts +19 -0
  186. package/src/shade/renderer/geometry/CapsuleGeometry.d.ts.map +1 -0
  187. package/src/shade/renderer/geometry/CapsuleGeometry.js +24 -0
  188. package/src/shade/renderer/geometry/ConeGeometry.d.ts +20 -0
  189. package/src/shade/renderer/geometry/ConeGeometry.d.ts.map +1 -0
  190. package/src/shade/renderer/geometry/ConeGeometry.js +33 -0
  191. package/src/shade/renderer/geometry/CylinderGeometry.d.ts +21 -0
  192. package/src/shade/renderer/geometry/CylinderGeometry.d.ts.map +1 -0
  193. package/src/shade/renderer/geometry/CylinderGeometry.js +35 -0
  194. package/src/shade/renderer/geometry/PlaneGeometry.d.ts +17 -0
  195. package/src/shade/renderer/geometry/PlaneGeometry.d.ts.map +1 -0
  196. package/src/shade/renderer/geometry/PlaneGeometry.js +22 -0
  197. package/src/shade/renderer/geometry/TorusGeometry.d.ts +18 -0
  198. package/src/shade/renderer/geometry/TorusGeometry.d.ts.map +1 -0
  199. package/src/shade/renderer/geometry/TorusGeometry.js +23 -0
  200. package/src/shade/renderer/geometry/UVSphereGeometry.d.ts +21 -0
  201. package/src/shade/renderer/geometry/UVSphereGeometry.d.ts.map +1 -0
  202. package/src/shade/renderer/geometry/UVSphereGeometry.js +34 -0
  203. package/src/shade/renderer/geometry/primitives/make_capsule_geometry.d.ts +19 -0
  204. package/src/shade/renderer/geometry/primitives/make_capsule_geometry.d.ts.map +1 -0
  205. package/src/shade/renderer/geometry/primitives/make_capsule_geometry.js +205 -0
  206. package/src/shade/renderer/geometry/primitives/make_cone_geometry.d.ts +21 -0
  207. package/src/shade/renderer/geometry/primitives/make_cone_geometry.d.ts.map +1 -0
  208. package/src/shade/renderer/geometry/primitives/make_cone_geometry.js +36 -0
  209. package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.d.ts +1 -1
  210. package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.d.ts.map +1 -1
  211. package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.js +44 -9
  212. package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.d.ts +20 -0
  213. package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.d.ts.map +1 -0
  214. package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.js +190 -0
  215. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.d.ts.map +1 -1
  216. package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.js +7 -2
  217. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.d.ts +26 -8
  218. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.d.ts.map +1 -1
  219. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.js +56 -39
  220. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.d.ts +7 -0
  221. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.d.ts.map +1 -1
  222. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.js +46 -4
  223. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/test_prefix_sum.d.ts.map +1 -1
  224. package/src/shade/renderer/gpu_primitive/prefix_sum/v1/test_prefix_sum.js +4 -2
  225. package/src/shade/renderer/gpu_primitive/sort/defs.d.ts +2 -2
  226. package/src/shade/renderer/gpu_primitive/sort/defs.js +79 -79
  227. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts +1 -1
  228. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts.map +1 -1
  229. package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.js +7 -3
  230. package/src/shade/renderer/particles/GPUParticleSystem.js +1 -1
  231. package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts +4 -3
  232. package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts.map +1 -1
  233. package/src/shade/renderer/particles/coherence/graph_particle_bucket.js +200 -194
  234. package/src/shade/renderer/particles/graph_particles.d.ts.map +1 -1
  235. package/src/shade/renderer/particles/graph_particles.js +6 -2
  236. package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts.map +1 -1
  237. package/src/shade/renderer/particles/warmup/graph_particle_warmup.js +334 -329
  238. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
  239. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +7 -2
  240. package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.d.ts.map +1 -1
  241. package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.js +16 -4
  242. package/src/shade/renderer/texture/COMPRESSED_TEXTURE_PLAN_2026_09_01.md +2444 -2345
  243. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts.map +1 -1
  244. package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.js +312 -310
  245. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts +3 -3
  246. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts.map +1 -1
  247. package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.js +383 -375
  248. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.d.ts.map +1 -1
  249. package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.js +349 -346
  250. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts +58 -0
  251. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts.map +1 -0
  252. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.js +536 -0
  253. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts +21 -7
  254. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts.map +1 -1
  255. package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.js +291 -327
  256. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.d.ts +25 -0
  257. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.d.ts.map +1 -0
  258. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.js +99 -0
  259. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts +5 -3
  260. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts.map +1 -1
  261. package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.js +47 -71
  262. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.d.ts +10 -0
  263. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.d.ts.map +1 -0
  264. package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.js +50 -0
  265. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts +4 -5
  266. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts.map +1 -1
  267. package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.js +7 -8
  268. package/src/shade/renderer/water/chunk_water_transport.d.ts.map +1 -1
  269. package/src/shade/renderer/water/chunk_water_transport.js +7 -5
  270. package/src/shade/renderer/water/medium/GPUWaterBodies.d.ts.map +1 -1
  271. package/src/shade/renderer/water/medium/GPUWaterBodies.js +8 -2
  272. package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.d.ts +3 -2
  273. package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.d.ts.map +1 -1
  274. package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.js +3 -2
  275. package/src/shade/renderer/water/shader_water.d.ts.map +1 -1
  276. package/src/shade/renderer/water/shader_water.js +3 -1
  277. package/src/shade/renderer/water/surface/GPUWaterSurface.d.ts.map +1 -1
  278. package/src/shade/renderer/water/surface/GPUWaterSurface.js +3 -1
  279. package/src/shade/renderer/water/surface/graph_water_tessellation.d.ts.map +1 -1
  280. package/src/shade/renderer/water/surface/graph_water_tessellation.js +11 -4
  281. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -1
  282. package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +37 -20
  283. package/src/shade/wgsl/validate_wgsl_source.d.ts.map +1 -1
  284. package/src/shade/wgsl/validate_wgsl_source.js +74 -3
  285. package/src/engine/graphics3/register_instance_animation.d.ts +0 -114
  286. package/src/engine/graphics3/register_instance_animation.d.ts.map +0 -1
  287. package/src/engine/graphics3/register_instance_animation.js +0 -201
@@ -1,194 +1,200 @@
1
- import { assert } from "../../../../core/assert.js";
2
- import { align_4 } from "../../../../core/binary/align_4.js";
3
- import { BufferResourceDescriptor } from "../../../device/graph/BufferResourceDescriptor.js";
4
- import { graph_compute_indirect_pass } from "../../shader/graph/compute/graph_compute_indirect_pass.js";
5
- import { graph_compute_pass } from "../../shader/graph/compute/graph_compute_pass.js";
6
- import {
7
- PREFIX_SCAN_CSDLDF_HEADER_WORDS,
8
- } from "../../gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.js";
9
- import { graph_prefix_scan_csdldf } from "../../gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.js";
10
- import { PARTICLE_SIMULATE_WORKGROUP_SIZE } from "../ParticleConstants.js";
11
- import {
12
- shader_particle_bucket_fill,
13
- shader_particle_bucket_histogram,
14
- shader_particle_bucket_pad,
15
- shader_particle_bucket_reset,
16
- shader_particle_bucket_scatter,
17
- } from "./shader_particle_bucket.js";
18
-
19
- const WORD = Uint32Array.BYTES_PER_ELEMENT;
20
-
21
- /**
22
- * @typedef {{keys: number, histogram: number, cursor: number, bucket_counts: number, dispatch_args: number}} ParticleBucketScratch
23
- */
24
-
25
- /**
26
- * Frame-graph wiring for the simulation-order bucketing: turns the frame's freshly compacted alive
27
- * list into the program-coherent, workgroup-padded list NEXT frame's simulate consumes.
28
- *
29
- * Runs at the end of the frame, after emit and simulate have both finished appending to the alive
30
- * list and before the build-indirect pass, which reads the padded length this produces
31
- * ({@link PARTICLE_COUNTER.SIM_PADDED}) and turns it into next frame's dispatch args and bound.
32
- *
33
- * Six passes, the middle one being `graph_prefix_scan_csdldf` reused unchanged — the same scan the
34
- * engine's radix sort runs its spine through. Reusing it is deliberate: it is the one prefix scan
35
- * in this codebase whose only cross-workgroup wait is CSDLDF's own bounded-spin-then-fallback, so
36
- * the pass makes progress on a scheduler that offers no fairness guarantee. A hand-rolled scan here
37
- * would be a second place to get that wrong.
38
- *
39
- * Nothing on this path reads back to the CPU. The only host-supplied number is `bucket_count`, and
40
- * that is static topology — it changes when the emitter set does, never as particles are born and
41
- * die. The per-frame quantities (the alive count, the bin sizes, the padded total) are produced and
42
- * consumed entirely on the GPU, including the dispatch size of the two per-particle passes, which
43
- * the reset pass writes into `sim_dispatch_args` from the GPU's own alive count.
44
- *
45
- * ## The list is the feature's, the scratch is the graph's
46
- *
47
- * `sim_list` is the one thing here that crosses the frame boundary — this frame writes it, next
48
- * frame's simulate reads it — so the feature owns it and hands it in. Everything else (the keys,
49
- * the bins, the cursors, the dispatch args) is produced and consumed inside this call, so the pass
50
- * that first writes each one declares it with a {@link BufferResourceDescriptor} in place of a
51
- * handle, and the graph allocates and releases it around the passes that use it. `keys` is a word
52
- * per particle: at the renderer's default capacity, 2 MiB the feature no longer reserves.
53
- *
54
- * None of them asks for a clear. The reset pass covers the histogram (header, padding and the bins
55
- * up to the whole `vec4` the last one lands in), the cursors and all three dispatch words; `keys`
56
- * is written by the same indirect dispatch that later reads it, and `bucket_counts` by the same
57
- * `bucket_count` threads.
58
- *
59
- * @param {object} params
60
- * @param {import("../../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph} params.graph
61
- * @param {number} params.emitter_database graph handle of the emitter database buffer
62
- * @param {number} params.pool graph handle of the particle pool
63
- * @param {number} params.alive graph handle of this frame's compacted alive list
64
- * @param {number} params.counters graph handle of the atomic counters
65
- * @param {number} params.sim_list graph handle of the list this rewrites. Passed in rather than
66
- * imported here because the simulate pass reads it earlier in the same frame: importing the same
67
- * GPUBuffer twice makes two resource entries the graph cannot see are the same memory, so the read
68
- * and the write end up on separate dependency chains
69
- * @param {number} params.capacity pool capacity in particles — the length of the key list
70
- * @param {number} params.bucket_count number of distinct compiled programs
71
- * @param {ParticleBucketScratch} [params.scratch] latest handles when bucketing again in this graph
72
- * @returns {{counters: number, sim_list: number, dispatch_args: number, scratch: ParticleBucketScratch}} the threaded handles downstream passes must read
73
- */
74
- export function graph_particle_bucket({ graph, emitter_database, pool, alive, counters, sim_list, capacity, bucket_count, scratch }) {
75
- assert.defined(graph, "graph");
76
- assert.isPositiveInteger(capacity, "capacity");
77
- assert.isPositiveInteger(bucket_count, "bucket_count");
78
- assert.isNonNegativeInteger(sim_list, "sim_list");
79
-
80
- // Sized from the bucket count, which only changes when the emitter set does. Aligned up because
81
- // the scan reads whole `vec4`s, so the last bin's tail is part of the buffer.
82
- const bin_words = PREFIX_SCAN_CSDLDF_HEADER_WORDS + align_4(bucket_count);
83
-
84
- // Every buffer a pass WRITES must be THREADED: the write returns a renamed (versioned) handle
85
- // and the next pass must read THAT one. Reading the original handle instead leaves the ordering
86
- // between the two passes unexpressed — the graph's own validator rejects it, because both
87
- // versions name one piece of memory and the stale-looking read silently returns the new
88
- // contents.
89
- // An edit frame buckets twice. The second run is handed the first's handles, so the transients
90
- // are created once and both runs share one dependency chain.
91
- let keys = scratch?.keys ?? BufferResourceDescriptor.from(capacity * WORD, GPUBufferUsage.STORAGE);
92
- let histogram = scratch?.histogram ?? BufferResourceDescriptor.from(bin_words * WORD, GPUBufferUsage.STORAGE);
93
- let cursor = scratch?.cursor ?? BufferResourceDescriptor.from(bucket_count * WORD, GPUBufferUsage.STORAGE);
94
- let bucket_counts = scratch?.bucket_counts ?? BufferResourceDescriptor.from(bucket_count * WORD, GPUBufferUsage.STORAGE);
95
- // Indirect args this pass writes and the two per-particle passes below consume, along with the
96
- // bounds pass — hence INDIRECT on top of STORAGE.
97
- let dispatch_args = scratch?.dispatch_args ?? BufferResourceDescriptor.from(
98
- 3 * WORD,
99
- GPUBufferUsage.STORAGE | GPUBufferUsage.INDIRECT,
100
- );
101
-
102
- // 0. Clear the bins and cursors, write the scan's {count} header, and size the two per-particle
103
- // passes below from the GPU's own alive count.
104
- {
105
- const out = graph_compute_pass({
106
- graph,
107
- shader: shader_particle_bucket_reset,
108
- bindings: { counters, histogram, cursor, sim_dispatch_args: dispatch_args, u_bucket_count: bucket_count },
109
- group_count: [reset_group_count(bucket_count), 1, 1],
110
- });
111
- counters = out.counters;
112
- histogram = out.histogram;
113
- cursor = out.cursor;
114
- dispatch_args = out.sim_dispatch_args;
115
- }
116
-
117
- // 1. One bin per PROGRAM. Indirect, because the thread count is the alive count.
118
- {
119
- const out = graph_compute_indirect_pass({
120
- graph,
121
- shader: shader_particle_bucket_histogram,
122
- bindings: { emitter_database, pool, alive, keys, histogram, counters },
123
- command: dispatch_args,
124
- });
125
- keys = out.keys;
126
- histogram = out.histogram;
127
- counters = out.counters;
128
- }
129
-
130
- // 2. Round every bin up to a whole workgroup BEFORE the scan — that is what puts each bucket
131
- // boundary on a wave boundary rather than in the middle of one.
132
- {
133
- const out = graph_compute_pass({
134
- graph,
135
- shader: shader_particle_bucket_pad,
136
- bindings: { histogram, bucket_counts, u_bucket_count: bucket_count },
137
- group_count: [Math.ceil(bucket_count / PARTICLE_SIMULATE_WORKGROUP_SIZE), 1, 1],
138
- });
139
- histogram = out.histogram;
140
- bucket_counts = out.bucket_counts;
141
- }
142
-
143
- // 3. Inclusive prefix sums of the padded bins, in place.
144
- const scanned = graph_prefix_scan_csdldf({
145
- graph,
146
- data: histogram,
147
- element_max_count: bucket_count,
148
- });
149
-
150
- // 4. Place each alive entry at its bucket's offset plus an atomic rank.
151
- {
152
- const out = graph_compute_indirect_pass({
153
- graph,
154
- shader: shader_particle_bucket_scatter,
155
- bindings: { keys, alive, scanned, cursor, sim_list, counters },
156
- command: dispatch_args,
157
- });
158
- cursor = out.cursor;
159
- sim_list = out.sim_list;
160
- counters = out.counters;
161
- }
162
-
163
- // 5. Stamp the padding sentinel into each bucket's tail and publish the padded total. One
164
- // workgroup per bucket: padding is at most a workgroup less one entry, and a bucket whose
165
- // particles all died has no scatter thread to ride along with.
166
- {
167
- const out = graph_compute_pass({
168
- graph,
169
- shader: shader_particle_bucket_fill,
170
- bindings: { bucket_counts, scanned, sim_list, counters, u_bucket_count: bucket_count },
171
- group_count: [bucket_count, 1, 1],
172
- });
173
- sim_list = out.sim_list;
174
- counters = out.counters;
175
- }
176
-
177
- // `dispatch_args` goes back too: it holds one workgroup per live particle, written from the
178
- // GPU's own alive count, which is the shape every per-particle pass after this one needs.
179
- return { counters, sim_list, dispatch_args, scratch: { keys, histogram: scanned, cursor, bucket_counts, dispatch_args } };
180
- }
181
-
182
- /**
183
- * Workgroups the reset pass needs to cover its widest loop — the scan header plus the bins, rounded
184
- * up to the whole `vec4` the last bin lands in (the scan reads whole `vec4`s, so the tail has to be
185
- * cleared too or garbage joins the sums).
186
- *
187
- * @param {number} bucket_count
188
- * @returns {number}
189
- */
190
- function reset_group_count(bucket_count) {
191
- const words = PREFIX_SCAN_CSDLDF_HEADER_WORDS + align_4(bucket_count);
192
-
193
- return Math.ceil(words / PARTICLE_SIMULATE_WORKGROUP_SIZE);
194
- }
1
+ import { assert } from "../../../../core/assert.js";
2
+ import { align_4 } from "../../../../core/binary/align_4.js";
3
+ import { BufferResourceDescriptor } from "../../../device/graph/BufferResourceDescriptor.js";
4
+ import { graph_compute_indirect_pass } from "../../shader/graph/compute/graph_compute_indirect_pass.js";
5
+ import { graph_compute_pass } from "../../shader/graph/compute/graph_compute_pass.js";
6
+ import {
7
+ PREFIX_SCAN_CSDLDF_HEADER_WORDS,
8
+ } from "../../gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.js";
9
+ import {
10
+ graph_prefix_scan_csdldf,
11
+ prefix_scan_csdldf_output_descriptor
12
+ } from "../../gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.js";
13
+ import { graph_create_buffer } from "../../shader/graph/graph_create_buffer.js";
14
+ import { PARTICLE_SIMULATE_WORKGROUP_SIZE } from "../ParticleConstants.js";
15
+ import {
16
+ shader_particle_bucket_fill,
17
+ shader_particle_bucket_histogram,
18
+ shader_particle_bucket_pad,
19
+ shader_particle_bucket_reset,
20
+ shader_particle_bucket_scatter,
21
+ } from "./shader_particle_bucket.js";
22
+
23
+ const WORD = Uint32Array.BYTES_PER_ELEMENT;
24
+
25
+ /**
26
+ * @typedef {{keys: number, histogram: number, scanned: number, cursor: number, bucket_counts: number, dispatch_args: number}} ParticleBucketScratch
27
+ */
28
+
29
+ /**
30
+ * Frame-graph wiring for the simulation-order bucketing: turns the frame's freshly compacted alive
31
+ * list into the program-coherent, workgroup-padded list NEXT frame's simulate consumes.
32
+ *
33
+ * Runs at the end of the frame, after emit and simulate have both finished appending to the alive
34
+ * list and before the build-indirect pass, which reads the padded length this produces
35
+ * ({@link PARTICLE_COUNTER.SIM_PADDED}) and turns it into next frame's dispatch args and bound.
36
+ *
37
+ * Six passes, the middle one being `graph_prefix_scan_csdldf` reused unchanged — the same scan the
38
+ * engine's radix sort runs its spine through. Reusing it is deliberate: it is the one prefix scan
39
+ * in this codebase whose only cross-workgroup wait is CSDLDF's own bounded-spin-then-fallback, so
40
+ * the pass makes progress on a scheduler that offers no fairness guarantee. A hand-rolled scan here
41
+ * would be a second place to get that wrong.
42
+ *
43
+ * Nothing on this path reads back to the CPU. The only host-supplied number is `bucket_count`, and
44
+ * that is static topology — it changes when the emitter set does, never as particles are born and
45
+ * die. The per-frame quantities (the alive count, the bin sizes, the padded total) are produced and
46
+ * consumed entirely on the GPU, including the dispatch size of the two per-particle passes, which
47
+ * the reset pass writes into `sim_dispatch_args` from the GPU's own alive count.
48
+ *
49
+ * ## The list is the feature's, the scratch is the graph's
50
+ *
51
+ * `sim_list` is the one thing here that crosses the frame boundary — this frame writes it, next
52
+ * frame's simulate reads it — so the feature owns it and hands it in. Everything else (the keys,
53
+ * the bins, the cursors, the dispatch args) is produced and consumed inside this call, so the pass
54
+ * that first writes each one declares it with a {@link BufferResourceDescriptor} in place of a
55
+ * handle, and the graph allocates and releases it around the passes that use it. `keys` is a word
56
+ * per particle: at the renderer's default capacity, 2 MiB the feature no longer reserves.
57
+ *
58
+ * None of them asks for a clear. The reset pass covers the histogram (header, padding and the bins
59
+ * up to the whole `vec4` the last one lands in), the cursors and all three dispatch words; `keys`
60
+ * is written by the same indirect dispatch that later reads it, `bucket_counts` by the same
61
+ * `bucket_count` threads, and the scanned bins, header included, by the scan.
62
+ *
63
+ * @param {object} params
64
+ * @param {import("../../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph} params.graph
65
+ * @param {number} params.emitter_database graph handle of the emitter database buffer
66
+ * @param {number} params.pool graph handle of the particle pool
67
+ * @param {number} params.alive graph handle of this frame's compacted alive list
68
+ * @param {number} params.counters graph handle of the atomic counters
69
+ * @param {number} params.sim_list graph handle of the list this rewrites. Passed in rather than
70
+ * imported here because the simulate pass reads it earlier in the same frame: importing the same
71
+ * GPUBuffer twice makes two resource entries the graph cannot see are the same memory, so the read
72
+ * and the write end up on separate dependency chains
73
+ * @param {number} params.capacity pool capacity in particles — the length of the key list
74
+ * @param {number} params.bucket_count number of distinct compiled programs
75
+ * @param {ParticleBucketScratch} [params.scratch] latest handles when bucketing again in this graph
76
+ * @returns {{counters: number, sim_list: number, dispatch_args: number, scratch: ParticleBucketScratch}} the threaded handles downstream passes must read
77
+ */
78
+ export function graph_particle_bucket({ graph, emitter_database, pool, alive, counters, sim_list, capacity, bucket_count, scratch }) {
79
+ assert.defined(graph, "graph");
80
+ assert.isPositiveInteger(capacity, "capacity");
81
+ assert.isPositiveInteger(bucket_count, "bucket_count");
82
+ assert.isNonNegativeInteger(sim_list, "sim_list");
83
+
84
+ // Sized from the bucket count, which only changes when the emitter set does. Aligned up because
85
+ // the scan reads whole `vec4`s, so the last bin's tail is part of the buffer.
86
+ const bin_words = PREFIX_SCAN_CSDLDF_HEADER_WORDS + align_4(bucket_count);
87
+
88
+ // Every buffer a pass WRITES must be THREADED: the write returns a renamed (versioned) handle
89
+ // and the next pass must read THAT one. Reading the original handle instead leaves the ordering
90
+ // between the two passes unexpressed — the graph's own validator rejects it, because both
91
+ // versions name one piece of memory and the stale-looking read silently returns the new
92
+ // contents.
93
+ // An edit frame buckets twice. The second run is handed the first's handles, so the transients
94
+ // are created once and both runs share one dependency chain.
95
+ let keys = scratch?.keys ?? BufferResourceDescriptor.from(capacity * WORD, GPUBufferUsage.STORAGE);
96
+ let histogram = scratch?.histogram ?? BufferResourceDescriptor.from(bin_words * WORD, GPUBufferUsage.STORAGE);
97
+ let scanned = scratch?.scanned ?? graph_create_buffer(graph, "particles/bucket offsets", prefix_scan_csdldf_output_descriptor(bucket_count));
98
+ let cursor = scratch?.cursor ?? BufferResourceDescriptor.from(bucket_count * WORD, GPUBufferUsage.STORAGE);
99
+ let bucket_counts = scratch?.bucket_counts ?? BufferResourceDescriptor.from(bucket_count * WORD, GPUBufferUsage.STORAGE);
100
+ // Indirect args this pass writes and the two per-particle passes below consume, along with the
101
+ // bounds pass — hence INDIRECT on top of STORAGE.
102
+ let dispatch_args = scratch?.dispatch_args ?? BufferResourceDescriptor.from(
103
+ 3 * WORD,
104
+ GPUBufferUsage.STORAGE | GPUBufferUsage.INDIRECT,
105
+ );
106
+
107
+ // 0. Clear the bins and cursors, write the scan's {count} header, and size the two per-particle
108
+ // passes below from the GPU's own alive count.
109
+ {
110
+ const out = graph_compute_pass({
111
+ graph,
112
+ shader: shader_particle_bucket_reset,
113
+ bindings: { counters, histogram, cursor, sim_dispatch_args: dispatch_args, u_bucket_count: bucket_count },
114
+ group_count: [reset_group_count(bucket_count), 1, 1],
115
+ });
116
+ counters = out.counters;
117
+ histogram = out.histogram;
118
+ cursor = out.cursor;
119
+ dispatch_args = out.sim_dispatch_args;
120
+ }
121
+
122
+ // 1. One bin per PROGRAM. Indirect, because the thread count is the alive count.
123
+ {
124
+ const out = graph_compute_indirect_pass({
125
+ graph,
126
+ shader: shader_particle_bucket_histogram,
127
+ bindings: { emitter_database, pool, alive, keys, histogram, counters },
128
+ command: dispatch_args,
129
+ });
130
+ keys = out.keys;
131
+ histogram = out.histogram;
132
+ counters = out.counters;
133
+ }
134
+
135
+ // 2. Round every bin up to a whole workgroup BEFORE the scan — that is what puts each bucket
136
+ // boundary on a wave boundary rather than in the middle of one.
137
+ {
138
+ const out = graph_compute_pass({
139
+ graph,
140
+ shader: shader_particle_bucket_pad,
141
+ bindings: { histogram, bucket_counts, u_bucket_count: bucket_count },
142
+ group_count: [Math.ceil(bucket_count / PARTICLE_SIMULATE_WORKGROUP_SIZE), 1, 1],
143
+ });
144
+ histogram = out.histogram;
145
+ bucket_counts = out.bucket_counts;
146
+ }
147
+
148
+ // 3. Inclusive prefix sums of the padded bins.
149
+ scanned = graph_prefix_scan_csdldf({
150
+ graph,
151
+ input: histogram,
152
+ output: scanned,
153
+ element_max_count: bucket_count,
154
+ });
155
+
156
+ // 4. Place each alive entry at its bucket's offset plus an atomic rank.
157
+ {
158
+ const out = graph_compute_indirect_pass({
159
+ graph,
160
+ shader: shader_particle_bucket_scatter,
161
+ bindings: { keys, alive, scanned, cursor, sim_list, counters },
162
+ command: dispatch_args,
163
+ });
164
+ cursor = out.cursor;
165
+ sim_list = out.sim_list;
166
+ counters = out.counters;
167
+ }
168
+
169
+ // 5. Stamp the padding sentinel into each bucket's tail and publish the padded total. One
170
+ // workgroup per bucket: padding is at most a workgroup less one entry, and a bucket whose
171
+ // particles all died has no scatter thread to ride along with.
172
+ {
173
+ const out = graph_compute_pass({
174
+ graph,
175
+ shader: shader_particle_bucket_fill,
176
+ bindings: { bucket_counts, scanned, sim_list, counters, u_bucket_count: bucket_count },
177
+ group_count: [bucket_count, 1, 1],
178
+ });
179
+ sim_list = out.sim_list;
180
+ counters = out.counters;
181
+ }
182
+
183
+ // `dispatch_args` goes back too: it holds one workgroup per live particle, written from the
184
+ // GPU's own alive count, which is the shape every per-particle pass after this one needs.
185
+ return { counters, sim_list, dispatch_args, scratch: { keys, histogram, scanned, cursor, bucket_counts, dispatch_args } };
186
+ }
187
+
188
+ /**
189
+ * Workgroups the reset pass needs to cover its widest loop — the scan header plus the bins, rounded
190
+ * up to the whole `vec4` the last bin lands in (the scan reads whole `vec4`s, so the tail has to be
191
+ * cleared too or garbage joins the sums).
192
+ *
193
+ * @param {number} bucket_count
194
+ * @returns {number}
195
+ */
196
+ function reset_group_count(bucket_count) {
197
+ const words = PREFIX_SCAN_CSDLDF_HEADER_WORDS + align_4(bucket_count);
198
+
199
+ return Math.ceil(words / PARTICLE_SIMULATE_WORKGROUP_SIZE);
200
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"graph_particles.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/particles/graph_particles.js"],"names":[],"mappings":"AAuCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AAEH;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH;IA/BkG,KAAK,EAA5F,OAAO,2DAA2D,EAAE,UAAU;IAC/D,MAAM,EAArB,MAAM;IACS,cAAc,EAA7B,MAAM;IACS,GAAG,EAAlB,MAAM;IAGS,QAAQ;QACC,QAAQ,EAAhC,MAAM;QAEkB,WAAW,EAAnC,MAAM;;IACS,QAAQ,EAAvB,MAAM;IACS,YAAY,EAA3B,MAAM;IAEU,cAAc,EAA9B,OAAO;IAGQ,KAAK;QACC,EAAE,EAAvB,MAAM;QACe,IAAI,EAAzB,MAAM;QACe,KAAK,EAA1B,MAAM;QACiB,QAAQ,GAA/B,OAAO;QACc,WAAW,EAAhC,MAAM;QACe,mBAAmB,EAAxC,MAAM;QACe,YAAY,EAAjC,MAAM;QAGe,eAAe,EAApC,MAAM;QAC6D,eAAe,EAAlF,OAAO,6BAA6B,EAAE,cAAc;;IAElD,yBAAyB,CAgUrC;;;;;UAxWa,MAAM;;;;WACN,MAAM;;;;eACN,MAAM;;;;;sBACN,MAAM"}
1
+ {"version":3,"file":"graph_particles.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/particles/graph_particles.js"],"names":[],"mappings":"AA0CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AAEH;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH;IA/BkG,KAAK,EAA5F,OAAO,2DAA2D,EAAE,UAAU;IAC/D,MAAM,EAArB,MAAM;IACS,cAAc,EAA7B,MAAM;IACS,GAAG,EAAlB,MAAM;IAGS,QAAQ;QACC,QAAQ,EAAhC,MAAM;QAEkB,WAAW,EAAnC,MAAM;;IACS,QAAQ,EAAvB,MAAM;IACS,YAAY,EAA3B,MAAM;IAEU,cAAc,EAA9B,OAAO;IAGQ,KAAK;QACC,EAAE,EAAvB,MAAM;QACe,IAAI,EAAzB,MAAM;QACe,KAAK,EAA1B,MAAM;QACiB,QAAQ,GAA/B,OAAO;QACc,WAAW,EAAhC,MAAM;QACe,mBAAmB,EAAxC,MAAM;QACe,YAAY,EAAjC,MAAM;QAGe,eAAe,EAApC,MAAM;QAC6D,eAAe,EAAlF,OAAO,6BAA6B,EAAE,cAAc;;IAElD,yBAAyB,CAiUrC;;;;;UAzWa,MAAM;;;;WACN,MAAM;;;;eACN,MAAM;;;;;sBACN,MAAM"}
@@ -2,7 +2,10 @@ import { assert } from "../../../core/assert.js";
2
2
  import { align_4 } from "../../../core/binary/align_4.js";
3
3
  import { BufferResourceDescriptor } from "../../device/graph/BufferResourceDescriptor.js";
4
4
  import { INDIRECT_COMPUTE_COMMAND_DESCRIPTOR } from "../gpu_primitive/indirect/IndirectComputeCommandBuildPass.js";
5
- import { graph_prefix_scan_csdldf } from "../gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.js";
5
+ import {
6
+ graph_prefix_scan_csdldf,
7
+ prefix_scan_csdldf_output_descriptor
8
+ } from "../gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.js";
6
9
  import { PREFIX_SCAN_CSDLDF_HEADER_WORDS } from "../gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.js";
7
10
  import { shader_prefix_sum_to_command } from "../rasterize/expand/mesh/shader_prefix_sum_to_command.js";
8
11
  import { graph_particle_bounds } from "./bounds/graph_particle_bounds.js";
@@ -287,7 +290,8 @@ export function graph_particles_simulate({
287
290
  // the number of particles born this frame.
288
291
  const spawn_prefix = graph_prefix_scan_csdldf({
289
292
  graph,
290
- data: spawn_counts,
293
+ input: spawn_counts,
294
+ output: graph_create_buffer(graph, "particles/spawn_prefix", prefix_scan_csdldf_output_descriptor(Math.max(1, emitters.capacity))),
291
295
  element_max_count: Math.max(1, emitters.capacity),
292
296
  });
293
297
 
@@ -1 +1 @@
1
- {"version":3,"file":"graph_particle_warmup.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/particles/warmup/graph_particle_warmup.js"],"names":[],"mappings":"AA6BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH;IAtBqG,KAAK,EAA/F,OAAO,8DAA8D,EAAE,UAAU;IAClE,cAAc,EAA7B,MAAM;IACS,gBAAgB,EAA/B,MAAM;IACS,OAAO,EAAtB,MAAM;IACS,IAAI,EAAnB,MAAM;IACS,SAAS,EAAxB,MAAM;IACS,IAAI,EAAnB,MAAM;IACS,QAAQ,EAAvB,MAAM;IACS,YAAY,EAA3B,MAAM;IAEY,KAAK;IACR,WAAW,EAA1B,MAAM;IACS,aAAa,EAA5B,MAAM;IACS,QAAQ,EAAvB,MAAM;IACS,gBAAgB,EAA/B,MAAM;IACgD,QAAQ,EAA9D,OAAO,sBAAsB,EAAE,cAAc;IAC7B,cAAc,EAA9B,OAAO;IACQ,KAAK;QACC,IAAI,EAAzB,MAAM;QACe,KAAK,EAA1B,MAAM;;IACJ;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAC,CAqO7H"}
1
+ {"version":3,"file":"graph_particle_warmup.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/particles/warmup/graph_particle_warmup.js"],"names":[],"mappings":"AAgCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH;IAtBqG,KAAK,EAA/F,OAAO,8DAA8D,EAAE,UAAU;IAClE,cAAc,EAA7B,MAAM;IACS,gBAAgB,EAA/B,MAAM;IACS,OAAO,EAAtB,MAAM;IACS,IAAI,EAAnB,MAAM;IACS,SAAS,EAAxB,MAAM;IACS,IAAI,EAAnB,MAAM;IACS,QAAQ,EAAvB,MAAM;IACS,YAAY,EAA3B,MAAM;IAEY,KAAK;IACR,WAAW,EAA1B,MAAM;IACS,aAAa,EAA5B,MAAM;IACS,QAAQ,EAAvB,MAAM;IACS,gBAAgB,EAA/B,MAAM;IACgD,QAAQ,EAA9D,OAAO,sBAAsB,EAAE,cAAc;IAC7B,cAAc,EAA9B,OAAO;IACQ,KAAK;QACC,IAAI,EAAzB,MAAM;QACe,KAAK,EAA1B,MAAM;;IACJ;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAC,CAuO7H"}