@woosh/meep-engine 3.16.0 → 3.17.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 (410) hide show
  1. package/editor/particles/effect/ParticleEffectDocument.d.ts +21 -6
  2. package/editor/particles/effect/ParticleEffectDocument.d.ts.map +1 -1
  3. package/editor/particles/effect/ParticleEffectDocument.js +38 -17
  4. package/editor/view/node-graph/NodeGraphClipboard.d.ts +186 -0
  5. package/editor/view/node-graph/NodeGraphClipboard.d.ts.map +1 -0
  6. package/editor/view/node-graph/NodeGraphClipboard.js +231 -0
  7. package/editor/view/node-graph/NodeGraphEditorView.d.ts +59 -1
  8. package/editor/view/node-graph/NodeGraphEditorView.d.ts.map +1 -1
  9. package/editor/view/node-graph/NodeGraphEditorView.js +248 -5
  10. package/editor/view/node-graph/NodeGraphView.d.ts.map +1 -1
  11. package/editor/view/node-graph/NodeGraphView.js +84 -8
  12. package/editor/view/node-graph/actions/connection_bind_actions.d.ts +23 -0
  13. package/editor/view/node-graph/actions/connection_bind_actions.d.ts.map +1 -0
  14. package/editor/view/node-graph/actions/connection_bind_actions.js +39 -0
  15. package/editor/view/particles/effect/ParticleCodeEditorView.d.ts.map +1 -1
  16. package/editor/view/particles/effect/ParticleCodeEditorView.js +4 -3
  17. package/editor/view/particles/effect/ParticleCurveEditorView.d.ts +20 -0
  18. package/editor/view/particles/effect/ParticleCurveEditorView.d.ts.map +1 -0
  19. package/editor/view/particles/effect/ParticleCurveEditorView.js +574 -0
  20. package/editor/view/particles/effect/ParticleEmitterInspectorView.d.ts.map +1 -1
  21. package/editor/view/particles/effect/ParticleEmitterInspectorView.js +27 -1
  22. package/editor/view/particles/effect/ParticleGradientEditorView.d.ts +24 -0
  23. package/editor/view/particles/effect/ParticleGradientEditorView.d.ts.map +1 -0
  24. package/editor/view/particles/effect/ParticleGradientEditorView.js +472 -0
  25. package/editor/view/particles/effect/ParticleGraphEditorView.d.ts +5 -0
  26. package/editor/view/particles/effect/ParticleGraphEditorView.d.ts.map +1 -1
  27. package/editor/view/particles/effect/ParticleGraphEditorView.js +61 -31
  28. package/editor/view/particles/effect/ParticleNodeParametersView.d.ts.map +1 -1
  29. package/editor/view/particles/effect/ParticleNodeParametersView.js +33 -0
  30. package/editor/view/particles/effect/particle-editor.css +123 -35
  31. package/package.json +1 -1
  32. package/src/core/binary/allocator/OffsetAllocator.d.ts +25 -16
  33. package/src/core/binary/allocator/OffsetAllocator.d.ts.map +1 -1
  34. package/src/core/binary/allocator/OffsetAllocator.js +10 -1
  35. package/src/core/collection/array/typed/float32_array_hash.d.ts +21 -0
  36. package/src/core/collection/array/typed/float32_array_hash.d.ts.map +1 -0
  37. package/src/core/collection/array/typed/float32_array_hash.js +38 -0
  38. package/src/core/graph/csr/CSRGraph.d.ts +8 -1
  39. package/src/core/graph/csr/CSRGraph.d.ts.map +1 -1
  40. package/src/core/graph/csr/CSRGraph.js +14 -6
  41. package/src/core/model/node-graph/visual/layout/LayoutProblem.d.ts +24 -0
  42. package/src/core/model/node-graph/visual/layout/LayoutProblem.d.ts.map +1 -1
  43. package/src/core/model/node-graph/visual/layout/LayoutProblem.js +27 -0
  44. package/src/core/model/node-graph/visual/layout/NodeGraphLayoutOptions.d.ts +26 -0
  45. package/src/core/model/node-graph/visual/layout/NodeGraphLayoutOptions.d.ts.map +1 -1
  46. package/src/core/model/node-graph/visual/layout/NodeGraphLayoutOptions.js +28 -0
  47. package/src/core/model/node-graph/visual/layout/RouteGrid.d.ts +92 -3
  48. package/src/core/model/node-graph/visual/layout/RouteGrid.d.ts.map +1 -1
  49. package/src/core/model/node-graph/visual/layout/RouteGrid.js +405 -242
  50. package/src/core/model/node-graph/visual/layout/RouteSearch.d.ts +50 -5
  51. package/src/core/model/node-graph/visual/layout/RouteSearch.d.ts.map +1 -1
  52. package/src/core/model/node-graph/visual/layout/RouteSearch.js +160 -24
  53. package/src/core/model/node-graph/visual/layout/RouteSet.d.ts +7 -0
  54. package/src/core/model/node-graph/visual/layout/RouteSet.d.ts.map +1 -1
  55. package/src/core/model/node-graph/visual/layout/RouteSet.js +8 -0
  56. package/src/core/model/node-graph/visual/layout/layout_assign_coordinates.js +9 -3
  57. package/src/core/model/node-graph/visual/layout/layout_build_problem.d.ts.map +1 -1
  58. package/src/core/model/node-graph/visual/layout/layout_build_problem.js +7 -0
  59. package/src/core/model/node-graph/visual/layout/layout_insert_lanes.d.ts +9 -3
  60. package/src/core/model/node-graph/visual/layout/layout_insert_lanes.d.ts.map +1 -1
  61. package/src/core/model/node-graph/visual/layout/layout_insert_lanes.js +17 -3
  62. package/src/core/model/node-graph/visual/layout/layout_node_graph.d.ts +9 -6
  63. package/src/core/model/node-graph/visual/layout/layout_node_graph.d.ts.map +1 -1
  64. package/src/core/model/node-graph/visual/layout/layout_node_graph.js +49 -7
  65. package/src/core/model/node-graph/visual/layout/layout_order_layers.d.ts +11 -1
  66. package/src/core/model/node-graph/visual/layout/layout_order_layers.d.ts.map +1 -1
  67. package/src/core/model/node-graph/visual/layout/layout_order_layers.js +135 -16
  68. package/src/core/model/node-graph/visual/layout/route_connections.d.ts +29 -0
  69. package/src/core/model/node-graph/visual/layout/route_connections.d.ts.map +1 -1
  70. package/src/core/model/node-graph/visual/layout/route_connections.js +716 -309
  71. package/src/core/model/node-graph/visual/layout/route_grid_build.d.ts +3 -2
  72. package/src/core/model/node-graph/visual/layout/route_grid_build.d.ts.map +1 -1
  73. package/src/core/model/node-graph/visual/layout/route_grid_build.js +7 -15
  74. package/src/core/model/node-graph/visual/layout/route_nudge.d.ts +6 -0
  75. package/src/core/model/node-graph/visual/layout/route_nudge.d.ts.map +1 -1
  76. package/src/core/model/node-graph/visual/layout/route_nudge.js +42 -13
  77. package/src/engine/animation/AnimationUtils.js +246 -246
  78. package/src/engine/animation/Animations.js +74 -74
  79. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +2078 -2078
  80. package/src/engine/ecs/EventType.d.ts +0 -1
  81. package/src/engine/ecs/EventType.js +1 -26
  82. package/src/engine/ecs/ik/ik_write_local_rotation.d.ts +1 -1
  83. package/src/engine/ecs/ik/ik_write_local_rotation.d.ts.map +1 -1
  84. package/src/engine/ecs/ik/ik_write_local_rotation.js +3 -7
  85. package/src/engine/ecs/parent/EntityNode.d.ts.map +1 -1
  86. package/src/engine/ecs/parent/EntityNode.js +4 -9
  87. package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.d.ts.map +1 -1
  88. package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.js +360 -364
  89. package/src/engine/ecs/transform/TRANSFORM64_EVENT_CHANGE.d.ts +41 -0
  90. package/src/engine/ecs/transform/TRANSFORM64_EVENT_CHANGE.d.ts.map +1 -0
  91. package/src/engine/ecs/transform/TRANSFORM64_EVENT_CHANGE.js +40 -0
  92. package/src/engine/ecs/transform/TRANSFORM64_MIGRATION_PLAN_2026_09_04.md +8 -0
  93. package/src/engine/ecs/transform/t64_announce_change.d.ts +10 -7
  94. package/src/engine/ecs/transform/t64_announce_change.d.ts.map +1 -1
  95. package/src/engine/ecs/transform/t64_announce_change.js +12 -12
  96. package/src/engine/ecs/transform-attachment/TRANSFORM_ATTACHMENT_EVENT_CHANGE.d.ts +30 -0
  97. package/src/engine/ecs/transform-attachment/TRANSFORM_ATTACHMENT_EVENT_CHANGE.d.ts.map +1 -0
  98. package/src/engine/ecs/transform-attachment/TRANSFORM_ATTACHMENT_EVENT_CHANGE.js +29 -0
  99. package/src/engine/ecs/transform-attachment/TransformAttachmentSystem.d.ts.map +1 -1
  100. package/src/engine/ecs/transform-attachment/TransformAttachmentSystem.js +13 -21
  101. package/src/engine/graphics/ecs/sprite/SpriteSystemPE.d.ts.map +1 -1
  102. package/src/engine/graphics/ecs/sprite/SpriteSystemPE.js +4 -8
  103. package/src/engine/graphics3/LightSystem.d.ts.map +1 -1
  104. package/src/engine/graphics3/LightSystem.js +4 -8
  105. package/src/engine/graphics3/MeshSystem.d.ts.map +1 -1
  106. package/src/engine/graphics3/MeshSystem.js +9 -19
  107. package/src/engine/graphics3/ParticleEmitterSystem.d.ts.map +1 -1
  108. package/src/engine/graphics3/ParticleEmitterSystem.js +4 -8
  109. package/src/engine/graphics3/ShadedGeometrySystem.d.ts.map +1 -1
  110. package/src/engine/graphics3/ShadedGeometrySystem.js +4 -10
  111. package/src/engine/grid/transform2grid/Transform2GridPositionSystem.d.ts +1 -1
  112. package/src/engine/grid/transform2grid/Transform2GridPositionSystem.d.ts.map +1 -1
  113. package/src/engine/grid/transform2grid/Transform2GridPositionSystem.js +4 -8
  114. package/src/engine/intelligence/behavior/ecs/OrbitingBehavior.js +218 -218
  115. package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
  116. package/src/engine/physics/ecs/PhysicsSystem.js +2 -5
  117. package/src/engine/sound/ecs/SoundListenerSystem.d.ts.map +1 -1
  118. package/src/engine/sound/ecs/SoundListenerSystem.js +6 -8
  119. package/src/engine/sound/simulation/ecs/AcousticSimulationSystem.d.ts +0 -4
  120. package/src/engine/sound/simulation/ecs/AcousticSimulationSystem.d.ts.map +1 -1
  121. package/src/engine/sound/simulation/ecs/AcousticSimulationSystem.js +5 -11
  122. package/src/shade/playground/particle_editor/README.md +43 -2
  123. package/src/shade/playground/particle_system/particle_prototype.d.ts.map +1 -1
  124. package/src/shade/playground/particle_system/particle_prototype.js +4 -5
  125. package/src/shade/playground/particle_system/particle_scene.js +4 -4
  126. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  127. package/src/shade/renderer/Renderer.js +13 -1
  128. package/src/shade/renderer/particles/DESIGN.md +104 -19
  129. package/src/shade/renderer/particles/GPUParticleSystem.d.ts +64 -50
  130. package/src/shade/renderer/particles/GPUParticleSystem.d.ts.map +1 -1
  131. package/src/shade/renderer/particles/GPUParticleSystem.js +176 -78
  132. package/src/shade/renderer/particles/ParticleConstants.d.ts +59 -23
  133. package/src/shade/renderer/particles/ParticleConstants.d.ts.map +1 -1
  134. package/src/shade/renderer/particles/ParticleConstants.js +66 -23
  135. package/src/shade/renderer/particles/ParticleRenderMode.d.ts +19 -0
  136. package/src/shade/renderer/particles/ParticleRenderMode.d.ts.map +1 -0
  137. package/src/shade/renderer/particles/ParticleRenderMode.js +33 -0
  138. package/src/shade/renderer/particles/data/PARTICLE_EMITTER_STRUCT.d.ts.map +1 -1
  139. package/src/shade/renderer/particles/data/PARTICLE_EMITTER_STRUCT.js +167 -166
  140. package/src/shade/renderer/particles/data/particle_emitter_record.d.ts +37 -0
  141. package/src/shade/renderer/particles/data/particle_emitter_record.d.ts.map +1 -0
  142. package/src/shade/renderer/particles/data/particle_emitter_record.js +109 -0
  143. package/src/shade/renderer/particles/graph/ParticleGroupBuilder.d.ts +3 -3
  144. package/src/shade/renderer/particles/graph/ParticleGroupBuilder.js +303 -303
  145. package/src/shade/renderer/particles/graph/ParticleNodeDescription.d.ts +18 -0
  146. package/src/shade/renderer/particles/graph/ParticleNodeDescription.d.ts.map +1 -1
  147. package/src/shade/renderer/particles/graph/ParticleNodeDescription.js +152 -133
  148. package/src/shade/renderer/particles/graph/ParticleNodeRegistry.d.ts +0 -11
  149. package/src/shade/renderer/particles/graph/ParticleNodeRegistry.d.ts.map +1 -1
  150. package/src/shade/renderer/particles/graph/ParticleNodeRegistry.js +720 -621
  151. package/src/shade/renderer/particles/graph/compile_particle_graph.d.ts.map +1 -1
  152. package/src/shade/renderer/particles/graph/compile_particle_graph.js +8 -3
  153. package/src/shade/renderer/particles/graph/flatten_particle_graph.d.ts.map +1 -1
  154. package/src/shade/renderer/particles/graph/flatten_particle_graph.js +244 -213
  155. package/src/shade/renderer/particles/graph/groups/particle_builtin_groups.d.ts.map +1 -1
  156. package/src/shade/renderer/particles/graph/groups/particle_builtin_groups.js +6 -0
  157. package/src/shade/renderer/particles/graph/groups/particle_groups_geometry.d.ts.map +1 -1
  158. package/src/shade/renderer/particles/graph/groups/particle_groups_geometry.js +294 -319
  159. package/src/shade/renderer/particles/graph/groups/particle_groups_noise.d.ts.map +1 -1
  160. package/src/shade/renderer/particles/graph/groups/particle_groups_noise.js +524 -517
  161. package/src/shade/renderer/particles/graph/groups/particle_groups_psrdnoise.d.ts +22 -0
  162. package/src/shade/renderer/particles/graph/groups/particle_groups_psrdnoise.d.ts.map +1 -0
  163. package/src/shade/renderer/particles/graph/groups/particle_groups_psrdnoise.js +517 -0
  164. package/src/shade/renderer/particles/graph/groups/simplex_reference.d.ts.map +1 -1
  165. package/src/shade/renderer/particles/graph/groups/simplex_reference.js +185 -159
  166. package/src/shade/renderer/particles/graph/make_particle_group.d.ts.map +1 -1
  167. package/src/shade/renderer/particles/graph/make_particle_group.js +2 -20
  168. package/src/shade/renderer/particles/graph/particle_compare_ops.d.ts +17 -0
  169. package/src/shade/renderer/particles/graph/particle_compare_ops.d.ts.map +1 -0
  170. package/src/shade/renderer/particles/graph/particle_compare_ops.js +22 -0
  171. package/src/shade/renderer/particles/graph/particle_graph_diagnostic.d.ts +28 -8
  172. package/src/shade/renderer/particles/graph/particle_graph_diagnostic.d.ts.map +1 -1
  173. package/src/shade/renderer/particles/graph/particle_graph_diagnostic.js +49 -25
  174. package/src/shade/renderer/particles/graph/particle_node_parameters.d.ts +40 -0
  175. package/src/shade/renderer/particles/graph/particle_node_parameters.d.ts.map +1 -1
  176. package/src/shade/renderer/particles/graph/particle_node_parameters.js +312 -234
  177. package/src/shade/renderer/particles/graph/particle_node_presentation.d.ts.map +1 -1
  178. package/src/shade/renderer/particles/graph/particle_node_presentation.js +59 -3
  179. package/src/shade/renderer/particles/graph/particle_ramp.d.ts +230 -0
  180. package/src/shade/renderer/particles/graph/particle_ramp.d.ts.map +1 -0
  181. package/src/shade/renderer/particles/graph/particle_ramp.js +403 -0
  182. package/src/shade/renderer/particles/graph/validate_particle_graph.d.ts +7 -1
  183. package/src/shade/renderer/particles/graph/validate_particle_graph.d.ts.map +1 -1
  184. package/src/shade/renderer/particles/graph/validate_particle_graph.js +66 -10
  185. package/src/shade/renderer/particles/graph_particles.d.ts +23 -69
  186. package/src/shade/renderer/particles/graph_particles.d.ts.map +1 -1
  187. package/src/shade/renderer/particles/graph_particles.js +105 -262
  188. package/src/shade/renderer/particles/graph_particles_avboit.d.ts.map +1 -1
  189. package/src/shade/renderer/particles/graph_particles_avboit.js +3 -2
  190. package/src/shade/renderer/particles/graph_particles_billboard.d.ts +37 -0
  191. package/src/shade/renderer/particles/graph_particles_billboard.d.ts.map +1 -0
  192. package/src/shade/renderer/particles/graph_particles_billboard.js +93 -0
  193. package/src/shade/renderer/particles/isa/InstructionStream.d.ts +51 -22
  194. package/src/shade/renderer/particles/isa/InstructionStream.d.ts.map +1 -1
  195. package/src/shade/renderer/particles/isa/InstructionStream.js +98 -38
  196. package/src/shade/renderer/particles/isa/ParticleProgram.d.ts +49 -8
  197. package/src/shade/renderer/particles/isa/ParticleProgram.d.ts.map +1 -1
  198. package/src/shade/renderer/particles/isa/ParticleProgram.js +95 -150
  199. package/src/shade/renderer/particles/isa/ParticleVMISA.d.ts +306 -64
  200. package/src/shade/renderer/particles/isa/ParticleVMISA.d.ts.map +1 -1
  201. package/src/shade/renderer/particles/isa/ParticleVMISA.js +505 -136
  202. package/src/shade/renderer/particles/isa/particle_assembly.d.ts +36 -12
  203. package/src/shade/renderer/particles/isa/particle_assembly.d.ts.map +1 -1
  204. package/src/shade/renderer/particles/isa/particle_assembly.js +354 -139
  205. package/src/shade/renderer/particles/isa/validate_particle_program.d.ts +9 -0
  206. package/src/shade/renderer/particles/isa/validate_particle_program.d.ts.map +1 -0
  207. package/src/shade/renderer/particles/isa/validate_particle_program.js +128 -0
  208. package/src/shade/renderer/particles/layout/ParticleLayout.d.ts +23 -0
  209. package/src/shade/renderer/particles/layout/ParticleLayout.d.ts.map +1 -1
  210. package/src/shade/renderer/particles/layout/ParticleLayout.js +68 -0
  211. package/src/shade/renderer/particles/optimizer/dag/optimize_particle_program_vector.d.ts +77 -0
  212. package/src/shade/renderer/particles/optimizer/dag/optimize_particle_program_vector.d.ts.map +1 -0
  213. package/src/shade/renderer/particles/optimizer/dag/optimize_particle_program_vector.js +219 -0
  214. package/src/shade/renderer/particles/optimizer/dag/particle_vector_extract.d.ts +83 -0
  215. package/src/shade/renderer/particles/optimizer/dag/particle_vector_extract.d.ts.map +1 -0
  216. package/src/shade/renderer/particles/optimizer/dag/particle_vector_extract.js +283 -0
  217. package/src/shade/renderer/particles/optimizer/dag/particle_vector_graph.d.ts +133 -0
  218. package/src/shade/renderer/particles/optimizer/dag/particle_vector_graph.d.ts.map +1 -0
  219. package/src/shade/renderer/particles/optimizer/dag/particle_vector_graph.js +334 -0
  220. package/src/shade/renderer/particles/optimizer/dag/particle_vector_groups.d.ts +117 -0
  221. package/src/shade/renderer/particles/optimizer/dag/particle_vector_groups.d.ts.map +1 -0
  222. package/src/shade/renderer/particles/optimizer/dag/particle_vector_groups.js +70 -0
  223. package/src/shade/renderer/particles/optimizer/dag/particle_vector_lift.d.ts +97 -0
  224. package/src/shade/renderer/particles/optimizer/dag/particle_vector_lift.d.ts.map +1 -0
  225. package/src/shade/renderer/particles/optimizer/dag/particle_vector_lift.js +462 -0
  226. package/src/shade/renderer/particles/optimizer/dag/particle_vector_lower.d.ts +116 -0
  227. package/src/shade/renderer/particles/optimizer/dag/particle_vector_lower.d.ts.map +1 -0
  228. package/src/shade/renderer/particles/optimizer/dag/particle_vector_lower.js +687 -0
  229. package/src/shade/renderer/particles/optimizer/dag/particle_vector_pack.d.ts +57 -0
  230. package/src/shade/renderer/particles/optimizer/dag/particle_vector_pack.d.ts.map +1 -0
  231. package/src/shade/renderer/particles/optimizer/dag/particle_vector_pack.js +860 -0
  232. package/src/shade/renderer/particles/optimizer/dag/particle_vector_rules.d.ts +115 -0
  233. package/src/shade/renderer/particles/optimizer/dag/particle_vector_rules.d.ts.map +1 -0
  234. package/src/shade/renderer/particles/optimizer/dag/particle_vector_rules.js +264 -0
  235. package/src/shade/renderer/particles/optimizer/optimize_particle_program.d.ts +81 -42
  236. package/src/shade/renderer/particles/optimizer/optimize_particle_program.d.ts.map +1 -1
  237. package/src/shade/renderer/particles/optimizer/optimize_particle_program.js +477 -478
  238. package/src/shade/renderer/particles/optimizer/particle_integer_bounds.d.ts +100 -0
  239. package/src/shade/renderer/particles/optimizer/particle_integer_bounds.d.ts.map +1 -0
  240. package/src/shade/renderer/particles/optimizer/particle_integer_bounds.js +236 -0
  241. package/src/shade/renderer/particles/optimizer/particle_program_analysis.d.ts +139 -59
  242. package/src/shade/renderer/particles/optimizer/particle_program_analysis.d.ts.map +1 -1
  243. package/src/shade/renderer/particles/optimizer/particle_program_analysis.js +764 -647
  244. package/src/shade/renderer/particles/optimizer/particle_program_equivalence.d.ts +40 -7
  245. package/src/shade/renderer/particles/optimizer/particle_program_equivalence.d.ts.map +1 -1
  246. package/src/shade/renderer/particles/optimizer/particle_program_equivalence.js +376 -213
  247. package/src/shade/renderer/particles/optimizer/particle_program_fuzz.d.ts +30 -3
  248. package/src/shade/renderer/particles/optimizer/particle_program_fuzz.d.ts.map +1 -1
  249. package/src/shade/renderer/particles/optimizer/particle_program_fuzz.js +337 -223
  250. package/src/shade/renderer/particles/optimizer/particle_vm_semantics.d.ts +24 -38
  251. package/src/shade/renderer/particles/optimizer/particle_vm_semantics.d.ts.map +1 -1
  252. package/src/shade/renderer/particles/optimizer/particle_vm_semantics.js +166 -206
  253. package/src/shade/renderer/particles/optimizer/pass_allocate_registers.d.ts +99 -0
  254. package/src/shade/renderer/particles/optimizer/pass_allocate_registers.d.ts.map +1 -0
  255. package/src/shade/renderer/particles/optimizer/pass_allocate_registers.js +313 -0
  256. package/src/shade/renderer/particles/optimizer/pass_dedup_constants.d.ts +3 -2
  257. package/src/shade/renderer/particles/optimizer/pass_dedup_constants.d.ts.map +1 -1
  258. package/src/shade/renderer/particles/optimizer/pass_dedup_constants.js +198 -197
  259. package/src/shade/renderer/particles/optimizer/pass_eliminate_dead_code.d.ts.map +1 -1
  260. package/src/shade/renderer/particles/optimizer/pass_fold_constants.d.ts +19 -0
  261. package/src/shade/renderer/particles/optimizer/pass_fold_constants.d.ts.map +1 -1
  262. package/src/shade/renderer/particles/optimizer/pass_fold_constants.js +678 -561
  263. package/src/shade/renderer/particles/optimizer/pass_inline_constants.d.ts +22 -0
  264. package/src/shade/renderer/particles/optimizer/pass_inline_constants.d.ts.map +1 -0
  265. package/src/shade/renderer/particles/optimizer/pass_inline_constants.js +221 -0
  266. package/src/shade/renderer/particles/optimizer/pass_narrow_widths.d.ts.map +1 -1
  267. package/src/shade/renderer/particles/optimizer/pass_narrow_widths.js +63 -72
  268. package/src/shade/renderer/particles/optimizer/pass_pack_registers.d.ts.map +1 -1
  269. package/src/shade/renderer/particles/optimizer/pass_pack_registers.js +87 -86
  270. package/src/shade/renderer/particles/optimizer/pass_peephole.d.ts.map +1 -1
  271. package/src/shade/renderer/particles/optimizer/pass_peephole.js +392 -271
  272. package/src/shade/renderer/particles/optimizer/pass_propagate_copies.d.ts.map +1 -1
  273. package/src/shade/renderer/particles/optimizer/pass_propagate_copies.js +361 -268
  274. package/src/shade/renderer/particles/optimizer/pass_schedule.d.ts +4 -0
  275. package/src/shade/renderer/particles/optimizer/pass_schedule.d.ts.map +1 -0
  276. package/src/shade/renderer/particles/optimizer/pass_schedule.js +244 -0
  277. package/src/shade/renderer/particles/optimizer/pass_share_subexpressions.d.ts.map +1 -1
  278. package/src/shade/renderer/particles/optimizer/pass_share_subexpressions.js +154 -151
  279. package/src/shade/renderer/particles/particle_test_fixtures.d.ts +20 -0
  280. package/src/shade/renderer/particles/particle_test_fixtures.d.ts.map +1 -1
  281. package/src/shade/renderer/particles/particle_test_fixtures.js +229 -203
  282. package/src/shade/renderer/particles/runtime/EmitterRegistry.d.ts +99 -25
  283. package/src/shade/renderer/particles/runtime/EmitterRegistry.d.ts.map +1 -1
  284. package/src/shade/renderer/particles/runtime/EmitterRegistry.js +438 -286
  285. package/src/shade/renderer/particles/runtime/GPUParticleEmitterContext.d.ts +109 -0
  286. package/src/shade/renderer/particles/runtime/GPUParticleEmitterContext.d.ts.map +1 -0
  287. package/src/shade/renderer/particles/runtime/GPUParticleEmitterContext.js +127 -0
  288. package/src/shade/renderer/particles/runtime/ParticleEmitter.d.ts +87 -102
  289. package/src/shade/renderer/particles/runtime/ParticleEmitter.d.ts.map +1 -1
  290. package/src/shade/renderer/particles/runtime/ParticleEmitter.js +184 -163
  291. package/src/shade/renderer/particles/runtime/ProgramArena.d.ts +26 -0
  292. package/src/shade/renderer/particles/runtime/ProgramArena.d.ts.map +1 -1
  293. package/src/shade/renderer/particles/runtime/ProgramHeap.d.ts +130 -0
  294. package/src/shade/renderer/particles/runtime/ProgramHeap.d.ts.map +1 -0
  295. package/src/shade/renderer/particles/runtime/ProgramHeap.js +595 -0
  296. package/src/shade/renderer/particles/runtime/ProgramPlacement.d.ts +91 -0
  297. package/src/shade/renderer/particles/runtime/ProgramPlacement.d.ts.map +1 -0
  298. package/src/shade/renderer/particles/runtime/ProgramPlacement.js +106 -0
  299. package/src/shade/renderer/particles/runtime/create_particle_effect.d.ts +5 -2
  300. package/src/shade/renderer/particles/runtime/create_particle_effect.d.ts.map +1 -1
  301. package/src/shade/renderer/particles/runtime/create_particle_effect.js +22 -19
  302. package/src/shade/renderer/particles/shaders/chunk_particle_emit_step.d.ts +28 -0
  303. package/src/shade/renderer/particles/shaders/chunk_particle_emit_step.d.ts.map +1 -0
  304. package/src/shade/renderer/particles/shaders/chunk_particle_emit_step.js +136 -0
  305. package/src/shade/renderer/particles/shaders/chunk_particle_simulate_step.d.ts +35 -0
  306. package/src/shade/renderer/particles/shaders/chunk_particle_simulate_step.d.ts.map +1 -0
  307. package/src/shade/renderer/particles/shaders/chunk_particle_simulate_step.js +133 -0
  308. package/src/shade/renderer/particles/shaders/shader_particle_emit.d.ts +18 -9
  309. package/src/shade/renderer/particles/shaders/shader_particle_emit.d.ts.map +1 -1
  310. package/src/shade/renderer/particles/shaders/shader_particle_emit.js +20 -80
  311. package/src/shade/renderer/particles/shaders/shader_particle_emit_wide.d.ts +33 -0
  312. package/src/shade/renderer/particles/shaders/shader_particle_emit_wide.d.ts.map +1 -0
  313. package/src/shade/renderer/particles/shaders/shader_particle_emit_wide.js +114 -0
  314. package/src/shade/renderer/particles/shaders/shader_particle_simulate.d.ts +8 -0
  315. package/src/shade/renderer/particles/shaders/shader_particle_simulate.d.ts.map +1 -1
  316. package/src/shade/renderer/particles/shaders/shader_particle_simulate.js +33 -101
  317. package/src/shade/renderer/particles/shaders/shader_particle_simulate_wide.d.ts +45 -0
  318. package/src/shade/renderer/particles/shaders/shader_particle_simulate_wide.d.ts.map +1 -0
  319. package/src/shade/renderer/particles/shaders/shader_particle_simulate_wide.js +123 -0
  320. package/src/shade/renderer/particles/sort/graph_particle_sort.d.ts +51 -0
  321. package/src/shade/renderer/particles/sort/graph_particle_sort.d.ts.map +1 -0
  322. package/src/shade/renderer/particles/sort/graph_particle_sort.js +120 -0
  323. package/src/shade/renderer/particles/vm/PARTICLE_VM_CONTEXT_STRUCT.d.ts +6 -0
  324. package/src/shade/renderer/particles/vm/PARTICLE_VM_CONTEXT_STRUCT.d.ts.map +1 -0
  325. package/src/shade/renderer/particles/vm/PARTICLE_VM_CONTEXT_STRUCT.js +16 -0
  326. package/src/shade/renderer/particles/vm/ParticleVMReference.d.ts +4 -1
  327. package/src/shade/renderer/particles/vm/ParticleVMReference.d.ts.map +1 -1
  328. package/src/shade/renderer/particles/vm/ParticleVMReference.js +261 -140
  329. package/src/shade/renderer/particles/vm/chunk_particle_vm.d.ts.map +1 -1
  330. package/src/shade/renderer/particles/vm/chunk_particle_vm.js +217 -255
  331. package/src/shade/renderer/particles/vm/chunk_particle_vm_registers_fast.d.ts +43 -0
  332. package/src/shade/renderer/particles/vm/chunk_particle_vm_registers_fast.d.ts.map +1 -0
  333. package/src/shade/renderer/particles/vm/chunk_particle_vm_registers_fast.js +55 -0
  334. package/src/shade/renderer/particles/vm/chunk_particle_vm_registers_wide.d.ts +62 -0
  335. package/src/shade/renderer/particles/vm/chunk_particle_vm_registers_wide.d.ts.map +1 -0
  336. package/src/shade/renderer/particles/vm/chunk_particle_vm_registers_wide.js +86 -0
  337. package/src/shade/renderer/shader/chunk/math/chunk_mod_v3f.d.ts +22 -0
  338. package/src/shade/renderer/shader/chunk/math/chunk_mod_v3f.d.ts.map +1 -0
  339. package/src/shade/renderer/shader/chunk/math/chunk_mod_v3f.js +32 -0
  340. package/src/shade/renderer/shader/chunk/math/chunk_mod_v4f.d.ts +9 -0
  341. package/src/shade/renderer/shader/chunk/math/chunk_mod_v4f.d.ts.map +1 -0
  342. package/src/shade/renderer/shader/chunk/math/chunk_mod_v4f.js +19 -0
  343. package/src/shade/renderer/shader/chunk/noise/psrdnoise/README.md +65 -0
  344. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise2.d.ts +24 -0
  345. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise2.d.ts.map +1 -0
  346. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise2.js +83 -0
  347. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise2_hash.d.ts +25 -0
  348. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise2_hash.d.ts.map +1 -0
  349. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise2_hash.js +42 -0
  350. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise2_kernel.d.ts +31 -0
  351. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise2_kernel.d.ts.map +1 -0
  352. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise2_kernel.js +80 -0
  353. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise3.d.ts +26 -0
  354. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise3.d.ts.map +1 -0
  355. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise3.js +109 -0
  356. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise3_kernel.d.ts +38 -0
  357. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise3_kernel.d.ts.map +1 -0
  358. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise3_kernel.js +129 -0
  359. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise3_permute.d.ts +21 -0
  360. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise3_permute.d.ts.map +1 -0
  361. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise3_permute.js +35 -0
  362. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise3_skew.d.ts +19 -0
  363. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise3_skew.d.ts.map +1 -0
  364. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise3_skew.js +28 -0
  365. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise3_unskew.d.ts +13 -0
  366. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise3_unskew.d.ts.map +1 -0
  367. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_psrdnoise3_unskew.js +22 -0
  368. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_srdnoise2.d.ts +22 -0
  369. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_srdnoise2.d.ts.map +1 -0
  370. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_srdnoise2.js +59 -0
  371. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_srdnoise3.d.ts +23 -0
  372. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_srdnoise3.d.ts.map +1 -0
  373. package/src/shade/renderer/shader/chunk/noise/psrdnoise/chunk_srdnoise3.js +74 -0
  374. package/src/shade/wgsl/emulator/ComputeShaderEmulator.d.ts +34 -1
  375. package/src/shade/wgsl/emulator/ComputeShaderEmulator.d.ts.map +1 -1
  376. package/src/shade/wgsl/emulator/ComputeShaderEmulator.js +41 -1
  377. package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.d.ts +3 -2
  378. package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.d.ts.map +1 -1
  379. package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.js +49 -10
  380. package/src/view/minimap/dom/MinimapCameraView.d.ts.map +1 -1
  381. package/src/view/minimap/dom/MinimapCameraView.js +4 -9
  382. package/src/core/model/node-graph/visual/layout/BoxLayoutSpec.d.ts +0 -15
  383. package/src/core/model/node-graph/visual/layout/BoxLayoutSpec.d.ts.map +0 -1
  384. package/src/core/model/node-graph/visual/layout/ConnectedBoxLayouter.d.ts +0 -45
  385. package/src/core/model/node-graph/visual/layout/ConnectedBoxLayouter.d.ts.map +0 -1
  386. package/src/core/model/node-graph/visual/layout/ConnectionEndpointLayoutSpec.d.ts +0 -24
  387. package/src/core/model/node-graph/visual/layout/ConnectionEndpointLayoutSpec.d.ts.map +0 -1
  388. package/src/core/model/node-graph/visual/layout/ConnectionLayoutSpec.d.ts +0 -19
  389. package/src/core/model/node-graph/visual/layout/ConnectionLayoutSpec.d.ts.map +0 -1
  390. package/src/engine/ecs/transform/__probe.d.ts +0 -4
  391. package/src/engine/ecs/transform/__probe.d.ts.map +0 -1
  392. package/src/engine/ecs/util/hideEntityGracefully.d.ts +0 -9
  393. package/src/engine/ecs/util/hideEntityGracefully.d.ts.map +0 -1
  394. package/src/shade/renderer/buffer/table/gpu_database_emulator_image.d.ts +0 -27
  395. package/src/shade/renderer/buffer/table/gpu_database_emulator_image.d.ts.map +0 -1
  396. package/src/shade/renderer/particles/cull/chunk_particle_cull.d.ts +0 -14
  397. package/src/shade/renderer/particles/cull/chunk_particle_cull.d.ts.map +0 -1
  398. package/src/shade/renderer/particles/data/PARTICLE_EMITTER_LAYOUT.d.ts +0 -156
  399. package/src/shade/renderer/particles/data/PARTICLE_EMITTER_LAYOUT.d.ts.map +0 -1
  400. package/src/shade/renderer/particles/runtime/Emitter.d.ts +0 -219
  401. package/src/shade/renderer/particles/runtime/Emitter.d.ts.map +0 -1
  402. package/src/shade/renderer/particles/runtime/ParticleSpawnScheduler.d.ts +0 -77
  403. package/src/shade/renderer/particles/runtime/ParticleSpawnScheduler.d.ts.map +0 -1
  404. package/src/shade/renderer/particles/runtime/ProgramArena.js +0 -155
  405. package/src/shade/renderer/particles/runtime/emitter_database_image.d.ts +0 -15
  406. package/src/shade/renderer/particles/runtime/emitter_database_image.d.ts.map +0 -1
  407. package/src/shade/renderer/particles/runtime/spawn_request_encoding.d.ts +0 -34
  408. package/src/shade/renderer/particles/runtime/spawn_request_encoding.d.ts.map +0 -1
  409. package/src/shade/renderer/particles/shaders/chunk_particle_context.d.ts +0 -32
  410. package/src/shade/renderer/particles/shaders/chunk_particle_context.d.ts.map +0 -1
@@ -74,24 +74,34 @@ export const PARTICLE_SORT_BUCKET_COUNT = 1024;
74
74
  export const PARTICLE_RECORD_USER_WORD_START = 1;
75
75
 
76
76
  /**
77
- * Size of the VM register file, in `f32` slots. A register IS a slot: a `vec3` value is three
77
+ * Register slots the INSTRUCTION SET can name. A register IS a slot: a `vec3` value is three
78
78
  * consecutive ones, and an instruction's width says how many its operands span.
79
79
  *
80
- * This is the interpreter's single largest cost and it is paid by every program, not just the ones
81
- * that need it: `vm_reg` is a `var<private>` array the VM indexes dynamically, which lands in
82
- * registers rather than scratch, so the file's size sets the shader's register footprint outright.
83
- * Compiled to RDNA2 (gfx1030, wave32), 32 slots cost 47 VGPRs against a 16-wave occupancy cap that
84
- * anything at or below 64 VGPRs reaches. Sixteen `vec4` registers — what this was — cost 81 and
85
- * held the shader to 10 waves.
80
+ * This is an encoding fact, not a shader's budget. A destination is the 8-bit `VM_DST_MASK` field
81
+ * of word 0 and every source base is the 8-bit `VM_OPERAND_BASE_MASK` field of its own word, so 256
82
+ * is exactly what an instruction can address and reaching the ceiling costs nothing. Past it the
83
+ * instruction word would have to grow — there is room (word 0 has bits 11..15 and 22..23 free, and
84
+ * each operand word uses only its low 16) — but nothing needs it yet.
86
85
  *
87
- * Scalar slots are also what makes the number go further than the same count of floats did as
88
- * `vec4`s: eight `vec4` registers hold eight values whatever their width, while 32 slots hold ten
89
- * `vec3`s or 32 scalars. The playground's fire effect, the most involved in the tree, peaks at 11
90
- * slots live.
86
+ * What a *shader* can afford is a different and much smaller number, see
87
+ * {@link PARTICLE_VM_FAST_REGISTER_SLOTS}. The graph compiler allocates against this one, records
88
+ * the peak as the program's `register_count`, and the runtime picks an interpreter from it.
91
89
  *
92
- * A graph that needs more gets a clear error out of `compile_particle_graph.js` rather than silent
93
- * corruption, and the fix for it is to raise this number and re-measure — not to assume the headroom
94
- * was free.
90
+ * @type {number}
91
+ */
92
+ export const PARTICLE_VM_REGISTER_SLOTS = 256;
93
+
94
+ /**
95
+ * Register slots the FAST interpreter's file holds — `vm_reg` in
96
+ * {@link ./vm/chunk_particle_vm_registers_fast.js}, a `var<private>` array the VM indexes
97
+ * dynamically. It lands in registers rather than scratch, so this number is the shader's register
98
+ * footprint outright, and every program pays it rather than only the ones that need it.
99
+ *
100
+ * Compiled to RDNA2 (gfx1030, wave32), 32 slots cost 47 VGPRs; sixteen `vec4` registers — what this
101
+ * was — cost 81 and held the shader to 10 waves against a 16-wave cap that anything at or below 64
102
+ * VGPRs reaches. Scalar slots are also what makes the number go further than the same count of
103
+ * floats did as `vec4`s: eight `vec4` registers hold eight values whatever their width, while 32
104
+ * slots hold ten `vec3`s or 32 scalars.
95
105
  *
96
106
  * ## Why 48 and not 32
97
107
  *
@@ -100,22 +110,55 @@ export const PARTICLE_RECORD_USER_WORD_START = 1;
100
110
  * any of them: measured peaks are 26 for `simplex3`, 33 for `simplex4`, 32 for `curl3` and 40 for
101
111
  * `curl4` — the last with a whole effect's worth of arithmetic still to fit around it.
102
112
  *
103
- * 48 is the largest number that the measurement above says is free. At 32 slots the shader compiled
104
- * to 47 VGPRs, and a slot is about a VGPR, so 48 lands around 63 — still at or under the 64 that
105
- * reaches the 16-wave occupancy cap. **That arithmetic has not been re-measured against a real
106
- * driver.** It is the model the paragraphs above were written from, and it is a model; anyone
107
- * changing this number again, or wanting to be sure of this one, should compile the simulate shader
108
- * offline and read the register count rather than trust it.
113
+ * 48 was picked by extrapolating the 32-slot measurement: a slot is about a VGPR, so 48 should land
114
+ * near 63, at or under the 64 that reaches the occupancy cap. **That extrapolation was wrong.** The
115
+ * measured table in {@link ./vm/chunk_particle_vm.js} puts this interpreter at 80 VGPRs on a 48-slot
116
+ * file, well past the cap it was sized to stay under. The number stays because it is measured and
117
+ * shipped, not because the model that chose it holds; anyone moving it should compile the simulate
118
+ * shader offline and read the register count rather than extrapolate again.
119
+ *
120
+ * ## What happens above it
121
+ *
122
+ * Nothing fails. A program whose `register_count` exceeds this is one the fast file cannot hold, and
123
+ * the system falls back to the wide interpreter for the frame — every program, not only the one that
124
+ * overflowed. That is the library declining to have an authoring ceiling, at the price of an
125
+ * interpreter that keeps its registers in storage. See {@link PARTICLE_VM_WIDE_LAUNCH_LANES} and
126
+ * {@link ./vm/chunk_particle_vm_registers_wide.js}.
109
127
  *
110
128
  * @type {number}
111
129
  */
112
- export const PARTICLE_VM_REGISTER_SLOTS = 48;
130
+ export const PARTICLE_VM_FAST_REGISTER_SLOTS = 48;
113
131
 
114
132
  /**
115
- * Number of `u32` words per VM instruction: `[op, dst, s0, s1, s2]`.
133
+ * Invocations the wide-register simulate and emit passes launch, whatever the particle count.
134
+ *
135
+ * The wide interpreter keeps its register file in a storage buffer, so it needs one file per
136
+ * *invocation in flight*. One lane per particle would size that buffer by pool capacity — a million
137
+ * particles would want a gigabyte — so the wide passes do not run one lane per particle. They launch
138
+ * this many lanes and walk their input with a grid-stride loop, which caps the file count at a
139
+ * constant chosen here instead of at whatever the pool holds.
140
+ *
141
+ * The buffer is `PARTICLE_VM_WIDE_LAUNCH_LANES * PARTICLE_VM_REGISTER_SLOTS * 4` bytes — 8 MiB at
142
+ * these values. It is transient: never cleared, never read back, and shared by the emit and simulate
143
+ * passes, which cannot overlap. See {@link ./vm/chunk_particle_vm_registers_wide.js} for why not
144
+ * clearing it is safe.
145
+ *
146
+ * Must be a multiple of {@link PARTICLE_SIMULATE_WORKGROUP_SIZE}, and of
147
+ * {@link PARTICLE_EMIT_WORKGROUP_SIZE}. The grid stride IS this number, so every iteration has to
148
+ * cover a workgroup-aligned span of the coherence pass's list; a misaligned stride would put two
149
+ * programs in one wave and the wave-uniform section decode would then run one program's code over
150
+ * the other's particles.
151
+ *
116
152
  * @type {number}
117
153
  */
118
- export const PARTICLE_VM_INSTRUCTION_WORDS = 5;
154
+ export const PARTICLE_VM_WIDE_LAUNCH_LANES = 8192;
155
+
156
+ /**
157
+ * Number of `u32` words per VM instruction. An ISA fact, defined with the encoding it describes and
158
+ * re-exported here so the runtime, the shaders and the tests read every build-time number from one
159
+ * module.
160
+ */
161
+ export { PARTICLE_VM_INSTRUCTION_WORDS } from "./isa/ParticleVMISA.js";
119
162
 
120
163
  /**
121
164
  * Hard cap on instructions executed by a single VM program invocation. A safety bound so a malformed
@@ -0,0 +1,19 @@
1
+ /**
2
+ * How the frame's particles are drawn — the one thing {@link GPUParticleSystemexecute } branches on
3
+ * once the simulation has run.
4
+ *
5
+ * The simulation half is identical either way; the modes differ in whether anything downstream
6
+ * cares what ORDER the particles arrive in. Blending billboards over a colour target does —
7
+ * premultiplied transparency is order-dependent, so the draw list has to be back-to-front. AVBOIT's
8
+ * voxel volume and its accumulators do not: every contribution is a sum, and a sum has no order.
9
+ *
10
+ * That is why the depth sort is a property of the mode rather than of the simulation. It is four
11
+ * passes and a scan over every live particle, plus two lists a word per particle each, and under
12
+ * AVBOIT none of it changes a pixel.
13
+ */
14
+ export type ParticleRenderMode = number;
15
+ export namespace ParticleRenderMode {
16
+ let BILLBOARD: number;
17
+ let AVBOIT: number;
18
+ }
19
+ //# sourceMappingURL=ParticleRenderMode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParticleRenderMode.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/particles/ParticleRenderMode.js"],"names":[],"mappings":";;;;;;;;;;;;;iCAaU,MAAM"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * How the frame's particles are drawn — the one thing {@link GPUParticleSystem#execute} branches on
3
+ * once the simulation has run.
4
+ *
5
+ * The simulation half is identical either way; the modes differ in whether anything downstream
6
+ * cares what ORDER the particles arrive in. Blending billboards over a colour target does —
7
+ * premultiplied transparency is order-dependent, so the draw list has to be back-to-front. AVBOIT's
8
+ * voxel volume and its accumulators do not: every contribution is a sum, and a sum has no order.
9
+ *
10
+ * That is why the depth sort is a property of the mode rather than of the simulation. It is four
11
+ * passes and a scan over every live particle, plus two lists a word per particle each, and under
12
+ * AVBOIT none of it changes a pixel.
13
+ *
14
+ * @enum {number}
15
+ */
16
+ export const ParticleRenderMode = {
17
+ /**
18
+ * Standalone: depth-sort the alive list back-to-front and draw it as billboards straight over a
19
+ * colour target with fixed-function blending. `color` and `depth` are required.
20
+ *
21
+ * For a page with no transparency pipeline of its own. See `graph_particles_billboard.js`.
22
+ */
23
+ BILLBOARD: 0,
24
+ /**
25
+ * Under the renderer: the AVBOIT transparency orchestrator draws the particles later in the
26
+ * frame, through the side-channel calls (`graph_particles_avboit.js`), off the same alive list
27
+ * and the same GPU-written draw args.
28
+ *
29
+ * Order-independent, so {@link GPUParticleSystem#execute} records no sort and no draw, allocates
30
+ * no sort buffers, and hands the colour target back untouched.
31
+ */
32
+ AVBOIT: 1,
33
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"PARTICLE_EMITTER_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/particles/data/PARTICLE_EMITTER_STRUCT.js"],"names":[],"mappings":"AAkIA;;;;;;;;;;GAUG;AACH;IAR6B,QAAQ,GAA1B,OAAO;IACW,UAAU,GAA5B,OAAO;IACW,IAAI,GAAtB,OAAO;IACW,IAAI,GAAtB,OAAO;IACU,KAAK,GAAtB,MAAM;IACW,UAAU,GAA3B,MAAM;IACJ,MAAM,CAWlB;AAED,6DAA6D;AAC7D,2CADY,MAAM,GAAkB,MAAM,CAGzC;AAED,kEAAkE;AAClE,gDADY,MAAM,GAAkB,MAAM,CAGzC;AA7JD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,sCAFU,YAAY,CAmEO;AAE7B,uDAAuD;AACvD,kDAAmD;AAEnD;;GAEG;AACH;;;;;GAKG;AAEH,kGAAkG;AAClG;;;;GAIG;AAKH,kEAAkE;AAClE;;;;;;GAMG;AAqCH,uEAAuE;AACvE;;;;;GAEG;6BApK0B,mCAAmC"}
1
+ {"version":3,"file":"PARTICLE_EMITTER_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/particles/data/PARTICLE_EMITTER_STRUCT.js"],"names":[],"mappings":"AAmIA;;;;;;;;;;GAUG;AACH;IAR6B,QAAQ,GAA1B,OAAO;IACW,UAAU,GAA5B,OAAO;IACW,IAAI,GAAtB,OAAO;IACW,IAAI,GAAtB,OAAO;IACU,KAAK,GAAtB,MAAM;IACW,UAAU,GAA3B,MAAM;IACJ,MAAM,CAWlB;AAED,6DAA6D;AAC7D,2CADY,MAAM,GAAkB,MAAM,CAGzC;AAED,kEAAkE;AAClE,gDADY,MAAM,GAAkB,MAAM,CAGzC;AA9JD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,sCAFU,YAAY,CAoEO;AAE7B,uDAAuD;AACvD,kDAAmD;AAEnD;;GAEG;AACH;;;;;GAKG;AAEH,kGAAkG;AAClG;;;;GAIG;AAKH,kEAAkE;AAClE;;;;;;GAMG;AAqCH,uEAAuE;AACvE;;;;;GAEG;6BArK0B,mCAAmC"}
@@ -1,166 +1,167 @@
1
- import { f32, u32, vec2f, vec3f, vec4f } from "../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
2
- import { WebGPUStruct } from "../../shader/type/WebGPUStruct.js";
3
-
4
- /**
5
- * One emitter's GPU record: which compiled program it runs and where that program's code and
6
- * constants sit in the {@link ../runtime/ProgramArena.js} buffers, plus the instance parameters the
7
- * tick / emit / simulate / sort / render passes read — the scene node it hangs off, spawn rate,
8
- * feature flags, bounds sphere, render-attribute bindings, atlas region and flipbook grid.
9
- *
10
- * There is no transform here. An emitter is a scene node, and its world matrix is the `global` of
11
- * its row in the scene database's `transforms` table, composed on the GPU by the hierarchy pass
12
- * from whatever the node is parented to. The passes that need it read it through `node`.
13
- *
14
- * Nor is there any per-frame state: what the GPU integrates for an emitter (spawn accumulator, age,
15
- * sleep) lives in {@link ./PARTICLE_EMITTER_STATE.js}, keyed by the same row, for the reason given
16
- * there.
17
- *
18
- * It lives in a `GPUDatabase` table (see {@link ./PARTICLE_DATABASE_SPEC.js}), so the layout below
19
- * is the *only* description of it that exists: the JS writer is
20
- * {@link ../../shader/type/serde/write_gpu_typed_buffer.js} and the WGSL reader is generated from
21
- * this same struct by the table descriptor. Nothing hand-packs an emitter word by word any more,
22
- * and there is no second copy of the offsets to keep in step.
23
- *
24
- * `.pack()` reorders the fields to close the padding a declaration-order layout would leave; WGSL
25
- * field names are what shaders address, never offsets, so the reordering is invisible to them.
26
- *
27
- * @type {WebGPUStruct}
28
- */
29
- export const PARTICLE_EMITTER_STRUCT = WebGPUStruct.from({
30
- /** first instruction of the INIT program, in instruction units */
31
- init_offset: u32,
32
- /** INIT instruction count */
33
- init_count: u32,
34
- /** first instruction of the UPDATE program, in instruction units */
35
- update_offset: u32,
36
- /** UPDATE instruction count */
37
- update_count: u32,
38
- /** base into the shared constant pool, in vec4 units */
39
- constant_offset: u32,
40
- /** base RNG seed */
41
- seed: u32,
42
- /** see {@link EMITTER_FLAG} */
43
- flags: u32,
44
- /** continuous emission rate, particles/second, integrated on the GPU by the tick pass */
45
- spawn_rate: f32,
46
-
47
- /**
48
- * Row of the scene database's `transforms` table this emitter is — its world matrix is that
49
- * row's `global`.
50
- */
51
- node: u32,
52
-
53
- /**
54
- * Which tenancy of this row the record describes. Bumped every time the row is handed to a new
55
- * emitter, never zero for a live row. Every particle carries the generation of the emitter that
56
- * spawned it, and the simulate pass kills one whose generation no longer matches its row's —
57
- * see {@link ./particle_header.js}.
58
- */
59
- generation: u32,
60
-
61
- /** local-space bounding sphere centre */
62
- bounds_center: vec3f,
63
- /** bounding sphere radius */
64
- bounds_radius: f32,
65
-
66
- /** attribute word offset of world position (or {@link EMITTER_ATTRIBUTE_ABSENT}) */
67
- render_position: u32,
68
- /** attribute word offset of size */
69
- render_size: u32,
70
- /** attribute word offset of rgba colour */
71
- render_color: u32,
72
- /** attribute word offset of roll angle, radians */
73
- render_rotation: u32,
74
- /** attribute word offset of flipbook frame index */
75
- render_frame: u32,
76
- /** attribute word offset of velocity (STRETCHED projection) */
77
- render_velocity: u32,
78
-
79
- /** uv offset .xy + uv scale .zw */
80
- atlas_region: vec4f,
81
- /** flipbook grid: columns, rows */
82
- flipbook: vec2f,
83
-
84
- /**
85
- * Dense id of the compiled program this emitter runs, assigned by
86
- * {@link ../runtime/ProgramArena.js}. Emitters sharing a program share an id.
87
- *
88
- * The simulation-order bucketing (`coherence/`) histograms on this: it needs a small dense
89
- * integer to index a bin with, which neither the emitter id (one bucket per emitter, even when
90
- * they run the same code) nor `update_offset` (an arena offset, arbitrarily large and sparse)
91
- * gives it.
92
- */
93
- program_id: u32,
94
- }, "ParticleEmitter").pack();
95
-
96
- /** Sentinel for an absent render-attribute binding. */
97
- export const EMITTER_ATTRIBUTE_ABSENT = 0xffffffff;
98
-
99
- /**
100
- * Emitter flag bits. Blend mode occupies bits [4,6), projection mode bits [6,9).
101
- */
102
- export const EMITTER_FLAG = Object.freeze({
103
- LIGHTING: 1 << 0, // forward-shade billboards with scene lighting
104
- SOFT_DEPTH: 1 << 1, // fade against scene depth
105
- SORT: 1 << 2, // depth-sort this emitter's particles for correct transparency
106
- CULL: 1 << 3, // frustum + occlusion simulation culling (sleep when culled)
107
- });
108
-
109
- /** Blend modes (stored in flag bits [4,6)). All expressed by one premultiplied blend pipeline. */
110
- export const EMITTER_BLEND = Object.freeze({
111
- ALPHA: 0, // premultiplied alpha (normal transparency)
112
- ADDITIVE: 1, // additive (emissive glow)
113
- PREMULTIPLIED: 2, // colour already premultiplied by alpha upstream
114
- });
115
-
116
- const BLEND_SHIFT = 4;
117
- const BLEND_MASK = 0b11 << BLEND_SHIFT;
118
-
119
- /** Projection / orientation modes (stored in flag bits [6,9)). */
120
- export const EMITTER_PROJECTION = Object.freeze({
121
- BILLBOARD: 0, // face the camera
122
- STRETCHED: 1, // billboard stretched along velocity
123
- HORIZONTAL: 2, // lie flat on the ground plane (XZ)
124
- VERTICAL: 3, // axis-locked to world up, yaw toward camera
125
- FACING_WORLD: 4, // oriented by the particle's own rotation attribute in world space
126
- });
127
-
128
- const PROJECTION_SHIFT = 6;
129
- const PROJECTION_MASK = 0b111 << PROJECTION_SHIFT;
130
-
131
- /**
132
- * Compose the flags word from feature toggles + blend + projection.
133
- * @param {object} options
134
- * @param {boolean} [options.lighting]
135
- * @param {boolean} [options.soft_depth]
136
- * @param {boolean} [options.sort]
137
- * @param {boolean} [options.cull]
138
- * @param {number} [options.blend] see {@link EMITTER_BLEND}
139
- * @param {number} [options.projection] see {@link EMITTER_PROJECTION}
140
- * @returns {number}
141
- */
142
- export function make_emitter_flags({ lighting = false, soft_depth = false, sort = false, cull = false, blend = EMITTER_BLEND.ALPHA, projection = EMITTER_PROJECTION.BILLBOARD } = {}) {
143
- let flags = 0;
144
- if (lighting) flags |= EMITTER_FLAG.LIGHTING;
145
- if (soft_depth) flags |= EMITTER_FLAG.SOFT_DEPTH;
146
- if (sort) flags |= EMITTER_FLAG.SORT;
147
- if (cull) flags |= EMITTER_FLAG.CULL;
148
- flags |= (blend << BLEND_SHIFT) & BLEND_MASK;
149
- flags |= (projection << PROJECTION_SHIFT) & PROJECTION_MASK;
150
- return flags >>> 0;
151
- }
152
-
153
- /** @param {number} flags @returns {number} the blend mode */
154
- export function emitter_flags_blend(flags) {
155
- return (flags & BLEND_MASK) >>> BLEND_SHIFT;
156
- }
157
-
158
- /** @param {number} flags @returns {number} the projection mode */
159
- export function emitter_flags_projection(flags) {
160
- return (flags & PROJECTION_MASK) >>> PROJECTION_SHIFT;
161
- }
162
-
163
- /** Shift/mask constants exposed for the WGSL reader to interpolate. */
164
- export const EMITTER_FLAG_ENCODING = Object.freeze({
165
- BLEND_SHIFT, BLEND_MASK, PROJECTION_SHIFT, PROJECTION_MASK,
166
- });
1
+ import { f32, u32, vec2f, vec3f, vec4f } from "../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
2
+ import { WebGPUStruct } from "../../shader/type/WebGPUStruct.js";
3
+
4
+ /**
5
+ * One emitter's GPU record: which compiled program it runs and where that program's code and
6
+ * constants sit in the {@link ../runtime/ProgramArena.js} buffers, plus the instance parameters the
7
+ * tick / emit / simulate / sort / render passes read — the scene node it hangs off, spawn rate,
8
+ * feature flags, bounds sphere, render-attribute bindings, atlas region and flipbook grid.
9
+ *
10
+ * There is no transform here. An emitter is a scene node, and its world matrix is the `global` of
11
+ * its row in the scene database's `transforms` table, composed on the GPU by the hierarchy pass
12
+ * from whatever the node is parented to. The passes that need it read it through `node`.
13
+ *
14
+ * Nor is there any per-frame state: what the GPU integrates for an emitter (spawn accumulator, age,
15
+ * sleep) lives in {@link ./PARTICLE_EMITTER_STATE.js}, keyed by the same row, for the reason given
16
+ * there.
17
+ *
18
+ * It lives in a `GPUDatabase` table (see {@link ./PARTICLE_DATABASE_SPEC.js}), so the layout below
19
+ * is the *only* description of it that exists: the JS writer is
20
+ * {@link ../../shader/type/serde/write_gpu_typed_buffer.js} and the WGSL reader is generated from
21
+ * this same struct by the table descriptor. Nothing hand-packs an emitter word by word any more,
22
+ * and there is no second copy of the offsets to keep in step.
23
+ *
24
+ * `.pack()` reorders the fields to close the padding a declaration-order layout would leave; WGSL
25
+ * field names are what shaders address, never offsets, so the reordering is invisible to them.
26
+ *
27
+ * @type {WebGPUStruct}
28
+ */
29
+ export const PARTICLE_EMITTER_STRUCT = WebGPUStruct.from({
30
+ /** first instruction of the INIT program, in instruction units */
31
+ init_offset: u32,
32
+ /** INIT instruction count */
33
+ init_count: u32,
34
+ /** first instruction of the UPDATE program, in instruction units */
35
+ update_offset: u32,
36
+ /** UPDATE instruction count */
37
+ update_count: u32,
38
+ /** base into the shared constant pool, in vec4 units */
39
+ constant_offset: u32,
40
+ /** base RNG seed */
41
+ seed: u32,
42
+ /** see {@link EMITTER_FLAG} */
43
+ flags: u32,
44
+ /** continuous emission rate, particles/second, integrated on the GPU by the tick pass */
45
+ spawn_rate: f32,
46
+
47
+ /**
48
+ * Row of the scene database's `transforms` table this emitter is — its world matrix is that
49
+ * row's `global`.
50
+ */
51
+ node: u32,
52
+
53
+ /**
54
+ * Which tenancy of this row the record describes. Bumped every time the row is handed to a new
55
+ * emitter, never zero for a live row. Every particle carries the generation of the emitter that
56
+ * spawned it, and the simulate pass kills one whose generation no longer matches its row's —
57
+ * see {@link ./particle_header.js}.
58
+ */
59
+ generation: u32,
60
+
61
+ /** local-space bounding sphere centre */
62
+ bounds_center: vec3f,
63
+ /** bounding sphere radius */
64
+ bounds_radius: f32,
65
+
66
+ /** attribute word offset of world position (or {@link EMITTER_ATTRIBUTE_ABSENT}) */
67
+ render_position: u32,
68
+ /** attribute word offset of size */
69
+ render_size: u32,
70
+ /** attribute word offset of rgba colour */
71
+ render_color: u32,
72
+ /** attribute word offset of roll angle, radians */
73
+ render_rotation: u32,
74
+ /** attribute word offset of flipbook frame index */
75
+ render_frame: u32,
76
+ /** attribute word offset of velocity (STRETCHED projection) */
77
+ render_velocity: u32,
78
+
79
+ /** uv offset .xy + uv scale .zw */
80
+ atlas_region: vec4f,
81
+ /** flipbook grid: columns, rows */
82
+ flipbook: vec2f,
83
+
84
+ /**
85
+ * Id of the compiled program this emitter runs, assigned by {@link ../runtime/ProgramHeap.js}.
86
+ * Emitters sharing a program share an id.
87
+ *
88
+ * The simulation-order bucketing (`coherence/`) histograms on this: it needs a small integer to
89
+ * index a bin with, which neither the emitter id (one bucket per emitter, even when they run the
90
+ * same code) nor `update_offset` (a heap offset, arbitrarily large and sparse) gives it. Ids are
91
+ * reused as effects come and go, so they stay below the set's peak program count rather than
92
+ * climbing with churn.
93
+ */
94
+ program_id: u32,
95
+ }, "ParticleEmitter").pack();
96
+
97
+ /** Sentinel for an absent render-attribute binding. */
98
+ export const EMITTER_ATTRIBUTE_ABSENT = 0xffffffff;
99
+
100
+ /**
101
+ * Emitter flag bits. Blend mode occupies bits [4,6), projection mode bits [6,9).
102
+ */
103
+ export const EMITTER_FLAG = Object.freeze({
104
+ LIGHTING: 1 << 0, // forward-shade billboards with scene lighting
105
+ SOFT_DEPTH: 1 << 1, // fade against scene depth
106
+ SORT: 1 << 2, // depth-sort this emitter's particles for correct transparency
107
+ CULL: 1 << 3, // frustum + occlusion simulation culling (sleep when culled)
108
+ });
109
+
110
+ /** Blend modes (stored in flag bits [4,6)). All expressed by one premultiplied blend pipeline. */
111
+ export const EMITTER_BLEND = Object.freeze({
112
+ ALPHA: 0, // premultiplied alpha (normal transparency)
113
+ ADDITIVE: 1, // additive (emissive glow)
114
+ PREMULTIPLIED: 2, // colour already premultiplied by alpha upstream
115
+ });
116
+
117
+ const BLEND_SHIFT = 4;
118
+ const BLEND_MASK = 0b11 << BLEND_SHIFT;
119
+
120
+ /** Projection / orientation modes (stored in flag bits [6,9)). */
121
+ export const EMITTER_PROJECTION = Object.freeze({
122
+ BILLBOARD: 0, // face the camera
123
+ STRETCHED: 1, // billboard stretched along velocity
124
+ HORIZONTAL: 2, // lie flat on the ground plane (XZ)
125
+ VERTICAL: 3, // axis-locked to world up, yaw toward camera
126
+ FACING_WORLD: 4, // oriented by the particle's own rotation attribute in world space
127
+ });
128
+
129
+ const PROJECTION_SHIFT = 6;
130
+ const PROJECTION_MASK = 0b111 << PROJECTION_SHIFT;
131
+
132
+ /**
133
+ * Compose the flags word from feature toggles + blend + projection.
134
+ * @param {object} options
135
+ * @param {boolean} [options.lighting]
136
+ * @param {boolean} [options.soft_depth]
137
+ * @param {boolean} [options.sort]
138
+ * @param {boolean} [options.cull]
139
+ * @param {number} [options.blend] see {@link EMITTER_BLEND}
140
+ * @param {number} [options.projection] see {@link EMITTER_PROJECTION}
141
+ * @returns {number}
142
+ */
143
+ export function make_emitter_flags({ lighting = false, soft_depth = false, sort = false, cull = false, blend = EMITTER_BLEND.ALPHA, projection = EMITTER_PROJECTION.BILLBOARD } = {}) {
144
+ let flags = 0;
145
+ if (lighting) flags |= EMITTER_FLAG.LIGHTING;
146
+ if (soft_depth) flags |= EMITTER_FLAG.SOFT_DEPTH;
147
+ if (sort) flags |= EMITTER_FLAG.SORT;
148
+ if (cull) flags |= EMITTER_FLAG.CULL;
149
+ flags |= (blend << BLEND_SHIFT) & BLEND_MASK;
150
+ flags |= (projection << PROJECTION_SHIFT) & PROJECTION_MASK;
151
+ return flags >>> 0;
152
+ }
153
+
154
+ /** @param {number} flags @returns {number} the blend mode */
155
+ export function emitter_flags_blend(flags) {
156
+ return (flags & BLEND_MASK) >>> BLEND_SHIFT;
157
+ }
158
+
159
+ /** @param {number} flags @returns {number} the projection mode */
160
+ export function emitter_flags_projection(flags) {
161
+ return (flags & PROJECTION_MASK) >>> PROJECTION_SHIFT;
162
+ }
163
+
164
+ /** Shift/mask constants exposed for the WGSL reader to interpolate. */
165
+ export const EMITTER_FLAG_ENCODING = Object.freeze({
166
+ BLEND_SHIFT, BLEND_MASK, PROJECTION_SHIFT, PROJECTION_MASK,
167
+ });
@@ -0,0 +1,37 @@
1
+ /**
2
+ * The translation between an emitter and the row the GPU reads for it: one function that fills a
3
+ * {@link ./PARTICLE_EMITTER_STRUCT.js} record from a {@link ../runtime/ParticleEmitter.js} and the
4
+ * {@link ../runtime/GPUParticleEmitterContext.js} the registry holds for it.
5
+ *
6
+ * It sits here, with the struct, rather than on the emitter. Half of what a row says is the
7
+ * context's — the program placement, the tenancy, the `transforms` row, the atlas patch — and the other
8
+ * half only means anything in the terms this struct sets: `render_position` is a word offset
9
+ * because that is what the render pass indexes a particle record with. An emitter that knew how to
10
+ * write one would be an emitter that knew what a table row is.
11
+ */
12
+ /**
13
+ * Fill `record` with an emitter as the value the emitter table stores — every field of
14
+ * {@link ./PARTICLE_EMITTER_STRUCT.js}, none omitted.
15
+ *
16
+ * Omitting one would not write zeros: the serializer skips absent fields, and table pages are
17
+ * recycled buffers, so a skipped field keeps whatever the previous tenant of the slot left there.
18
+ *
19
+ * Writes into a caller-supplied object rather than returning a fresh one so the registry can stage
20
+ * every row of a frame through one module-static record — the table serializes it synchronously, so
21
+ * nothing outlives the call.
22
+ *
23
+ * @param {object} record the staging object, see {@link create_emitter_record}
24
+ * @param {import("../runtime/ParticleEmitter.js").ParticleEmitter} emitter
25
+ * @param {import("../runtime/GPUParticleEmitterContext.js").GPUParticleEmitterContext} context the
26
+ * registry's bookkeeping for `emitter`
27
+ * @returns {object} `record`
28
+ */
29
+ export function write_emitter_record(record: object, emitter: import("../runtime/ParticleEmitter.js").ParticleEmitter, context: import("../runtime/GPUParticleEmitterContext.js").GPUParticleEmitterContext): object;
30
+ /**
31
+ * An empty staging record with every field of {@link ./PARTICLE_EMITTER_STRUCT.js} present, typed
32
+ * arrays for the vector fields so {@link write_emitter_record} can copy into them.
33
+ *
34
+ * @returns {object}
35
+ */
36
+ export function create_emitter_record(): object;
37
+ //# sourceMappingURL=particle_emitter_record.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"particle_emitter_record.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/particles/data/particle_emitter_record.js"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,6CANW,MAAM,WACN,OAAO,+BAA+B,EAAE,eAAe,WACvD,OAAO,yCAAyC,EAAE,yBAAyB,GAEzE,MAAM,CA2ClB;AAED;;;;;GAKG;AACH,yCAFa,MAAM,CA8BlB"}