@woosh/meep-engine 3.17.2 → 3.18.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 (263) hide show
  1. package/editor/actions/concrete/ComponentAddAction.d.ts +1 -0
  2. package/editor/actions/concrete/ComponentAddAction.d.ts.map +1 -1
  3. package/editor/actions/concrete/ComponentAddAction.js +4 -0
  4. package/editor/actions/concrete/ComponentRemoveAction.d.ts +1 -0
  5. package/editor/actions/concrete/ComponentRemoveAction.d.ts.map +1 -1
  6. package/editor/actions/concrete/ComponentRemoveAction.js +4 -0
  7. package/editor/actions/concrete/EntityCreateAction.d.ts +1 -0
  8. package/editor/actions/concrete/EntityCreateAction.d.ts.map +1 -1
  9. package/editor/actions/concrete/EntityCreateAction.js +7 -0
  10. package/editor/actions/concrete/EntityRemoveAction.d.ts +1 -0
  11. package/editor/actions/concrete/EntityRemoveAction.d.ts.map +1 -1
  12. package/editor/actions/concrete/EntityRemoveAction.js +4 -0
  13. package/editor/actions/concrete/PatchTerrainHeightAction.d.ts +10 -0
  14. package/editor/actions/concrete/PatchTerrainHeightAction.d.ts.map +1 -1
  15. package/editor/actions/concrete/PatchTerrainHeightAction.js +107 -85
  16. package/editor/actions/concrete/TransformModifyAction.d.ts +1 -0
  17. package/editor/actions/concrete/TransformModifyAction.d.ts.map +1 -1
  18. package/editor/actions/concrete/TransformModifyAction.js +4 -0
  19. package/editor/particles/effect/ParticleEffectDocument.d.ts.map +1 -1
  20. package/editor/particles/effect/ParticleEffectDocument.js +10 -6
  21. package/editor/particles/effect/ParticleReferenceSimulation.d.ts.map +1 -1
  22. package/editor/particles/effect/ParticleReferenceSimulation.js +98 -4
  23. package/editor/particles/effect/make_starter_particle_effect.d.ts.map +1 -1
  24. package/editor/particles/effect/make_starter_particle_effect.js +0 -2
  25. package/editor/tools/engine/ToolEngine.d.ts +30 -0
  26. package/editor/tools/engine/ToolEngine.d.ts.map +1 -1
  27. package/editor/tools/engine/ToolEngine.js +257 -188
  28. package/editor/view/ecs/EntityList.d.ts.map +1 -1
  29. package/editor/view/ecs/EntityList.js +6 -5
  30. package/editor/view/particles/effect/ParticleEmitterInspectorView.d.ts.map +1 -1
  31. package/editor/view/particles/effect/ParticleEmitterInspectorView.js +17 -9
  32. package/package.json +1 -1
  33. package/src/CODEC_LAYOUT_VERIFICATION.md +1 -2
  34. package/src/core/binary/meshopt/MESHOPT_VERTEX_BLOCK.d.ts +56 -0
  35. package/src/core/binary/meshopt/MESHOPT_VERTEX_BLOCK.d.ts.map +1 -0
  36. package/src/core/binary/meshopt/MESHOPT_VERTEX_BLOCK.js +73 -0
  37. package/src/core/binary/meshopt/meshopt_decode_vertex_buffer.d.ts.map +1 -1
  38. package/src/core/binary/meshopt/meshopt_decode_vertex_buffer.js +18 -63
  39. package/src/core/binary/meshopt/meshopt_encode_byte_group.d.ts +53 -0
  40. package/src/core/binary/meshopt/meshopt_encode_byte_group.d.ts.map +1 -0
  41. package/src/core/binary/meshopt/meshopt_encode_byte_group.js +140 -0
  42. package/src/core/binary/meshopt/meshopt_encode_data_block.d.ts +32 -0
  43. package/src/core/binary/meshopt/meshopt_encode_data_block.d.ts.map +1 -0
  44. package/src/core/binary/meshopt/meshopt_encode_data_block.js +77 -0
  45. package/src/core/binary/meshopt/meshopt_encode_index_sequence.d.ts +46 -0
  46. package/src/core/binary/meshopt/meshopt_encode_index_sequence.d.ts.map +1 -0
  47. package/src/core/binary/meshopt/meshopt_encode_index_sequence.js +146 -0
  48. package/src/core/binary/meshopt/meshopt_encode_vertex_buffer.d.ts +40 -0
  49. package/src/core/binary/meshopt/meshopt_encode_vertex_buffer.d.ts.map +1 -0
  50. package/src/core/binary/meshopt/meshopt_encode_vertex_buffer.js +700 -0
  51. package/src/core/binary/meshopt/meshopt_write_uint_var.d.ts +24 -0
  52. package/src/core/binary/meshopt/meshopt_write_uint_var.d.ts.map +1 -0
  53. package/src/core/binary/meshopt/meshopt_write_uint_var.js +39 -0
  54. package/src/core/math/random/seededRandom_Mulberry32.d.ts.map +1 -1
  55. package/src/core/math/random/seededRandom_Mulberry32.js +4 -2
  56. package/src/core/process/undo/Action.d.ts +19 -0
  57. package/src/core/process/undo/Action.d.ts.map +1 -1
  58. package/src/core/process/undo/Action.js +17 -0
  59. package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts +78 -0
  60. package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts.map +1 -0
  61. package/src/engine/graphics3/GPUParticleEmitterSystem.js +310 -0
  62. package/src/engine/graphics3/GraphicsEngine.d.ts +17 -0
  63. package/src/engine/graphics3/GraphicsEngine.d.ts.map +1 -1
  64. package/src/engine/graphics3/GraphicsEngine.js +30 -10
  65. package/src/engine/graphics3/particles/particle_gpu_records.d.ts.map +1 -1
  66. package/src/engine/graphics3/particles/particle_gpu_records.js +0 -2
  67. package/src/engine/interpolation/InterpolationSystem.d.ts +7 -0
  68. package/src/engine/interpolation/InterpolationSystem.d.ts.map +1 -1
  69. package/src/engine/interpolation/InterpolationSystem.js +10 -0
  70. package/src/engine/network/NetworkSession.d.ts.map +1 -1
  71. package/src/engine/network/NetworkSession.js +14 -34
  72. package/src/engine/network/time/RenderPlayout.d.ts +76 -0
  73. package/src/engine/network/time/RenderPlayout.d.ts.map +1 -0
  74. package/src/engine/network/time/RenderPlayout.js +163 -0
  75. package/src/engine/network/transport/adapters/WebSocketTransport.d.ts.map +1 -1
  76. package/src/engine/network/transport/adapters/WebSocketTransport.js +11 -4
  77. package/src/engine/physics/ecs/PhysicsSystem.d.ts +4 -12
  78. package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
  79. package/src/engine/physics/ecs/PhysicsSystem.js +39 -13
  80. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  81. package/src/engine/sound/simulation/core/VolumeField.d.ts.map +1 -1
  82. package/src/engine/sound/simulation/core/VolumeField.js +4 -1
  83. package/src/format/scene/gltf/MESHOPT_COMPRESSION_PLAN.md +23 -2
  84. package/src/shade/playground/particle_system/README.md +139 -139
  85. package/src/shade/playground/particle_system/particle_prototype.d.ts.map +1 -1
  86. package/src/shade/playground/particle_system/particle_prototype.js +0 -2
  87. package/src/shade/playground/particle_system/particle_scene.d.ts +6 -9
  88. package/src/shade/playground/particle_system/particle_scene.d.ts.map +1 -1
  89. package/src/shade/playground/particle_system/particle_scene.js +6 -13
  90. package/src/shade/playground/ssr_reprojection/README.md +103 -0
  91. package/src/shade/playground/ssr_reprojection/SpatialFilterProbe.d.ts +17 -0
  92. package/src/shade/playground/ssr_reprojection/SpatialFilterProbe.d.ts.map +1 -0
  93. package/src/shade/playground/ssr_reprojection/SpatialFilterProbe.js +68 -0
  94. package/src/shade/playground/ssr_reprojection/index.html +79 -0
  95. package/src/shade/playground/ssr_reprojection/main.d.ts +2 -0
  96. package/src/shade/playground/ssr_reprojection/main.d.ts.map +1 -0
  97. package/src/shade/playground/ssr_reprojection/main.js +245 -0
  98. package/src/shade/playground/ssr_reprojection/scene.d.ts +18 -0
  99. package/src/shade/playground/ssr_reprojection/scene.d.ts.map +1 -0
  100. package/src/shade/playground/ssr_reprojection/scene.js +51 -0
  101. package/src/shade/renderer/Renderer.d.ts +2 -23
  102. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  103. package/src/shade/renderer/Renderer.js +185 -218
  104. package/src/shade/renderer/animation/GPUAnimationManager.d.ts +5 -8
  105. package/src/shade/renderer/animation/GPUAnimationManager.d.ts.map +1 -1
  106. package/src/shade/renderer/animation/GPUAnimationManager.js +12 -12
  107. package/src/shade/renderer/buffer/table/GPUTypedTable.d.ts.map +1 -1
  108. package/src/shade/renderer/buffer/table/GPUTypedTable.js +6 -0
  109. package/src/shade/renderer/buffer/table/single/GPUSingleTypeTable.d.ts.map +1 -1
  110. package/src/shade/renderer/buffer/table/single/GPUSingleTypeTable.js +7 -0
  111. package/src/shade/renderer/global_illumination/brick4/gpu/draw/chunk_brick4_sample_specular.d.ts +4 -0
  112. package/src/shade/renderer/global_illumination/brick4/gpu/draw/chunk_brick4_sample_specular.d.ts.map +1 -0
  113. package/src/shade/renderer/global_illumination/brick4/gpu/draw/chunk_brick4_sample_specular.js +51 -0
  114. package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_specular.d.ts.map +1 -1
  115. package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_specular.js +5 -35
  116. package/src/shade/renderer/particles/DESIGN.md +703 -514
  117. package/src/shade/renderer/particles/GPUParticleSystem.d.ts +16 -4
  118. package/src/shade/renderer/particles/GPUParticleSystem.d.ts.map +1 -1
  119. package/src/shade/renderer/particles/GPUParticleSystem.js +1189 -991
  120. package/src/shade/renderer/particles/ParticleConstants.d.ts +64 -0
  121. package/src/shade/renderer/particles/ParticleConstants.d.ts.map +1 -1
  122. package/src/shade/renderer/particles/ParticleConstants.js +71 -0
  123. package/src/shade/renderer/particles/bounds/chunk_particle_bounds.d.ts +57 -0
  124. package/src/shade/renderer/particles/bounds/chunk_particle_bounds.d.ts.map +1 -0
  125. package/src/shade/renderer/particles/bounds/chunk_particle_bounds.js +181 -0
  126. package/src/shade/renderer/particles/bounds/chunk_particle_bounds_unknown.d.ts +7 -0
  127. package/src/shade/renderer/particles/bounds/chunk_particle_bounds_unknown.d.ts.map +1 -0
  128. package/src/shade/renderer/particles/bounds/chunk_particle_bounds_unknown.js +12 -0
  129. package/src/shade/renderer/particles/bounds/graph_particle_bounds.d.ts +33 -0
  130. package/src/shade/renderer/particles/bounds/graph_particle_bounds.d.ts.map +1 -0
  131. package/src/shade/renderer/particles/bounds/graph_particle_bounds.js +67 -0
  132. package/src/shade/renderer/particles/bounds/shader_particle_bounds.d.ts +40 -0
  133. package/src/shade/renderer/particles/bounds/shader_particle_bounds.d.ts.map +1 -0
  134. package/src/shade/renderer/particles/bounds/shader_particle_bounds.js +187 -0
  135. package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts +15 -2
  136. package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts.map +1 -1
  137. package/src/shade/renderer/particles/coherence/graph_particle_bucket.js +14 -8
  138. package/src/shade/renderer/particles/data/PARTICLE_COUNTERS.d.ts +58 -4
  139. package/src/shade/renderer/particles/data/PARTICLE_COUNTERS.d.ts.map +1 -1
  140. package/src/shade/renderer/particles/data/PARTICLE_COUNTERS.js +79 -4
  141. package/src/shade/renderer/particles/data/PARTICLE_EMITTER_STATE.d.ts +23 -1
  142. package/src/shade/renderer/particles/data/PARTICLE_EMITTER_STATE.d.ts.map +1 -1
  143. package/src/shade/renderer/particles/data/PARTICLE_EMITTER_STATE.js +35 -2
  144. package/src/shade/renderer/particles/data/PARTICLE_EMITTER_STRUCT.d.ts +4 -2
  145. package/src/shade/renderer/particles/data/PARTICLE_EMITTER_STRUCT.d.ts.map +1 -1
  146. package/src/shade/renderer/particles/data/PARTICLE_EMITTER_STRUCT.js +5 -8
  147. package/src/shade/renderer/particles/data/particle_emitter_record.d.ts.map +1 -1
  148. package/src/shade/renderer/particles/data/particle_emitter_record.js +0 -6
  149. package/src/shade/renderer/particles/graph_particles.d.ts +25 -3
  150. package/src/shade/renderer/particles/graph_particles.d.ts.map +1 -1
  151. package/src/shade/renderer/particles/graph_particles.js +108 -31
  152. package/src/shade/renderer/particles/graph_particles_avboit.d.ts +6 -4
  153. package/src/shade/renderer/particles/graph_particles_avboit.d.ts.map +1 -1
  154. package/src/shade/renderer/particles/graph_particles_avboit.js +5 -5
  155. package/src/shade/renderer/particles/runtime/EmitterRegistry.d.ts +5 -0
  156. package/src/shade/renderer/particles/runtime/EmitterRegistry.d.ts.map +1 -1
  157. package/src/shade/renderer/particles/runtime/EmitterRegistry.js +27 -6
  158. package/src/shade/renderer/particles/runtime/GPUParticleEmitterContext.d.ts +4 -0
  159. package/src/shade/renderer/particles/runtime/GPUParticleEmitterContext.d.ts.map +1 -1
  160. package/src/shade/renderer/particles/runtime/GPUParticleEmitterContext.js +6 -1
  161. package/src/shade/renderer/particles/runtime/ParticleEmitter.d.ts +35 -27
  162. package/src/shade/renderer/particles/runtime/ParticleEmitter.d.ts.map +1 -1
  163. package/src/shade/renderer/particles/runtime/ParticleEmitter.js +424 -425
  164. package/src/shade/renderer/particles/shaders/chunk_particle_emitter_warmup.d.ts +20 -0
  165. package/src/shade/renderer/particles/shaders/chunk_particle_emitter_warmup.d.ts.map +1 -0
  166. package/src/shade/renderer/particles/shaders/chunk_particle_render_math.d.ts +4 -0
  167. package/src/shade/renderer/particles/shaders/chunk_particle_render_math.d.ts.map +1 -1
  168. package/src/shade/renderer/particles/shaders/chunk_particle_render_math.js +38 -2
  169. package/src/shade/renderer/particles/shaders/chunk_particle_spawn_budget.d.ts +22 -0
  170. package/src/shade/renderer/particles/shaders/chunk_particle_spawn_budget.d.ts.map +1 -0
  171. package/src/shade/renderer/particles/shaders/chunk_particle_spawn_budget.js +42 -0
  172. package/src/shade/renderer/particles/shaders/shader_particle_avboit_draw.js +1 -1
  173. package/src/shade/renderer/particles/shaders/shader_particle_avboit_occupancy.d.ts.map +1 -1
  174. package/src/shade/renderer/particles/shaders/shader_particle_avboit_occupancy.js +53 -22
  175. package/src/shade/renderer/particles/shaders/shader_particle_emitter_tick.d.ts.map +1 -1
  176. package/src/shade/renderer/particles/shaders/shader_particle_emitter_tick.js +213 -216
  177. package/src/shade/renderer/particles/shaders/shader_particle_reclaim.d.ts +50 -0
  178. package/src/shade/renderer/particles/shaders/shader_particle_reclaim.d.ts.map +1 -0
  179. package/src/shade/renderer/particles/shaders/shader_particle_render.js +1 -1
  180. package/src/shade/renderer/particles/warmup/chunk_particle_warmup_step.d.ts +36 -0
  181. package/src/shade/renderer/particles/warmup/chunk_particle_warmup_step.d.ts.map +1 -0
  182. package/src/shade/renderer/particles/warmup/chunk_particle_warmup_step.js +102 -0
  183. package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts +102 -0
  184. package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts.map +1 -0
  185. package/src/shade/renderer/particles/warmup/graph_particle_warmup.js +329 -0
  186. package/src/shade/renderer/particles/warmup/shader_particle_warmup.d.ts +112 -0
  187. package/src/shade/renderer/particles/warmup/shader_particle_warmup.d.ts.map +1 -0
  188. package/src/shade/renderer/particles/warmup/shader_particle_warmup.js +318 -0
  189. package/src/shade/renderer/particles/warmup/shader_particle_warmup_advance.d.ts +35 -0
  190. package/src/shade/renderer/particles/warmup/shader_particle_warmup_advance.d.ts.map +1 -0
  191. package/src/shade/renderer/particles/warmup/shader_particle_warmup_advance.js +108 -0
  192. package/src/shade/renderer/particles/warmup/shader_particle_warmup_advance_wide.d.ts +3 -0
  193. package/src/shade/renderer/particles/warmup/shader_particle_warmup_advance_wide.d.ts.map +1 -0
  194. package/src/shade/renderer/particles/warmup/shader_particle_warmup_advance_wide.js +70 -0
  195. package/src/shade/renderer/particles/warmup/warmup_schedule.d.ts +62 -0
  196. package/src/shade/renderer/particles/warmup/warmup_schedule.d.ts.map +1 -0
  197. package/src/shade/renderer/particles/warmup/warmup_schedule.js +55 -0
  198. package/src/shade/renderer/postprocess/PostProcess.d.ts.map +1 -1
  199. package/src/shade/renderer/postprocess/PostProcess.js +2 -1
  200. package/src/shade/renderer/postprocess/ssr/REPROJECTION_PROPOSAL.md +286 -0
  201. package/src/shade/renderer/postprocess/ssr/SSR.d.ts +57 -21
  202. package/src/shade/renderer/postprocess/ssr/SSR.d.ts.map +1 -1
  203. package/src/shade/renderer/postprocess/ssr/SSR.js +230 -129
  204. package/src/shade/renderer/postprocess/ssr/SSRReprojectionMode.d.ts +11 -0
  205. package/src/shade/renderer/postprocess/ssr/SSRReprojectionMode.d.ts.map +1 -0
  206. package/src/shade/renderer/postprocess/ssr/SSRReprojectionMode.js +6 -0
  207. package/src/shade/renderer/postprocess/ssr/chunk_ssr_metadata.d.ts +4 -0
  208. package/src/shade/renderer/postprocess/ssr/chunk_ssr_metadata.d.ts.map +1 -0
  209. package/src/shade/renderer/postprocess/ssr/chunk_ssr_metadata.js +32 -0
  210. package/src/shade/renderer/postprocess/ssr/chunk_ssr_spatial_variance.d.ts +4 -0
  211. package/src/shade/renderer/postprocess/ssr/chunk_ssr_spatial_variance.d.ts.map +1 -0
  212. package/src/shade/renderer/postprocess/ssr/chunk_ssr_spatial_variance.js +41 -0
  213. package/src/shade/renderer/postprocess/ssr/reproject/chunk_ssr_reprojection.d.ts +3 -0
  214. package/src/shade/renderer/postprocess/ssr/reproject/chunk_ssr_reprojection.d.ts.map +1 -0
  215. package/src/shade/renderer/postprocess/ssr/reproject/chunk_ssr_reprojection.js +30 -0
  216. package/src/shade/renderer/postprocess/ssr/reproject/chunk_ssr_sample_history.d.ts +4 -0
  217. package/src/shade/renderer/postprocess/ssr/reproject/chunk_ssr_sample_history.d.ts.map +1 -0
  218. package/src/shade/renderer/postprocess/ssr/reproject/chunk_ssr_sample_history.js +70 -0
  219. package/src/shade/renderer/postprocess/ssr/resolve/build_ssr_resolve_shader.d.ts +21 -0
  220. package/src/shade/renderer/postprocess/ssr/resolve/build_ssr_resolve_shader.d.ts.map +1 -0
  221. package/src/shade/renderer/postprocess/ssr/resolve/build_ssr_resolve_shader.js +363 -0
  222. package/src/shade/renderer/postprocess/ssr/resolve/chunk_get_neighbour_weight.js +1 -1
  223. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader_Brick4.d.ts +2 -0
  224. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader_Brick4.d.ts.map +1 -0
  225. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader_Brick4.js +24 -0
  226. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader_IBL.d.ts +1 -6
  227. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader_IBL.d.ts.map +1 -1
  228. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader_IBL.js +16 -332
  229. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader_LPV.d.ts +1 -6
  230. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader_LPV.d.ts.map +1 -1
  231. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader_LPV.js +25 -358
  232. package/src/shade/renderer/postprocess/ssr/ssr_reproject_shader.d.ts +0 -5
  233. package/src/shade/renderer/postprocess/ssr/ssr_reproject_shader.d.ts.map +1 -1
  234. package/src/shade/renderer/postprocess/ssr/ssr_reproject_shader.js +201 -276
  235. package/src/shade/renderer/postprocess/ssr/ssr_spatial_denoise_shader.d.ts +1 -0
  236. package/src/shade/renderer/postprocess/ssr/ssr_spatial_denoise_shader.d.ts.map +1 -1
  237. package/src/shade/renderer/postprocess/ssr/ssr_spatial_denoise_shader.js +167 -143
  238. package/src/shade/renderer/shader/graph/graph_create_buffer.d.ts +15 -0
  239. package/src/shade/renderer/shader/graph/graph_create_buffer.d.ts.map +1 -0
  240. package/src/shade/renderer/shader/graph/graph_create_buffer.js +20 -0
  241. package/src/shade/renderer/view/GPUViewContext.d.ts +3 -4
  242. package/src/shade/renderer/view/GPUViewContext.d.ts.map +1 -1
  243. package/src/shade/renderer/view/GPUViewContext.js +5 -5
  244. package/src/core/binary/meshopt/__meshopt_test_streams.d.ts +0 -24
  245. package/src/core/binary/meshopt/__meshopt_test_streams.d.ts.map +0 -1
  246. package/src/core/binary/meshopt/__meshopt_test_streams.js +0 -237
  247. package/src/core/geom/3d/atlas/atlas_test_fixtures.d.ts +0 -84
  248. package/src/core/geom/3d/atlas/atlas_test_fixtures.d.ts.map +0 -1
  249. package/src/core/geom/3d/atlas/atlas_test_fixtures.js +0 -266
  250. package/src/engine/asset/loaders/gltf_test_fixtures.d.ts +0 -97
  251. package/src/engine/asset/loaders/gltf_test_fixtures.d.ts.map +0 -1
  252. package/src/engine/asset/loaders/gltf_test_fixtures.js +0 -359
  253. package/src/shade/renderer/animation/skin_test_fixtures.d.ts +0 -86
  254. package/src/shade/renderer/animation/skin_test_fixtures.d.ts.map +0 -1
  255. package/src/shade/renderer/animation/skin_test_fixtures.js +0 -250
  256. package/src/shade/renderer/geometry/virtual/format/attribute/vgeo_layers_test_fixtures.d.ts +0 -16
  257. package/src/shade/renderer/geometry/virtual/format/attribute/vgeo_layers_test_fixtures.d.ts.map +0 -1
  258. package/src/shade/renderer/geometry/virtual/format/attribute/vgeo_layers_test_fixtures.js +0 -27
  259. package/src/shade/renderer/particles/particle_test_fixtures.d.ts +0 -151
  260. package/src/shade/renderer/particles/particle_test_fixtures.d.ts.map +0 -1
  261. package/src/shade/renderer/particles/particle_test_fixtures.js +0 -229
  262. package/src/shade/renderer/particles/shaders/chunk_particle_emitter_world_sphere.js +0 -23
  263. package/src/shade/renderer/postprocess/ssr/reproject/shader_ffx_denoiser_reflections_reproject.js +0 -457
@@ -0,0 +1,20 @@
1
+ /**
2
+ * How many seconds of simulation this frame's newborns of an emitter owe before they may be shown,
3
+ * as the tick pass left it this frame.
4
+ *
5
+ * Zero on all but one frame of an emitter's life. The tick writes the emitter's `prewarm` here on
6
+ * the row's first tick and zero on every tick after, so a newborn asks this rather than asking the
7
+ * record's `prewarm` directly: the record says how long the emitter wants pre-warming *for*, and
8
+ * only the tick knows *whether this is that frame* — it is the generation comparison, and by the
9
+ * time the emit pass runs the tick has already made the two generations agree.
10
+ *
11
+ * Read off the `emitter_state` table of the same database the emitter record came from
12
+ * ({@link ../data/PARTICLE_EMITTER_STATE.js}), through the table's single-field reader, exactly as
13
+ * {@link ./chunk_particle_emitter_age.js} reads the age beside it — one binding for both, and no
14
+ * second copy of the row layout here to drift from the table's.
15
+ *
16
+ * @type {CodeChunk}
17
+ */
18
+ export const chunk_particle_emitter_warmup: CodeChunk;
19
+ import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
20
+ //# sourceMappingURL=chunk_particle_emitter_warmup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_particle_emitter_warmup.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/particles/shaders/chunk_particle_emitter_warmup.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,4CAFU,SAAS,CAMgD;0BAxBzC,oCAAoC"}
@@ -4,6 +4,10 @@
4
4
  *
5
5
  * - `particle_billboard_offset` — expand a quad corner into a world-space offset for each projection
6
6
  * / orientation mode (camera-facing, velocity-stretched, ground-aligned, axis-locked, world).
7
+ * - `particle_billboard_radius` — the largest offset that function can return, over every corner,
8
+ * every roll angle and every camera. What a bounds pass has to dilate a particle's centre by to
9
+ * hold its quad, and the reason it sits next to the function it bounds rather than with the bounds
10
+ * pass: the two are one statement, and they drift the moment they are written apart.
7
11
  * - `particle_atlas_uv` — map a local quad uv into an atlas sub-rect, honouring a flipbook grid +
8
12
  * frame index (mirrors meep's AtlasPatch offset/scale convention).
9
13
  * - `particle_soft_fade` — soft-particle alpha fade from scene-vs-particle view depth.
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_particle_render_math.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/particles/shaders/chunk_particle_render_math.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AACH,yCAFU,SAAS,CA2FhB;0BA3GuB,oCAAoC"}
1
+ {"version":3,"file":"chunk_particle_render_math.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/particles/shaders/chunk_particle_render_math.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;GAkBG;AACH,yCAFU,SAAS,CA2HhB;0BA/IuB,oCAAoC"}
@@ -7,6 +7,10 @@ import { EMITTER_BLEND, EMITTER_PROJECTION } from "../data/PARTICLE_EMITTER_STRU
7
7
  *
8
8
  * - `particle_billboard_offset` — expand a quad corner into a world-space offset for each projection
9
9
  * / orientation mode (camera-facing, velocity-stretched, ground-aligned, axis-locked, world).
10
+ * - `particle_billboard_radius` — the largest offset that function can return, over every corner,
11
+ * every roll angle and every camera. What a bounds pass has to dilate a particle's centre by to
12
+ * hold its quad, and the reason it sits next to the function it bounds rather than with the bounds
13
+ * pass: the two are one statement, and they drift the moment they are written apart.
10
14
  * - `particle_atlas_uv` — map a local quad uv into an atlas sub-rect, honouring a flipbook grid +
11
15
  * frame index (mirrors meep's AtlasPatch offset/scale convention).
12
16
  * - `particle_soft_fade` — soft-particle alpha fade from scene-vs-particle view depth.
@@ -75,6 +79,32 @@ fn particle_billboard_offset(
75
79
  return (right * rc.x + up * rc.y) * size;
76
80
  }
77
81
 
82
+ // The radius of the sphere holding every offset particle_billboard_offset can return for a particle
83
+ // of this size, velocity and projection — over all four corners, every roll angle, and any camera.
84
+ //
85
+ // A corner is (±1, ±1), so a rolled corner \`rc\` has |rc| = sqrt(2) whatever the angle: rotation
86
+ // moves a corner around the quad's circumcircle, it does not shrink it. Every mode then lays \`rc\`
87
+ // down on two orthonormal axes and scales by \`size\`, which makes |offset| = sqrt(2) * size exactly
88
+ // — camera-facing, ground-aligned, axis-locked and world-facing alike, because "which two unit
89
+ // axes" is the only thing that separates them.
90
+ //
91
+ // STRETCHED is the one that reaches further: it elongates the corner along the screen-space
92
+ // velocity by (1 + |v_screen|) before the same two axes. |v_screen| is a projection of the world
93
+ // velocity onto two orthonormal axes and so is at most |v|, which is what makes the world-space
94
+ // speed the camera-independent bound this needs to be.
95
+ //
96
+ // Camera-independent is the requirement, not a nicety: the box this feeds is measured over one
97
+ // frame and read on the next, by which time the camera has moved.
98
+ fn particle_billboard_radius(size : f32, velocity_ws : vec3<f32>, projection : u32) -> f32 {
99
+ var stretch = 0.0;
100
+
101
+ if (projection == PARTICLE_PROJ_STRETCHED) {
102
+ stretch = length(velocity_ws);
103
+ }
104
+
105
+ return abs(size) * 1.4142135623730951 * (1.0 + stretch);
106
+ }
107
+
78
108
  // Map a local quad uv (0..1) into an atlas sub-rect + flipbook cell.
79
109
  fn particle_atlas_uv(local_uv : vec2<f32>, region : vec4<f32>, flipbook : vec2<f32>, frame : f32) -> vec2<f32> {
80
110
  let cols = max(flipbook.x, 1.0);
@@ -90,10 +120,16 @@ fn particle_atlas_uv(local_uv : vec2<f32>, region : vec4<f32>, flipbook : vec2<f
90
120
 
91
121
  // Soft-particle fade: 0 when the particle is at/behind the scene surface, ramping to 1 across
92
122
  // fade_range in view-space units. A non-positive scene depth means background (no fade).
93
- fn particle_soft_fade(scene_view_depth : f32, particle_view_depth : f32, fade_range : f32) -> f32 {
123
+ fn particle_soft_fade(scene_view_depth : f32, particle_view_depth : f32, fade_range : f32) -> f32 {
94
124
  if (scene_view_depth <= 0.0) { return 1.0; }
95
125
  return smoothstep(0.0, max(fade_range, 1e-4), scene_view_depth - particle_view_depth);
96
- }
126
+ }
127
+
128
+ // Premultiplied RGB already includes coverage, so fading it must scale both parts of the pair.
129
+ fn particle_fade_color(color : vec4<f32>, blend : u32, fade : f32) -> vec4<f32> {
130
+ if (blend == PARTICLE_BLEND_PREMULTIPLIED) { return color * fade; }
131
+ return vec4<f32>(color.rgb, color.a * fade);
132
+ }
97
133
 
98
134
  // Produce the premultiplied colour the single blend pipeline expects.
99
135
  fn particle_premultiply(color : vec4<f32>, blend : u32) -> vec4<f32> {
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Take up to `wanted` particles from a frame's spawn budget, returning what was actually granted.
3
+ *
4
+ * The budget is `counters[SPAWN_BUDGET]`, seeded from the free count by whichever reset pass opened
5
+ * the frame, so an emitter is only ever debited for particles the pool can hold. Many rows race the
6
+ * counter, and the shape of the race is the dead-list pop's ({@link ./chunk_particle_emit_step.js}):
7
+ * a thread that drives it below zero sees an old value smaller than its request and keeps only that
8
+ * much; one that reads while another's over-subtraction is still un-undone sees a wrapped (huge)
9
+ * value and keeps nothing. Each adds back exactly what it did not keep, so the counter converges to
10
+ * zero rather than to garbage.
11
+ *
12
+ * A chunk because two ticks spend the budget the same way — the emitter tick over the live table
13
+ * ({@link ./shader_particle_emitter_tick.js}) and the warm-up tick over its queue
14
+ * (`../warmup/shader_particle_warmup.js`) — and the second must not be a second copy of the first's
15
+ * wrap guard. It names the `counters` binding directly, as every counter-touching chunk in this
16
+ * directory does: an atomic array behind a pointer parameter is a shape nothing in the engine uses.
17
+ *
18
+ * @type {CodeChunk}
19
+ */
20
+ export const chunk_particle_spawn_budget: CodeChunk;
21
+ import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
22
+ //# sourceMappingURL=chunk_particle_spawn_budget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_particle_spawn_budget.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/particles/shaders/chunk_particle_spawn_budget.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;GAkBG;AACH,0CAFU,SAAS,CAqBhB;0BAzCuB,oCAAoC"}
@@ -0,0 +1,42 @@
1
+ import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
2
+ import { PARTICLE_COUNTER } from "../data/PARTICLE_COUNTERS.js";
3
+
4
+ /**
5
+ * Take up to `wanted` particles from a frame's spawn budget, returning what was actually granted.
6
+ *
7
+ * The budget is `counters[SPAWN_BUDGET]`, seeded from the free count by whichever reset pass opened
8
+ * the frame, so an emitter is only ever debited for particles the pool can hold. Many rows race the
9
+ * counter, and the shape of the race is the dead-list pop's ({@link ./chunk_particle_emit_step.js}):
10
+ * a thread that drives it below zero sees an old value smaller than its request and keeps only that
11
+ * much; one that reads while another's over-subtraction is still un-undone sees a wrapped (huge)
12
+ * value and keeps nothing. Each adds back exactly what it did not keep, so the counter converges to
13
+ * zero rather than to garbage.
14
+ *
15
+ * A chunk because two ticks spend the budget the same way — the emitter tick over the live table
16
+ * ({@link ./shader_particle_emitter_tick.js}) and the warm-up tick over its queue
17
+ * (`../warmup/shader_particle_warmup.js`) — and the second must not be a second copy of the first's
18
+ * wrap guard. It names the `counters` binding directly, as every counter-touching chunk in this
19
+ * directory does: an atomic array behind a pointer parameter is a shape nothing in the engine uses.
20
+ *
21
+ * @type {CodeChunk}
22
+ */
23
+ export const chunk_particle_spawn_budget = CodeChunk.from(/* language=wgsl */ `
24
+ const COUNTER_SPAWN_BUDGET : u32 = ${PARTICLE_COUNTER.SPAWN_BUDGET}u;
25
+
26
+ fn particle_take_spawn_budget(wanted : u32, capacity : u32) -> u32 {
27
+ let old = atomicSub(&counters[COUNTER_SPAWN_BUDGET], wanted);
28
+
29
+ var granted = wanted;
30
+ if (old > capacity) {
31
+ granted = 0u;
32
+ } else if (old < wanted) {
33
+ granted = old;
34
+ }
35
+
36
+ if (granted != wanted) {
37
+ atomicAdd(&counters[COUNTER_SPAWN_BUDGET], wanted - granted);
38
+ }
39
+
40
+ return granted;
41
+ }
42
+ `);
@@ -97,7 +97,7 @@ fn fs_main(in : ParticleVertexOut) -> ParticleAVBOITDrawOutput {
97
97
 
98
98
  if ((in.flags & PARTICLE_FLAG_SOFT_DEPTH) != 0u) {
99
99
  let scene_vd = particle_scene_view_depth(textureLoad(scene_depth, vec2<i32>(in.clip.xy), 0).r, camera);
100
- color.a = color.a * particle_soft_fade(scene_vd, in.view_depth, PARTICLE_SOFT_FADE_RANGE);
100
+ color = particle_fade_color(color, in.blend, particle_soft_fade(scene_vd, in.view_depth, PARTICLE_SOFT_FADE_RANGE));
101
101
  }
102
102
 
103
103
  if ((in.flags & PARTICLE_FLAG_LIGHTING) != 0u) {
@@ -1 +1 @@
1
- {"version":3,"file":"shader_particle_avboit_occupancy.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/particles/shaders/shader_particle_avboit_occupancy.js"],"names":[],"mappings":"AAuHA,6DAIG;8BAlH2B,+BAA+B"}
1
+ {"version":3,"file":"shader_particle_avboit_occupancy.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/particles/shaders/shader_particle_avboit_occupancy.js"],"names":[],"mappings":"AAsJA,6DAIG;8BAjJ2B,+BAA+B"}
@@ -6,30 +6,37 @@ import { AVBOIT_OCCUPANCY_WORDS, AVBOIT_VIRTUAL_SLICES_MAX } from "../../rasteri
6
6
  import { chunk_avboit_occupancy_range } from "../../rasterize/native/avboit/chunk_avboit_occupancy_range.js";
7
7
  import { chunk_avboit_occupancy_word_mask } from "../../rasterize/native/avboit/chunk_avboit_occupancy_word_mask.js";
8
8
  import { AVBOIT_OCCUPANCY_SETTINGS_STRUCT } from "../../rasterize/native/avboit/shader_avboit_occupancy.js";
9
- import { chunk_scene_database_access } from "../../scene/chunk_scene_database_access.js";
9
+ import { AABB3_STRUCT } from "../../shader/chunk/geometry/aabb3/AABB3_STRUCT.js";
10
10
  import { ComputeShader } from "../../shader/ComputeShader.js";
11
11
  import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
12
12
  import { ShaderResourceSetDescriptor } from "../../shader/resource/ShaderResourceSetDescriptor.js";
13
13
  import { PARTICLE_EMITTER_TICK_WORKGROUP_SIZE } from "../ParticleConstants.js";
14
- import { PARTICLE_EMITTER_DESCRIPTOR } from "../data/PARTICLE_DATABASE_SPEC.js";
14
+ import { PARTICLE_EMITTER_DESCRIPTOR, PARTICLE_EMITTER_STATE_DESCRIPTOR } from "../data/PARTICLE_DATABASE_SPEC.js";
15
15
  import { EMITTER_BLEND } from "../data/PARTICLE_EMITTER_STRUCT.js";
16
- import { chunk_particle_emitter_world_sphere } from "./chunk_particle_emitter_world_sphere.js";
16
+ import { chunk_particle_emitter } from "../data/chunk_particle_emitter.js";
17
+ import { chunk_particle_bounds_unknown } from "../bounds/chunk_particle_bounds_unknown.js";
17
18
 
18
19
  /**
19
20
  * The particles' AVBOIT occupancy: one thread per emitter table row, marking the virtual depth
20
- * slices the emitter's bounds sphere spans, so the warp keeps resolution where the particles are.
21
+ * slices the emitter's bounding box spans, so the warp keeps resolution where the particles are.
21
22
  * The particle counterpart of `shader_avboit_occupancy`, which does the same per meshlet AABB.
22
23
  *
23
- * Per emitter rather than per particle: the sphere is the bound the author gave the emitter (the
24
- * one the tick culls with), it is one thread per row instead of one per live particle contending
25
- * for the same few words, and a particle that strays past it is not lost — it lands on the
26
- * boundary of the nearest run, the warp's flat-in-a-gap property. Emitters that only add light
27
- * (`EMITTER_BLEND.ADDITIVE`) splat no extinction and mark nothing: a slice reserved for them would
28
- * be a slice the surfaces do not get.
24
+ * Per emitter rather than per particle: the box is the one the bounds passes measured from the
25
+ * particles ({@link ../data/PARTICLE_EMITTER_STATE.js}), it is one thread per row instead of one
26
+ * per live particle contending for the same few words, and a particle that strays past it is not
27
+ * lost — it lands on the boundary of the nearest run, the warp's flat-in-a-gap property. Emitters
28
+ * that only add light (`EMITTER_BLEND.ADDITIVE`) splat no extinction and mark nothing: a slice
29
+ * reserved for them would be a slice the surfaces do not get.
29
30
  *
30
- * The sphere goes to view space through the node's `global`; the camera looks down −Z, so the
31
- * depth interval is `[-(c.z) - r, -(c.z) + r]`, clamped at the near plane, through the same depth
32
- * curve and dilation the meshlet pass uses.
31
+ * The box is already in world space — it was measured from world-space particles, dilated to hold
32
+ * their quads — so all that is left is its view-depth interval, which is its centre's depth plus or
33
+ * minus the box's extent along the view axis. That is a support-function projection, not eight
34
+ * transformed corners: the box is axis-aligned in world space and only its extent along one axis is
35
+ * wanted. The camera looks down −Z, so the interval is clamped at the near plane and mapped through
36
+ * the same depth curve and dilation the meshlet pass uses.
37
+ *
38
+ * The box is published by this frame's bounds pass after emit and simulate. The next tick will cull
39
+ * against that same measurement. An infinite box means no measured population and marks nothing.
33
40
  *
34
41
  * Walks the table with its page iterator, read-only: the rows are the tick's output of this frame.
35
42
  *
@@ -39,13 +46,13 @@ import { chunk_particle_emitter_world_sphere } from "./chunk_particle_emitter_wo
39
46
  const GROUP_SIZE = PARTICLE_EMITTER_TICK_WORKGROUP_SIZE;
40
47
 
41
48
  const PG = PARTICLE_EMITTER_DESCRIPTOR.page_iterator_symbol_prefix(GROUP_SIZE);
49
+ const STATE = PARTICLE_EMITTER_STATE_DESCRIPTOR;
42
50
 
43
51
  const resources = new ShaderResourceSetDescriptor();
44
52
 
45
53
  resources.createGroup()
46
54
  .addUniform("camera", CAMERA_UNIFORM_STRUCT)
47
55
  .addUniform("settings", AVBOIT_OCCUPANCY_SETTINGS_STRUCT)
48
- .addStorageBuffer("scene_database", WebGPUArray.from(u32))
49
56
  .addStorageBuffer("emitter_database", WebGPUArray.from(u32))
50
57
  .addStorageBuffer("occupancy", WebGPUArray.from(atomic_u32, AVBOIT_OCCUPANCY_WORDS), true);
51
58
 
@@ -54,6 +61,27 @@ const body = CodeChunk.from(
54
61
  `
55
62
  const PARTICLE_BLEND_ADDITIVE : u32 = ${EMITTER_BLEND.ADDITIVE}u;
56
63
 
64
+ // The view-space depth interval of a world-space box: the centre's depth, plus or minus the box's
65
+ // extent along the view axis. \`view_axis\` is the view matrix's third ROW — read as the z of the
66
+ // transformed basis vectors rather than as matrix columns, the same numbers in the form the WGSL
67
+ // emulator also evaluates.
68
+ fn particle_emitter_view_depth_range(box : ${AABB3_STRUCT.wgsl_ref}, view : mat4x4<f32>) -> vec2<f32> {
69
+ let center = (box.min + box.max) * 0.5;
70
+ let half_extent = (box.max - box.min) * 0.5;
71
+
72
+ let view_axis = vec3<f32>(
73
+ (view * vec4<f32>(1.0, 0.0, 0.0, 0.0)).z,
74
+ (view * vec4<f32>(0.0, 1.0, 0.0, 0.0)).z,
75
+ (view * vec4<f32>(0.0, 0.0, 1.0, 0.0)).z,
76
+ );
77
+
78
+ // camera looks down -Z, so depth is -z
79
+ let depth = -(view * vec4<f32>(center, 1.0)).z;
80
+ let extent = dot(abs(view_axis), half_extent);
81
+
82
+ return vec2<f32>(depth - extent, depth + extent);
83
+ }
84
+
57
85
  @compute @workgroup_size(${GROUP_SIZE}, 1, 1)
58
86
  fn main(
59
87
  @builtin(workgroup_id) wg_id : vec3<u32>,
@@ -77,14 +105,15 @@ fn main(
77
105
  return;
78
106
  }
79
107
 
80
- let node = scene_read_node(&scene_database, em.node);
81
- let sphere = particle_emitter_world_sphere(em, node.global);
108
+ let state = ${STATE.marshalling_method_read}(&emitter_database, ${PG}_slot_to_index(slot_in_page));
109
+ // Unknown bounds have no live particles to splat; do not reserve the whole depth volume.
110
+ if (particle_bounds_unknown(state.bounds_min)) { return; }
111
+ let box = ${AABB3_STRUCT.make({ min: "state.bounds_min", max: "state.bounds_max" })};
82
112
 
83
- let center_view = (camera.view_matrix * vec4<f32>(sphere.xyz, 1.0)).xyz;
113
+ let range_view = particle_emitter_view_depth_range(box, camera.view_matrix);
84
114
 
85
- // camera looks down -Z
86
- let depth_min = -center_view.z - sphere.w;
87
- let depth_max = -center_view.z + sphere.w;
115
+ let depth_min = range_view.x;
116
+ let depth_max = range_view.y;
88
117
 
89
118
  if (depth_max < camera.clip_near_far.x) {
90
119
  // entirely in front of the near plane
@@ -109,8 +138,10 @@ fn main(
109
138
  }
110
139
  `, [
111
140
  PARTICLE_EMITTER_DESCRIPTOR.chunk_iterate(GROUP_SIZE),
112
- chunk_particle_emitter_world_sphere,
113
- chunk_scene_database_access,
141
+ chunk_particle_emitter,
142
+ chunk_particle_bounds_unknown,
143
+ STATE.chunk_read,
144
+ AABB3_STRUCT.declaration_chunk,
114
145
  chunk_cluster_depth_to_z_slice,
115
146
  chunk_avboit_occupancy_range,
116
147
  chunk_avboit_occupancy_word_mask,
@@ -1 +1 @@
1
- {"version":3,"file":"shader_particle_emitter_tick.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/particles/shaders/shader_particle_emitter_tick.js"],"names":[],"mappings":"AAiNA,yDAIG;;8BA5M2B,+BAA+B;qDAGR,yBAAyB"}
1
+ {"version":3,"file":"shader_particle_emitter_tick.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/particles/shaders/shader_particle_emitter_tick.js"],"names":[],"mappings":"AA8MA,yDAIG;;8BAzM2B,+BAA+B;qDAGR,yBAAyB"}