@woosh/meep-engine 3.42.0 → 3.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/editor/prototypeEditorShell.d.ts.map +1 -1
- package/editor/prototypeEditorShell.js +4 -2
- package/package.json +91 -96
- package/src/engine/Clock.d.ts +15 -0
- package/src/engine/Clock.d.ts.map +1 -1
- package/src/engine/Clock.js +29 -5
- package/src/engine/Engine.d.ts.map +1 -1
- package/src/engine/Engine.js +11 -19
- package/src/engine/graphics/ecs/mesh-v2/MeshSkin.d.ts +57 -0
- package/src/engine/graphics/ecs/mesh-v2/MeshSkin.d.ts.map +1 -0
- package/src/engine/graphics/ecs/mesh-v2/MeshSkin.js +84 -0
- package/src/engine/graphics3/AnimationGraphSystem.d.ts +23 -13
- package/src/engine/graphics3/AnimationGraphSystem.d.ts.map +1 -1
- package/src/engine/graphics3/AnimationGraphSystem.js +61 -64
- package/src/engine/graphics3/AnimationSystem.d.ts +24 -15
- package/src/engine/graphics3/AnimationSystem.d.ts.map +1 -1
- package/src/engine/graphics3/AnimationSystem.js +67 -61
- package/src/engine/graphics3/MeshSkinSystem.d.ts +56 -0
- package/src/engine/graphics3/MeshSkinSystem.d.ts.map +1 -0
- package/src/engine/graphics3/MeshSkinSystem.js +317 -0
- package/src/engine/graphics3/MeshSystem.d.ts +15 -35
- package/src/engine/graphics3/MeshSystem.d.ts.map +1 -1
- package/src/engine/graphics3/MeshSystem.js +21 -298
- package/src/engine/graphics3/RowChains.d.ts +76 -0
- package/src/engine/graphics3/RowChains.d.ts.map +1 -0
- package/src/engine/graphics3/RowChains.js +347 -0
- package/src/engine/graphics3/ShadedGeometrySystem.d.ts +6 -0
- package/src/engine/graphics3/ShadedGeometrySystem.d.ts.map +1 -1
- package/src/engine/graphics3/ShadedGeometrySystem.js +329 -309
- package/src/engine/graphics3/animation/AnimationClips.d.ts +56 -0
- package/src/engine/graphics3/animation/AnimationClips.d.ts.map +1 -0
- package/src/engine/graphics3/animation/AnimationClips.js +79 -0
- package/src/engine/graphics3/animation/ClipListPlayer.d.ts +13 -14
- package/src/engine/graphics3/animation/ClipListPlayer.d.ts.map +1 -1
- package/src/engine/graphics3/animation/ClipListPlayer.js +262 -263
- package/src/engine/graphics3/animation/write_clip_playback.d.ts +3 -3
- package/src/engine/graphics3/animation/write_clip_playback.js +4 -4
- package/src/engine/graphics3/pose/query_entity_node_world_pose.d.ts +5 -0
- package/src/engine/graphics3/pose/query_entity_node_world_pose.d.ts.map +1 -1
- package/src/engine/graphics3/pose/query_entity_node_world_pose.js +80 -75
- package/src/engine/graphics3/prefab/PrefabInstance.d.ts +4 -24
- package/src/engine/graphics3/prefab/PrefabInstance.d.ts.map +1 -1
- package/src/engine/graphics3/prefab/PrefabInstance.js +60 -80
- package/src/engine/graphics3/prefab/prefab_instantiate.d.ts +16 -3
- package/src/engine/graphics3/prefab/prefab_instantiate.d.ts.map +1 -1
- package/src/engine/graphics3/prefab/prefab_instantiate.js +49 -12
- package/src/engine/graphics3/prefab/prefab_place.d.ts +31 -17
- package/src/engine/graphics3/prefab/prefab_place.d.ts.map +1 -1
- package/src/engine/graphics3/prefab/prefab_place.js +175 -130
- package/src/engine/graphics3/register_clips.d.ts +64 -0
- package/src/engine/graphics3/register_clips.d.ts.map +1 -0
- package/src/engine/graphics3/register_clips.js +114 -0
- package/src/engine/physics/cloth/MEASUREMENTS.md +795 -0
- package/src/engine/physics/cloth/PLAN.md +339 -9
- package/src/engine/physics/cloth/build/ClothProxy.d.ts +113 -61
- package/src/engine/physics/cloth/build/ClothProxy.d.ts.map +1 -1
- package/src/engine/physics/cloth/build/ClothProxy.js +142 -77
- package/src/engine/physics/cloth/build/cloth_bind_in_frame.d.ts +22 -0
- package/src/engine/physics/cloth/build/cloth_bind_in_frame.d.ts.map +1 -0
- package/src/engine/physics/cloth/build/cloth_bind_in_frame.js +75 -0
- package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts +43 -30
- package/src/engine/physics/cloth/build/cloth_proxy_from_joints.d.ts.map +1 -1
- package/src/engine/physics/cloth/build/cloth_proxy_from_joints.js +357 -284
- package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.d.ts +62 -0
- package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.d.ts.map +1 -0
- package/src/engine/physics/cloth/build/cloth_proxy_from_mesh.js +280 -0
- package/src/engine/physics/cloth/collider/cloth_collider_sdf.d.ts +1 -1
- package/src/engine/physics/cloth/collider/cloth_collider_sdf.js +1 -1
- package/src/engine/physics/cloth/ecs/Cloth.d.ts +17 -9
- package/src/engine/physics/cloth/ecs/Cloth.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/Cloth.js +220 -212
- package/src/engine/physics/cloth/ecs/ClothDynamicsFlags.js +6 -0
- package/src/engine/physics/cloth/ecs/ClothHold.d.ts +91 -0
- package/src/engine/physics/cloth/ecs/ClothHold.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/ClothHold.js +103 -0
- package/src/engine/physics/cloth/ecs/ClothInstance.d.ts +254 -48
- package/src/engine/physics/cloth/ecs/ClothInstance.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothInstance.js +277 -47
- package/src/engine/physics/cloth/ecs/ClothPin.d.ts +73 -0
- package/src/engine/physics/cloth/ecs/ClothPin.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/ClothPin.js +92 -0
- package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.d.ts +36 -0
- package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/ClothPinSerializationAdapter.js +61 -0
- package/src/engine/physics/cloth/ecs/ClothRig.d.ts +23 -17
- package/src/engine/physics/cloth/ecs/ClothRig.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothRig.js +29 -27
- package/src/engine/physics/cloth/ecs/ClothSystem.d.ts +12 -14
- package/src/engine/physics/cloth/ecs/ClothSystem.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothSystem.js +20 -15
- package/src/engine/physics/cloth/ecs/ClothWorld.d.ts +57 -36
- package/src/engine/physics/cloth/ecs/ClothWorld.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothWorld.js +816 -179
- package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts +12 -13
- package/src/engine/physics/cloth/ecs/WorkerClothSystem.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/WorkerClothSystem.js +20 -14
- package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts +63 -11
- package/src/engine/physics/cloth/ecs/cloth_build_rows.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_build_rows.js +321 -84
- package/src/engine/physics/cloth/ecs/cloth_dynamics_map.d.ts +9 -7
- package/src/engine/physics/cloth/ecs/cloth_dynamics_map.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_dynamics_map.js +9 -7
- package/src/engine/physics/cloth/ecs/cloth_gather_colliders.d.ts +3 -3
- package/src/engine/physics/cloth/ecs/cloth_gather_colliders.js +30 -30
- package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts +37 -0
- package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/cloth_geodesic.js +142 -0
- package/src/engine/physics/cloth/ecs/cloth_holds.d.ts +97 -0
- package/src/engine/physics/cloth/ecs/cloth_holds.d.ts.map +1 -0
- package/src/engine/physics/cloth/ecs/cloth_holds.js +608 -0
- package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts +2 -2
- package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_reconstruct_pose.js +160 -9
- package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts +17 -22
- package/src/engine/physics/cloth/ecs/cloth_seed_rig.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_seed_rig.js +55 -117
- package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts +21 -6
- package/src/engine/physics/cloth/ecs/cloth_seed_subtree.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_seed_subtree.js +44 -15
- package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts +5 -0
- package/src/engine/physics/cloth/ecs/cloth_write_back.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_write_back.js +60 -16
- package/src/engine/physics/cloth/ecs/cloth_write_back_rig.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/cloth_write_back_rig.js +65 -58
- package/src/engine/physics/cloth/playground/collide_main.js +1 -1
- package/src/engine/physics/cloth/playground/garment_build.d.ts.map +1 -1
- package/src/engine/physics/cloth/playground/garment_build.js +17 -5
- package/src/engine/physics/cloth/playground/garment_main.js +1 -1
- package/src/engine/physics/cloth/playground/rig_build.d.ts.map +1 -1
- package/src/engine/physics/cloth/playground/rig_build.js +302 -296
- package/src/engine/physics/cloth/solver/ClothState.d.ts +45 -7
- package/src/engine/physics/cloth/solver/ClothState.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/ClothState.js +63 -7
- package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts +6 -1
- package/src/engine/physics/cloth/solver/cloth_contact_find.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_contact_find.js +7 -2
- package/src/engine/physics/cloth/solver/cloth_hold_line.d.ts +114 -0
- package/src/engine/physics/cloth/solver/cloth_hold_line.d.ts.map +1 -0
- package/src/engine/physics/cloth/solver/cloth_hold_line.js +362 -0
- package/src/engine/physics/cloth/solver/cloth_self_find.d.ts +6 -2
- package/src/engine/physics/cloth/solver/cloth_self_find.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_self_find.js +13 -13
- package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts +24 -12
- package/src/engine/physics/cloth/solver/cloth_solver_constants.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_solver_constants.js +24 -12
- package/src/engine/physics/cloth/solver/cloth_step.d.ts +16 -0
- package/src/engine/physics/cloth/solver/cloth_step.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_step.js +183 -20
- package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts +1 -0
- package/src/engine/physics/cloth/solver/cloth_step_instance.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_step_instance.js +10 -3
- package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.d.ts +1 -1
- package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/constraint/cloth_leash_row.js +353 -346
- package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts +7 -5
- package/src/engine/physics/cloth/solver/constraint/cloth_self_row.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/constraint/cloth_self_row.js +7 -5
- package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts +9 -9
- package/src/engine/physics/cloth/wind/cloth_sample_air.d.ts.map +1 -1
- package/src/engine/physics/cloth/wind/cloth_sample_air.js +26 -26
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/engine/simulation/Ticker.d.ts +13 -0
- package/src/engine/simulation/Ticker.d.ts.map +1 -1
- package/src/engine/simulation/Ticker.js +43 -8
- package/src/shade/RENDERER_CONTRACT.md +8 -2
- package/src/shade/playground/mesh_row_ceiling/main.js +2 -1
- package/src/shade/playground/skinned_blas_refit/main.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/main.js +11 -19
- package/src/shade/playground/skinned_blas_refit/place_character.d.ts +6 -3
- package/src/shade/playground/skinned_blas_refit/place_character.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/place_character.js +90 -90
- package/src/shade/playground/skinned_mesh_soup/main.d.ts.map +1 -1
- package/src/shade/playground/skinned_mesh_soup/main.js +502 -509
- package/src/shade/playground/texture_encode/README.md +129 -109
- package/src/shade/playground/texture_encode/main.js +1430 -1430
- package/src/shade/playground/vgeo_runtime/README.md +5 -4
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +6 -5
- package/src/shade/renderer/animation/GPUAnimationManager.d.ts +45 -14
- package/src/shade/renderer/animation/GPUAnimationManager.d.ts.map +1 -1
- package/src/shade/renderer/animation/GPUAnimationManager.js +316 -64
- package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts +5 -0
- package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts.map +1 -1
- package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +11 -1
- package/src/shade/renderer/atmosphere/GPUSky.d.ts +12 -0
- package/src/shade/renderer/atmosphere/GPUSky.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/GPUSky.js +162 -147
- package/src/shade/renderer/geometry/BoxGeometry.d.ts +1 -11
- package/src/shade/renderer/geometry/BoxGeometry.d.ts.map +1 -1
- package/src/shade/renderer/geometry/BoxGeometry.js +6 -13
- package/src/shade/renderer/geometry/CapsuleGeometry.d.ts +19 -0
- package/src/shade/renderer/geometry/CapsuleGeometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/CapsuleGeometry.js +24 -0
- package/src/shade/renderer/geometry/ConeGeometry.d.ts +20 -0
- package/src/shade/renderer/geometry/ConeGeometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/ConeGeometry.js +33 -0
- package/src/shade/renderer/geometry/CylinderGeometry.d.ts +21 -0
- package/src/shade/renderer/geometry/CylinderGeometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/CylinderGeometry.js +35 -0
- package/src/shade/renderer/geometry/PlaneGeometry.d.ts +17 -0
- package/src/shade/renderer/geometry/PlaneGeometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/PlaneGeometry.js +22 -0
- package/src/shade/renderer/geometry/TorusGeometry.d.ts +18 -0
- package/src/shade/renderer/geometry/TorusGeometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/TorusGeometry.js +23 -0
- package/src/shade/renderer/geometry/UVSphereGeometry.d.ts +21 -0
- package/src/shade/renderer/geometry/UVSphereGeometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/UVSphereGeometry.js +34 -0
- package/src/shade/renderer/geometry/primitives/make_capsule_geometry.d.ts +19 -0
- package/src/shade/renderer/geometry/primitives/make_capsule_geometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/primitives/make_capsule_geometry.js +205 -0
- package/src/shade/renderer/geometry/primitives/make_cone_geometry.d.ts +21 -0
- package/src/shade/renderer/geometry/primitives/make_cone_geometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/primitives/make_cone_geometry.js +36 -0
- package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.d.ts +1 -1
- package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.d.ts.map +1 -1
- package/src/shade/renderer/geometry/primitives/make_cylinder_geometry.js +44 -9
- package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.d.ts +20 -0
- package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/primitives/make_uv_sphere_geometry.js +190 -0
- package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/graph_vgeo_expand_instances_to_meshlets.js +7 -2
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.d.ts +26 -8
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.js +56 -39
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.d.ts +7 -0
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.js +46 -4
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/test_prefix_sum.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/prefix_sum/v1/test_prefix_sum.js +4 -2
- package/src/shade/renderer/gpu_primitive/sort/defs.d.ts +2 -2
- package/src/shade/renderer/gpu_primitive/sort/defs.js +79 -79
- package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts +1 -1
- package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/sort/graph_radix_sort.js +7 -3
- package/src/shade/renderer/lightmap/bake/shader_lightmap_denoise_sh.d.ts.map +1 -1
- package/src/shade/renderer/lightmap/bake/shader_lightmap_denoise_sh.js +10 -3
- package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
- package/src/shade/renderer/particles/DESIGN.md +13 -9
- package/src/shade/renderer/particles/GPUParticleSystem.js +1 -1
- package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts +4 -3
- package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts.map +1 -1
- package/src/shade/renderer/particles/coherence/graph_particle_bucket.js +200 -194
- package/src/shade/renderer/particles/graph_particles.d.ts.map +1 -1
- package/src/shade/renderer/particles/graph_particles.js +6 -2
- package/src/shade/renderer/particles/shaders/chunk_particle_lighting.d.ts +1 -1
- package/src/shade/renderer/particles/shaders/chunk_particle_lighting.js +1 -1
- package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts.map +1 -1
- package/src/shade/renderer/particles/warmup/graph_particle_warmup.js +334 -329
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
- package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +7 -2
- package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/expand/mesh/graph_expand_meshes_to_meshlets.js +16 -4
- package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts +3 -2
- package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.js +3 -2
- package/src/shade/renderer/scene/GPUSceneContext.d.ts +9 -1
- package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
- package/src/shade/renderer/scene/GPUSceneContext.js +23 -1
- package/src/shade/renderer/texture/COMPRESSED_TEXTURE_PLAN_2026_09_01.md +2444 -2345
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_astc_encode_block_4x4_rgb.js +312 -310
- package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts +3 -3
- package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc1_encode_block.js +383 -375
- package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc6h_encode_block_mode11.js +349 -346
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts +58 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block.js +536 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts +21 -7
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc7_encode_block_mode6.js +291 -327
- package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.d.ts +25 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode1.js +99 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts +5 -3
- package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/chunk_bc7_pack_mode6.js +47 -71
- package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.d.ts +10 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.d.ts.map +1 -0
- package/src/shade/renderer/texture/encode/chunk_bc7_partition_2.js +50 -0
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts +4 -5
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.d.ts.map +1 -1
- package/src/shade/renderer/texture/encode/shader_texture_encode_bc7.js +7 -8
- package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts +4 -1
- package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/GPUViewVolumetrics.js +74 -3
- package/src/shade/renderer/volumetrics/NOTES.md +1023 -957
- package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.d.ts +5 -4
- package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.js +5 -4
- package/src/shade/renderer/volumetrics/gi/chunk_volumetrics_gi.d.ts +1 -1
- package/src/shade/renderer/volumetrics/gi/chunk_volumetrics_gi.js +1 -1
- package/src/shade/renderer/volumetrics/gi/graph_build_froxel_gi.d.ts +1 -1
- package/src/shade/renderer/volumetrics/gi/graph_build_froxel_gi.js +1 -1
- package/src/shade/renderer/volumetrics/graph_build_froxel_irradiance.d.ts +41 -0
- package/src/shade/renderer/volumetrics/graph_build_froxel_irradiance.d.ts.map +1 -0
- package/src/shade/renderer/volumetrics/graph_build_froxel_irradiance.js +112 -0
- package/src/shade/renderer/volumetrics/graph_build_volumetrics.d.ts +9 -23
- package/src/shade/renderer/volumetrics/graph_build_volumetrics.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/graph_build_volumetrics.js +18 -126
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_irradiance.d.ts +22 -0
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_irradiance.d.ts.map +1 -0
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_irradiance.js +228 -0
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.js +0 -53
- package/src/shade/renderer/water/chunk_water_transport.d.ts.map +1 -1
- package/src/shade/renderer/water/chunk_water_transport.js +7 -5
- package/src/shade/renderer/water/medium/GPUWaterBodies.d.ts.map +1 -1
- package/src/shade/renderer/water/medium/GPUWaterBodies.js +8 -2
- package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.d.ts +3 -2
- package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.d.ts.map +1 -1
- package/src/shade/renderer/water/optics/chunk_water_receiver_downwelling.js +3 -2
- package/src/shade/renderer/water/shader_water.d.ts.map +1 -1
- package/src/shade/renderer/water/shader_water.js +3 -1
- package/src/shade/renderer/water/surface/GPUWaterSurface.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/GPUWaterSurface.js +3 -1
- package/src/shade/renderer/water/surface/chunk_water_surface_sample.d.ts +4 -3
- package/src/shade/renderer/water/surface/chunk_water_surface_sample.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/chunk_water_surface_sample.js +17 -7
- package/src/shade/renderer/water/surface/graph_water_tessellation.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/graph_water_tessellation.js +11 -4
- package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +93 -30
- package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.js +13 -5
- package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts +29 -8
- package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/chunk_water_particle.js +155 -30
- package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts +6 -1
- package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.js +157 -39
- package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts +91 -21
- package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/shader_water_particles.js +442 -70
- package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.js +11 -3
- package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
- package/src/shade/wgsl/emulator/WGSLLanguageCore.js +3 -0
- package/src/shade/wgsl/validate_wgsl_source.d.ts.map +1 -1
- package/src/shade/wgsl/validate_wgsl_source.js +74 -3
- package/src/engine/graphics3/register_instance_animation.d.ts +0 -114
- package/src/engine/graphics3/register_instance_animation.d.ts.map +0 -1
- package/src/engine/graphics3/register_instance_animation.js +0 -201
|
@@ -13,7 +13,7 @@ export class TinyGltf {
|
|
|
13
13
|
* @readonly
|
|
14
14
|
* @type {TextureFormat}
|
|
15
15
|
*/
|
|
16
|
-
static readonly "__#
|
|
16
|
+
static readonly "__#265@#UNCOMPRESSED_TARGET": TextureFormat;
|
|
17
17
|
/**
|
|
18
18
|
* @param {AssetManager} assetManager
|
|
19
19
|
* @param {AssetRequestScope} [scope]
|
|
@@ -791,14 +791,18 @@ it is evaluated per pixel (`chunk_particle_lighting`, the model in `chunk_partic
|
|
|
791
791
|
a vertex need not be on screen, and one quad can span the frustum.
|
|
792
792
|
|
|
793
793
|
- **Direct light comes from the froxel irradiance volume** (`volumetrics/chunk_volumetrics_irradiance_sh`),
|
|
794
|
-
which `
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
`
|
|
798
|
-
|
|
799
|
-
and
|
|
800
|
-
|
|
801
|
-
|
|
794
|
+
which `shader_volumetrics_build_irradiance` writes: every directional, point and spot light at a
|
|
795
|
+
point jittered through the froxel every frame, shadowed, stored as luma SH2 + constant chroma (Metro's L1 YCoCg, 6 coefficients
|
|
796
|
+
in two `rgba16float` volumes, since `rg16float` is not a storage format without
|
|
797
|
+
`texture-formats-tier1`). The volume rides the orchestrator to side channels as
|
|
798
|
+
`volumetrics_irradiance`. Resolution is the fog's froxel grid — 16 px tiles and 64 slices — so light
|
|
799
|
+
and shadow edges inside a particle are soft. idTech 8 builds the same volume (Sousa, SIGGRAPH 2025,
|
|
800
|
+
p.29); Ghost of Tsushima lights particles from its haze grid the same way. idTech 8 builds it in the
|
|
801
|
+
pass that lights its fog, and this one did too until 2026-10-09, dimming each light by the medium
|
|
802
|
+
on its way in. That tied particle lighting to the fog's whole chain (media, sun cascades, sky LUTs),
|
|
803
|
+
so the fog could not be skipped in a scene without volumes. It now has its own pass with no medium
|
|
804
|
+
in it: a lit particle is lit as the surfaces beside it are, which the deferred and forward paths
|
|
805
|
+
never dimmed either, and the fog is composited over both. Chosen over per-pixel forward shading (UE's most expensive mode, and a
|
|
802
806
|
flat card lit that way goes black from behind), per-vertex/per-particle lighting (the light
|
|
803
807
|
clusters are screen-space: a point off screen has no light list, the artefact that moved idTech 8
|
|
804
808
|
off it) and a per-particle lighting atlas (DOOM 2016, CoD IW: best-looking, but it needs a
|
|
@@ -814,7 +818,7 @@ a vertex need not be on screen, and one quad can span the frustum.
|
|
|
814
818
|
- **Indirect light is in the same volume**, whatever the renderer's `indirect_lighting_mode`. The
|
|
815
819
|
froxel GI stage (`volumetrics/gi/`) starts the volume with one concrete module per mode — IBL,
|
|
816
820
|
Brick4, LPV — each asking its source what radiance arrives at the froxel's centre, as RGB SH2,
|
|
817
|
-
and `
|
|
821
|
+
and `shader_volumetrics_build_irradiance` adds the lights to that. The particle knows no mode: a new
|
|
818
822
|
GI system is one more module. IBL's source is `GPULightCollection.environment_sh`, the
|
|
819
823
|
environment projected to radiance SH2 when it changes (`shader_project_environment_sh`); Brick4
|
|
820
824
|
interpolates its probes (SH3, truncated) with a zero normal, which weighs every probe of the
|
|
@@ -56,7 +56,7 @@ const STORAGE_GROWABLE = GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST | GPUB
|
|
|
56
56
|
*/
|
|
57
57
|
const INDIRECT = GPUBufferUsage.STORAGE | GPUBufferUsage.INDIRECT | GPUBufferUsage.COPY_SRC;
|
|
58
58
|
|
|
59
|
-
const DEFAULT_CAPACITY =
|
|
59
|
+
const DEFAULT_CAPACITY = 131072;
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* What {@link GPUParticleSystem#read_stats} decodes: the counts the GPU keeps between frames, named.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {{keys: number, histogram: number, cursor: number, bucket_counts: number, dispatch_args: number}} ParticleBucketScratch
|
|
2
|
+
* @typedef {{keys: number, histogram: number, scanned: number, cursor: number, bucket_counts: number, dispatch_args: number}} ParticleBucketScratch
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Frame-graph wiring for the simulation-order bucketing: turns the frame's freshly compacted alive
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
*
|
|
33
33
|
* None of them asks for a clear. The reset pass covers the histogram (header, padding and the bins
|
|
34
34
|
* up to the whole `vec4` the last one lands in), the cursors and all three dispatch words; `keys`
|
|
35
|
-
* is written by the same indirect dispatch that later reads it,
|
|
36
|
-
* `bucket_count` threads.
|
|
35
|
+
* is written by the same indirect dispatch that later reads it, `bucket_counts` by the same
|
|
36
|
+
* `bucket_count` threads, and the scanned bins, header included, by the scan.
|
|
37
37
|
*
|
|
38
38
|
* @param {object} params
|
|
39
39
|
* @param {import("../../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph} params.graph
|
|
@@ -69,6 +69,7 @@ export function graph_particle_bucket({ graph, emitter_database, pool, alive, co
|
|
|
69
69
|
export type ParticleBucketScratch = {
|
|
70
70
|
keys: number;
|
|
71
71
|
histogram: number;
|
|
72
|
+
scanned: number;
|
|
72
73
|
cursor: number;
|
|
73
74
|
bucket_counts: number;
|
|
74
75
|
dispatch_args: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph_particle_bucket.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/particles/coherence/graph_particle_bucket.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graph_particle_bucket.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/particles/coherence/graph_particle_bucket.js"],"names":[],"mappings":"AAwBA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH;IAdqG,KAAK,EAA/F,OAAO,8DAA8D,EAAE,UAAU;IAClE,gBAAgB,EAA/B,MAAM;IACS,IAAI,EAAnB,MAAM;IACS,KAAK,EAApB,MAAM;IACS,QAAQ,EAAvB,MAAM;IACS,QAAQ,EAAvB,MAAM;IAIS,QAAQ,EAAvB,MAAM;IACS,YAAY,EAA3B,MAAM;IACyB,OAAO,GAAtC,qBAAqB;IACnB;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,qBAAqB,CAAA;CAAC,CA8GvG;oCAhKY;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAC"}
|
|
@@ -1,194 +1,200 @@
|
|
|
1
|
-
import { assert } from "../../../../core/assert.js";
|
|
2
|
-
import { align_4 } from "../../../../core/binary/align_4.js";
|
|
3
|
-
import { BufferResourceDescriptor } from "../../../device/graph/BufferResourceDescriptor.js";
|
|
4
|
-
import { graph_compute_indirect_pass } from "../../shader/graph/compute/graph_compute_indirect_pass.js";
|
|
5
|
-
import { graph_compute_pass } from "../../shader/graph/compute/graph_compute_pass.js";
|
|
6
|
-
import {
|
|
7
|
-
PREFIX_SCAN_CSDLDF_HEADER_WORDS,
|
|
8
|
-
} from "../../gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.js";
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* @param {
|
|
64
|
-
* @param {
|
|
65
|
-
* @param {number} params.
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* @param {number} params.
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
//
|
|
85
|
-
//
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
//
|
|
89
|
-
//
|
|
90
|
-
//
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
let
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
1
|
+
import { assert } from "../../../../core/assert.js";
|
|
2
|
+
import { align_4 } from "../../../../core/binary/align_4.js";
|
|
3
|
+
import { BufferResourceDescriptor } from "../../../device/graph/BufferResourceDescriptor.js";
|
|
4
|
+
import { graph_compute_indirect_pass } from "../../shader/graph/compute/graph_compute_indirect_pass.js";
|
|
5
|
+
import { graph_compute_pass } from "../../shader/graph/compute/graph_compute_pass.js";
|
|
6
|
+
import {
|
|
7
|
+
PREFIX_SCAN_CSDLDF_HEADER_WORDS,
|
|
8
|
+
} from "../../gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.js";
|
|
9
|
+
import {
|
|
10
|
+
graph_prefix_scan_csdldf,
|
|
11
|
+
prefix_scan_csdldf_output_descriptor
|
|
12
|
+
} from "../../gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.js";
|
|
13
|
+
import { graph_create_buffer } from "../../shader/graph/graph_create_buffer.js";
|
|
14
|
+
import { PARTICLE_SIMULATE_WORKGROUP_SIZE } from "../ParticleConstants.js";
|
|
15
|
+
import {
|
|
16
|
+
shader_particle_bucket_fill,
|
|
17
|
+
shader_particle_bucket_histogram,
|
|
18
|
+
shader_particle_bucket_pad,
|
|
19
|
+
shader_particle_bucket_reset,
|
|
20
|
+
shader_particle_bucket_scatter,
|
|
21
|
+
} from "./shader_particle_bucket.js";
|
|
22
|
+
|
|
23
|
+
const WORD = Uint32Array.BYTES_PER_ELEMENT;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @typedef {{keys: number, histogram: number, scanned: number, cursor: number, bucket_counts: number, dispatch_args: number}} ParticleBucketScratch
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Frame-graph wiring for the simulation-order bucketing: turns the frame's freshly compacted alive
|
|
31
|
+
* list into the program-coherent, workgroup-padded list NEXT frame's simulate consumes.
|
|
32
|
+
*
|
|
33
|
+
* Runs at the end of the frame, after emit and simulate have both finished appending to the alive
|
|
34
|
+
* list and before the build-indirect pass, which reads the padded length this produces
|
|
35
|
+
* ({@link PARTICLE_COUNTER.SIM_PADDED}) and turns it into next frame's dispatch args and bound.
|
|
36
|
+
*
|
|
37
|
+
* Six passes, the middle one being `graph_prefix_scan_csdldf` reused unchanged — the same scan the
|
|
38
|
+
* engine's radix sort runs its spine through. Reusing it is deliberate: it is the one prefix scan
|
|
39
|
+
* in this codebase whose only cross-workgroup wait is CSDLDF's own bounded-spin-then-fallback, so
|
|
40
|
+
* the pass makes progress on a scheduler that offers no fairness guarantee. A hand-rolled scan here
|
|
41
|
+
* would be a second place to get that wrong.
|
|
42
|
+
*
|
|
43
|
+
* Nothing on this path reads back to the CPU. The only host-supplied number is `bucket_count`, and
|
|
44
|
+
* that is static topology — it changes when the emitter set does, never as particles are born and
|
|
45
|
+
* die. The per-frame quantities (the alive count, the bin sizes, the padded total) are produced and
|
|
46
|
+
* consumed entirely on the GPU, including the dispatch size of the two per-particle passes, which
|
|
47
|
+
* the reset pass writes into `sim_dispatch_args` from the GPU's own alive count.
|
|
48
|
+
*
|
|
49
|
+
* ## The list is the feature's, the scratch is the graph's
|
|
50
|
+
*
|
|
51
|
+
* `sim_list` is the one thing here that crosses the frame boundary — this frame writes it, next
|
|
52
|
+
* frame's simulate reads it — so the feature owns it and hands it in. Everything else (the keys,
|
|
53
|
+
* the bins, the cursors, the dispatch args) is produced and consumed inside this call, so the pass
|
|
54
|
+
* that first writes each one declares it with a {@link BufferResourceDescriptor} in place of a
|
|
55
|
+
* handle, and the graph allocates and releases it around the passes that use it. `keys` is a word
|
|
56
|
+
* per particle: at the renderer's default capacity, 2 MiB the feature no longer reserves.
|
|
57
|
+
*
|
|
58
|
+
* None of them asks for a clear. The reset pass covers the histogram (header, padding and the bins
|
|
59
|
+
* up to the whole `vec4` the last one lands in), the cursors and all three dispatch words; `keys`
|
|
60
|
+
* is written by the same indirect dispatch that later reads it, `bucket_counts` by the same
|
|
61
|
+
* `bucket_count` threads, and the scanned bins, header included, by the scan.
|
|
62
|
+
*
|
|
63
|
+
* @param {object} params
|
|
64
|
+
* @param {import("../../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph} params.graph
|
|
65
|
+
* @param {number} params.emitter_database graph handle of the emitter database buffer
|
|
66
|
+
* @param {number} params.pool graph handle of the particle pool
|
|
67
|
+
* @param {number} params.alive graph handle of this frame's compacted alive list
|
|
68
|
+
* @param {number} params.counters graph handle of the atomic counters
|
|
69
|
+
* @param {number} params.sim_list graph handle of the list this rewrites. Passed in rather than
|
|
70
|
+
* imported here because the simulate pass reads it earlier in the same frame: importing the same
|
|
71
|
+
* GPUBuffer twice makes two resource entries the graph cannot see are the same memory, so the read
|
|
72
|
+
* and the write end up on separate dependency chains
|
|
73
|
+
* @param {number} params.capacity pool capacity in particles — the length of the key list
|
|
74
|
+
* @param {number} params.bucket_count number of distinct compiled programs
|
|
75
|
+
* @param {ParticleBucketScratch} [params.scratch] latest handles when bucketing again in this graph
|
|
76
|
+
* @returns {{counters: number, sim_list: number, dispatch_args: number, scratch: ParticleBucketScratch}} the threaded handles downstream passes must read
|
|
77
|
+
*/
|
|
78
|
+
export function graph_particle_bucket({ graph, emitter_database, pool, alive, counters, sim_list, capacity, bucket_count, scratch }) {
|
|
79
|
+
assert.defined(graph, "graph");
|
|
80
|
+
assert.isPositiveInteger(capacity, "capacity");
|
|
81
|
+
assert.isPositiveInteger(bucket_count, "bucket_count");
|
|
82
|
+
assert.isNonNegativeInteger(sim_list, "sim_list");
|
|
83
|
+
|
|
84
|
+
// Sized from the bucket count, which only changes when the emitter set does. Aligned up because
|
|
85
|
+
// the scan reads whole `vec4`s, so the last bin's tail is part of the buffer.
|
|
86
|
+
const bin_words = PREFIX_SCAN_CSDLDF_HEADER_WORDS + align_4(bucket_count);
|
|
87
|
+
|
|
88
|
+
// Every buffer a pass WRITES must be THREADED: the write returns a renamed (versioned) handle
|
|
89
|
+
// and the next pass must read THAT one. Reading the original handle instead leaves the ordering
|
|
90
|
+
// between the two passes unexpressed — the graph's own validator rejects it, because both
|
|
91
|
+
// versions name one piece of memory and the stale-looking read silently returns the new
|
|
92
|
+
// contents.
|
|
93
|
+
// An edit frame buckets twice. The second run is handed the first's handles, so the transients
|
|
94
|
+
// are created once and both runs share one dependency chain.
|
|
95
|
+
let keys = scratch?.keys ?? BufferResourceDescriptor.from(capacity * WORD, GPUBufferUsage.STORAGE);
|
|
96
|
+
let histogram = scratch?.histogram ?? BufferResourceDescriptor.from(bin_words * WORD, GPUBufferUsage.STORAGE);
|
|
97
|
+
let scanned = scratch?.scanned ?? graph_create_buffer(graph, "particles/bucket offsets", prefix_scan_csdldf_output_descriptor(bucket_count));
|
|
98
|
+
let cursor = scratch?.cursor ?? BufferResourceDescriptor.from(bucket_count * WORD, GPUBufferUsage.STORAGE);
|
|
99
|
+
let bucket_counts = scratch?.bucket_counts ?? BufferResourceDescriptor.from(bucket_count * WORD, GPUBufferUsage.STORAGE);
|
|
100
|
+
// Indirect args this pass writes and the two per-particle passes below consume, along with the
|
|
101
|
+
// bounds pass — hence INDIRECT on top of STORAGE.
|
|
102
|
+
let dispatch_args = scratch?.dispatch_args ?? BufferResourceDescriptor.from(
|
|
103
|
+
3 * WORD,
|
|
104
|
+
GPUBufferUsage.STORAGE | GPUBufferUsage.INDIRECT,
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
// 0. Clear the bins and cursors, write the scan's {count} header, and size the two per-particle
|
|
108
|
+
// passes below from the GPU's own alive count.
|
|
109
|
+
{
|
|
110
|
+
const out = graph_compute_pass({
|
|
111
|
+
graph,
|
|
112
|
+
shader: shader_particle_bucket_reset,
|
|
113
|
+
bindings: { counters, histogram, cursor, sim_dispatch_args: dispatch_args, u_bucket_count: bucket_count },
|
|
114
|
+
group_count: [reset_group_count(bucket_count), 1, 1],
|
|
115
|
+
});
|
|
116
|
+
counters = out.counters;
|
|
117
|
+
histogram = out.histogram;
|
|
118
|
+
cursor = out.cursor;
|
|
119
|
+
dispatch_args = out.sim_dispatch_args;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// 1. One bin per PROGRAM. Indirect, because the thread count is the alive count.
|
|
123
|
+
{
|
|
124
|
+
const out = graph_compute_indirect_pass({
|
|
125
|
+
graph,
|
|
126
|
+
shader: shader_particle_bucket_histogram,
|
|
127
|
+
bindings: { emitter_database, pool, alive, keys, histogram, counters },
|
|
128
|
+
command: dispatch_args,
|
|
129
|
+
});
|
|
130
|
+
keys = out.keys;
|
|
131
|
+
histogram = out.histogram;
|
|
132
|
+
counters = out.counters;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// 2. Round every bin up to a whole workgroup BEFORE the scan — that is what puts each bucket
|
|
136
|
+
// boundary on a wave boundary rather than in the middle of one.
|
|
137
|
+
{
|
|
138
|
+
const out = graph_compute_pass({
|
|
139
|
+
graph,
|
|
140
|
+
shader: shader_particle_bucket_pad,
|
|
141
|
+
bindings: { histogram, bucket_counts, u_bucket_count: bucket_count },
|
|
142
|
+
group_count: [Math.ceil(bucket_count / PARTICLE_SIMULATE_WORKGROUP_SIZE), 1, 1],
|
|
143
|
+
});
|
|
144
|
+
histogram = out.histogram;
|
|
145
|
+
bucket_counts = out.bucket_counts;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// 3. Inclusive prefix sums of the padded bins.
|
|
149
|
+
scanned = graph_prefix_scan_csdldf({
|
|
150
|
+
graph,
|
|
151
|
+
input: histogram,
|
|
152
|
+
output: scanned,
|
|
153
|
+
element_max_count: bucket_count,
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// 4. Place each alive entry at its bucket's offset plus an atomic rank.
|
|
157
|
+
{
|
|
158
|
+
const out = graph_compute_indirect_pass({
|
|
159
|
+
graph,
|
|
160
|
+
shader: shader_particle_bucket_scatter,
|
|
161
|
+
bindings: { keys, alive, scanned, cursor, sim_list, counters },
|
|
162
|
+
command: dispatch_args,
|
|
163
|
+
});
|
|
164
|
+
cursor = out.cursor;
|
|
165
|
+
sim_list = out.sim_list;
|
|
166
|
+
counters = out.counters;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// 5. Stamp the padding sentinel into each bucket's tail and publish the padded total. One
|
|
170
|
+
// workgroup per bucket: padding is at most a workgroup less one entry, and a bucket whose
|
|
171
|
+
// particles all died has no scatter thread to ride along with.
|
|
172
|
+
{
|
|
173
|
+
const out = graph_compute_pass({
|
|
174
|
+
graph,
|
|
175
|
+
shader: shader_particle_bucket_fill,
|
|
176
|
+
bindings: { bucket_counts, scanned, sim_list, counters, u_bucket_count: bucket_count },
|
|
177
|
+
group_count: [bucket_count, 1, 1],
|
|
178
|
+
});
|
|
179
|
+
sim_list = out.sim_list;
|
|
180
|
+
counters = out.counters;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// `dispatch_args` goes back too: it holds one workgroup per live particle, written from the
|
|
184
|
+
// GPU's own alive count, which is the shape every per-particle pass after this one needs.
|
|
185
|
+
return { counters, sim_list, dispatch_args, scratch: { keys, histogram, scanned, cursor, bucket_counts, dispatch_args } };
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Workgroups the reset pass needs to cover its widest loop — the scan header plus the bins, rounded
|
|
190
|
+
* up to the whole `vec4` the last bin lands in (the scan reads whole `vec4`s, so the tail has to be
|
|
191
|
+
* cleared too or garbage joins the sums).
|
|
192
|
+
*
|
|
193
|
+
* @param {number} bucket_count
|
|
194
|
+
* @returns {number}
|
|
195
|
+
*/
|
|
196
|
+
function reset_group_count(bucket_count) {
|
|
197
|
+
const words = PREFIX_SCAN_CSDLDF_HEADER_WORDS + align_4(bucket_count);
|
|
198
|
+
|
|
199
|
+
return Math.ceil(words / PARTICLE_SIMULATE_WORKGROUP_SIZE);
|
|
200
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph_particles.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/particles/graph_particles.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graph_particles.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/particles/graph_particles.js"],"names":[],"mappings":"AA0CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AAEH;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH;IA/BkG,KAAK,EAA5F,OAAO,2DAA2D,EAAE,UAAU;IAC/D,MAAM,EAArB,MAAM;IACS,cAAc,EAA7B,MAAM;IACS,GAAG,EAAlB,MAAM;IAGS,QAAQ;QACC,QAAQ,EAAhC,MAAM;QAEkB,WAAW,EAAnC,MAAM;;IACS,QAAQ,EAAvB,MAAM;IACS,YAAY,EAA3B,MAAM;IAEU,cAAc,EAA9B,OAAO;IAGQ,KAAK;QACC,EAAE,EAAvB,MAAM;QACe,IAAI,EAAzB,MAAM;QACe,KAAK,EAA1B,MAAM;QACiB,QAAQ,GAA/B,OAAO;QACc,WAAW,EAAhC,MAAM;QACe,mBAAmB,EAAxC,MAAM;QACe,YAAY,EAAjC,MAAM;QAGe,eAAe,EAApC,MAAM;QAC6D,eAAe,EAAlF,OAAO,6BAA6B,EAAE,cAAc;;IAElD,yBAAyB,CAiUrC;;;;;UAzWa,MAAM;;;;WACN,MAAM;;;;eACN,MAAM;;;;;sBACN,MAAM"}
|
|
@@ -2,7 +2,10 @@ import { assert } from "../../../core/assert.js";
|
|
|
2
2
|
import { align_4 } from "../../../core/binary/align_4.js";
|
|
3
3
|
import { BufferResourceDescriptor } from "../../device/graph/BufferResourceDescriptor.js";
|
|
4
4
|
import { INDIRECT_COMPUTE_COMMAND_DESCRIPTOR } from "../gpu_primitive/indirect/IndirectComputeCommandBuildPass.js";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
graph_prefix_scan_csdldf,
|
|
7
|
+
prefix_scan_csdldf_output_descriptor
|
|
8
|
+
} from "../gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.js";
|
|
6
9
|
import { PREFIX_SCAN_CSDLDF_HEADER_WORDS } from "../gpu_primitive/prefix_sum/v1/shader_prefix_scan_csdldf.js";
|
|
7
10
|
import { shader_prefix_sum_to_command } from "../rasterize/expand/mesh/shader_prefix_sum_to_command.js";
|
|
8
11
|
import { graph_particle_bounds } from "./bounds/graph_particle_bounds.js";
|
|
@@ -287,7 +290,8 @@ export function graph_particles_simulate({
|
|
|
287
290
|
// the number of particles born this frame.
|
|
288
291
|
const spawn_prefix = graph_prefix_scan_csdldf({
|
|
289
292
|
graph,
|
|
290
|
-
|
|
293
|
+
input: spawn_counts,
|
|
294
|
+
output: graph_create_buffer(graph, "particles/spawn_prefix", prefix_scan_csdldf_output_descriptor(Math.max(1, emitters.capacity))),
|
|
291
295
|
element_max_count: Math.max(1, emitters.capacity),
|
|
292
296
|
});
|
|
293
297
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* returns what it reflects and transmits (`chunk_particle_lighting_model`), from the froxel
|
|
5
5
|
* irradiance volume (`chunk_volumetrics_irradiance_sh`) at the fragment: the renderer's indirect
|
|
6
6
|
* lighting, whichever mode it runs (the froxel GI stage, `volumetrics/gi/`), plus every directional,
|
|
7
|
-
* point and spot light, shadowed,
|
|
7
|
+
* point and spot light, shadowed, as the surfaces around the particle receive them. One trilinear read of each
|
|
8
8
|
* of its two textures, so the cost grows with neither the lights nor the GI; the price is resolution —
|
|
9
9
|
* a froxel is 16 pixels across and a slice deep, and light and shadow edges inside a particle are that
|
|
10
10
|
* soft.
|
|
@@ -10,7 +10,7 @@ import { chunk_particle_lighting_model } from "./chunk_particle_lighting_model.j
|
|
|
10
10
|
* returns what it reflects and transmits (`chunk_particle_lighting_model`), from the froxel
|
|
11
11
|
* irradiance volume (`chunk_volumetrics_irradiance_sh`) at the fragment: the renderer's indirect
|
|
12
12
|
* lighting, whichever mode it runs (the froxel GI stage, `volumetrics/gi/`), plus every directional,
|
|
13
|
-
* point and spot light, shadowed,
|
|
13
|
+
* point and spot light, shadowed, as the surfaces around the particle receive them. One trilinear read of each
|
|
14
14
|
* of its two textures, so the cost grows with neither the lights nor the GI; the price is resolution —
|
|
15
15
|
* a froxel is 16 pixels across and a slice deep, and light and shadow edges inside a particle are that
|
|
16
16
|
* soft.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph_particle_warmup.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/particles/warmup/graph_particle_warmup.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graph_particle_warmup.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/particles/warmup/graph_particle_warmup.js"],"names":[],"mappings":"AAgCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH;IAtBqG,KAAK,EAA/F,OAAO,8DAA8D,EAAE,UAAU;IAClE,cAAc,EAA7B,MAAM;IACS,gBAAgB,EAA/B,MAAM;IACS,OAAO,EAAtB,MAAM;IACS,IAAI,EAAnB,MAAM;IACS,SAAS,EAAxB,MAAM;IACS,IAAI,EAAnB,MAAM;IACS,QAAQ,EAAvB,MAAM;IACS,YAAY,EAA3B,MAAM;IAEY,KAAK;IACR,WAAW,EAA1B,MAAM;IACS,aAAa,EAA5B,MAAM;IACS,QAAQ,EAAvB,MAAM;IACS,gBAAgB,EAA/B,MAAM;IACgD,QAAQ,EAA9D,OAAO,sBAAsB,EAAE,cAAc;IAC7B,cAAc,EAA9B,OAAO;IACQ,KAAK;QACC,IAAI,EAAzB,MAAM;QACe,KAAK,EAA1B,MAAM;;IACJ;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAC,CAuO7H"}
|