@woosh/meep-engine 3.52.0 → 3.53.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/package.json +1 -1
- package/src/engine/ecs/animation/Animation.d.ts +4 -25
- package/src/engine/ecs/animation/Animation.d.ts.map +1 -1
- package/src/engine/ecs/animation/Animation.js +9 -41
- package/src/engine/ecs/ik/IKGoalSystem.d.ts +4 -5
- package/src/engine/ecs/ik/IKGoalSystem.d.ts.map +1 -1
- package/src/engine/ecs/ik/IKGoalSystem.js +4 -6
- package/src/engine/graphics/ecs/mesh/assetTypeByPath.js +1 -1
- package/src/engine/graphics3/AnimationGraphSystem.d.ts +9 -22
- package/src/engine/graphics3/AnimationGraphSystem.d.ts.map +1 -1
- package/src/engine/graphics3/AnimationGraphSystem.js +58 -203
- package/src/engine/graphics3/AnimationSystem.d.ts +7 -18
- package/src/engine/graphics3/AnimationSystem.d.ts.map +1 -1
- package/src/engine/graphics3/AnimationSystem.js +62 -243
- package/src/engine/graphics3/FoliageWindSystem.d.ts +67 -0
- package/src/engine/graphics3/FoliageWindSystem.d.ts.map +1 -0
- package/src/engine/graphics3/FoliageWindSystem.js +257 -0
- package/src/engine/graphics3/GPUFluidSystem.d.ts +7 -0
- package/src/engine/graphics3/GPUFluidSystem.d.ts.map +1 -1
- package/src/engine/graphics3/GPUFluidSystem.js +39 -1
- package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts +0 -1
- package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts.map +1 -1
- package/src/engine/graphics3/GPUParticleEmitterSystem.js +19 -5
- package/src/engine/graphics3/animation/AnimationClips.d.ts +107 -13
- package/src/engine/graphics3/animation/AnimationClips.d.ts.map +1 -1
- package/src/engine/graphics3/animation/AnimationClips.js +207 -10
- package/src/engine/graphics3/animation/AnimationClipsSink.d.ts +89 -0
- package/src/engine/graphics3/animation/AnimationClipsSink.d.ts.map +1 -0
- package/src/engine/graphics3/animation/AnimationClipsSink.js +205 -0
- package/src/engine/graphics3/animation/FoliageWindRigs.d.ts +43 -0
- package/src/engine/graphics3/animation/FoliageWindRigs.d.ts.map +1 -0
- package/src/engine/graphics3/animation/FoliageWindRigs.js +69 -0
- package/src/engine/graphics3/animation/write_clip_playback.d.ts +17 -11
- package/src/engine/graphics3/animation/write_clip_playback.d.ts.map +1 -1
- package/src/engine/graphics3/animation/write_clip_playback.js +36 -27
- package/src/engine/graphics3/decal/GPUDecalRenderer.d.ts.map +1 -1
- package/src/engine/graphics3/decal/GPUDecalRenderer.js +8 -6
- package/src/engine/graphics3/decal/shader_decal_composite.d.ts.map +1 -1
- package/src/engine/graphics3/decal/shader_decal_composite.js +11 -5
- package/src/engine/graphics3/pose/collect_entity_playbacks.d.ts +7 -7
- package/src/engine/graphics3/pose/collect_entity_playbacks.d.ts.map +1 -1
- package/src/engine/graphics3/pose/collect_entity_playbacks.js +14 -15
- package/src/engine/graphics3/prefab/Prefab.d.ts +6 -0
- package/src/engine/graphics3/prefab/Prefab.d.ts.map +1 -1
- package/src/engine/graphics3/prefab/Prefab.js +169 -162
- package/src/engine/graphics3/prefab/prefab_compile.d.ts.map +1 -1
- package/src/engine/graphics3/prefab/prefab_compile.js +369 -334
- package/src/engine/graphics3/prefab/prefab_instantiate.d.ts.map +1 -1
- package/src/engine/graphics3/prefab/prefab_instantiate.js +43 -2
- package/src/engine/graphics3/terrain/chunk_terrain_material_surface.js +2 -2
- package/src/engine/physics/ecs/ContactProbeSystem.d.ts +2 -3
- package/src/engine/physics/ecs/ContactProbeSystem.d.ts.map +1 -1
- package/src/engine/physics/ecs/ContactProbeSystem.js +2 -4
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/engine/sound/simulation/PROBE_PLACEMENT.md +4 -4
- package/src/engine/sound/simulation/README.md +1 -1
- package/src/engine/sound/simulation/probe/bakeProbeField.d.ts +22 -8
- package/src/engine/sound/simulation/probe/bakeProbeField.d.ts.map +1 -1
- package/src/engine/sound/simulation/probe/bakeProbeField.js +60 -15
- package/src/engine/sound/simulation/probe/bakeProbeReflectors.d.ts.map +1 -1
- package/src/engine/sound/simulation/probe/bakeProbeReflectors.js +19 -23
- package/src/engine/sound/simulation/probe/probe_sdf_grid.d.ts +63 -17
- package/src/engine/sound/simulation/probe/probe_sdf_grid.d.ts.map +1 -1
- package/src/engine/sound/simulation/probe/probe_sdf_grid.js +67 -17
- package/src/generation/foliage/FOLIAGE_DESIGN.md +318 -0
- package/src/generation/foliage/FOLIAGE_PLAN.md +198 -0
- package/src/generation/foliage/animation/build_tree_wind_rig.d.ts +20 -0
- package/src/generation/foliage/animation/build_tree_wind_rig.d.ts.map +1 -0
- package/src/generation/foliage/animation/build_tree_wind_rig.js +108 -0
- package/src/generation/foliage/asset/TreeAsset.d.ts +86 -0
- package/src/generation/foliage/asset/TreeAsset.d.ts.map +1 -0
- package/src/generation/foliage/asset/TreeAsset.js +111 -0
- package/src/generation/foliage/asset/TreeLODAsset.d.ts +115 -0
- package/src/generation/foliage/asset/TreeLODAsset.d.ts.map +1 -0
- package/src/generation/foliage/asset/TreeLODAsset.js +346 -0
- package/src/generation/foliage/asset/generate_tree.d.ts +15 -0
- package/src/generation/foliage/asset/generate_tree.d.ts.map +1 -0
- package/src/generation/foliage/asset/generate_tree.js +93 -0
- package/src/generation/foliage/asset/place_tree.d.ts +82 -0
- package/src/generation/foliage/asset/place_tree.d.ts.map +1 -0
- package/src/generation/foliage/asset/place_tree.js +194 -0
- package/src/generation/foliage/config/BarkMaterialConfig.d.ts +120 -0
- package/src/generation/foliage/config/BarkMaterialConfig.d.ts.map +1 -0
- package/src/generation/foliage/config/BarkMaterialConfig.js +250 -0
- package/src/generation/foliage/config/BranchLevelConfig.d.ts +288 -0
- package/src/generation/foliage/config/BranchLevelConfig.d.ts.map +1 -0
- package/src/generation/foliage/config/BranchLevelConfig.js +536 -0
- package/src/generation/foliage/config/CrownConfig.d.ts +100 -0
- package/src/generation/foliage/config/CrownConfig.d.ts.map +1 -0
- package/src/generation/foliage/config/CrownConfig.js +186 -0
- package/src/generation/foliage/config/CrownEnvelopeType.d.ts +16 -0
- package/src/generation/foliage/config/CrownEnvelopeType.d.ts.map +1 -0
- package/src/generation/foliage/config/CrownEnvelopeType.js +17 -0
- package/src/generation/foliage/config/FoliageCardType.d.ts +12 -0
- package/src/generation/foliage/config/FoliageCardType.d.ts.map +1 -0
- package/src/generation/foliage/config/FoliageCardType.js +18 -0
- package/src/generation/foliage/config/FoliageConfig.d.ts +151 -0
- package/src/generation/foliage/config/FoliageConfig.d.ts.map +1 -0
- package/src/generation/foliage/config/FoliageConfig.js +283 -0
- package/src/generation/foliage/config/FoliageMaterialConfig.d.ts +90 -0
- package/src/generation/foliage/config/FoliageMaterialConfig.d.ts.map +1 -0
- package/src/generation/foliage/config/FoliageMaterialConfig.js +181 -0
- package/src/generation/foliage/config/PhyllotaxisMode.d.ts +13 -0
- package/src/generation/foliage/config/PhyllotaxisMode.d.ts.map +1 -0
- package/src/generation/foliage/config/PhyllotaxisMode.js +20 -0
- package/src/generation/foliage/config/TreeLODConfig.d.ts +87 -0
- package/src/generation/foliage/config/TreeLODConfig.d.ts.map +1 -0
- package/src/generation/foliage/config/TreeLODConfig.js +211 -0
- package/src/generation/foliage/config/TreePreset.d.ts +16 -0
- package/src/generation/foliage/config/TreePreset.d.ts.map +1 -0
- package/src/generation/foliage/config/TreePreset.js +17 -0
- package/src/generation/foliage/config/TreeSpeciesConfig.d.ts +109 -0
- package/src/generation/foliage/config/TreeSpeciesConfig.d.ts.map +1 -0
- package/src/generation/foliage/config/TreeSpeciesConfig.js +400 -0
- package/src/generation/foliage/config/TreeWindConfig.d.ts +84 -0
- package/src/generation/foliage/config/TreeWindConfig.d.ts.map +1 -0
- package/src/generation/foliage/config/TreeWindConfig.js +157 -0
- package/src/generation/foliage/index.d.ts +38 -0
- package/src/generation/foliage/index.d.ts.map +1 -0
- package/src/generation/foliage/index.js +43 -0
- package/src/generation/foliage/material/make_bark_material.d.ts +37 -0
- package/src/generation/foliage/material/make_bark_material.d.ts.map +1 -0
- package/src/generation/foliage/material/make_bark_material.js +802 -0
- package/src/generation/foliage/material/make_foliage_material.d.ts +14 -0
- package/src/generation/foliage/material/make_foliage_material.d.ts.map +1 -0
- package/src/generation/foliage/material/make_foliage_material.js +359 -0
- package/src/generation/foliage/mesh/branch_collar_project.d.ts +42 -0
- package/src/generation/foliage/mesh/branch_collar_project.d.ts.map +1 -0
- package/src/generation/foliage/mesh/branch_collar_project.js +203 -0
- package/src/generation/foliage/mesh/branch_ring_triangulate.d.ts +35 -0
- package/src/generation/foliage/mesh/branch_ring_triangulate.d.ts.map +1 -0
- package/src/generation/foliage/mesh/branch_ring_triangulate.js +72 -0
- package/src/generation/foliage/mesh/foliage_collect_attachments.d.ts +80 -0
- package/src/generation/foliage/mesh/foliage_collect_attachments.d.ts.map +1 -0
- package/src/generation/foliage/mesh/foliage_collect_attachments.js +502 -0
- package/src/generation/foliage/mesh/tree_mesh_apply_canopy_ao.d.ts +19 -0
- package/src/generation/foliage/mesh/tree_mesh_apply_canopy_ao.d.ts.map +1 -0
- package/src/generation/foliage/mesh/tree_mesh_apply_canopy_ao.js +150 -0
- package/src/generation/foliage/mesh/tree_mesh_build_bark.d.ts +55 -0
- package/src/generation/foliage/mesh/tree_mesh_build_bark.d.ts.map +1 -0
- package/src/generation/foliage/mesh/tree_mesh_build_bark.js +1047 -0
- package/src/generation/foliage/mesh/tree_mesh_build_foliage.d.ts +21 -0
- package/src/generation/foliage/mesh/tree_mesh_build_foliage.d.ts.map +1 -0
- package/src/generation/foliage/mesh/tree_mesh_build_foliage.js +415 -0
- package/src/generation/foliage/presets/make_tree_species_preset.d.ts +13 -0
- package/src/generation/foliage/presets/make_tree_species_preset.d.ts.map +1 -0
- package/src/generation/foliage/presets/make_tree_species_preset.js +837 -0
- package/src/generation/foliage/skeleton/TreeSkeleton.d.ts +443 -0
- package/src/generation/foliage/skeleton/TreeSkeleton.d.ts.map +1 -0
- package/src/generation/foliage/skeleton/TreeSkeleton.js +1100 -0
- package/src/generation/foliage/skeleton/crown_envelope_evaluate.d.ts +27 -0
- package/src/generation/foliage/skeleton/crown_envelope_evaluate.d.ts.map +1 -0
- package/src/generation/foliage/skeleton/crown_envelope_evaluate.js +121 -0
- package/src/generation/foliage/skeleton/spine_frame_double_reflection.d.ts +32 -0
- package/src/generation/foliage/skeleton/spine_frame_double_reflection.d.ts.map +1 -0
- package/src/generation/foliage/skeleton/spine_frame_double_reflection.js +87 -0
- package/src/generation/foliage/skeleton/tree_skeleton_assign_skin_joints.d.ts +33 -0
- package/src/generation/foliage/skeleton/tree_skeleton_assign_skin_joints.d.ts.map +1 -0
- package/src/generation/foliage/skeleton/tree_skeleton_assign_skin_joints.js +205 -0
- package/src/generation/foliage/skeleton/tree_skeleton_compute_pipe_radii.d.ts +14 -0
- package/src/generation/foliage/skeleton/tree_skeleton_compute_pipe_radii.d.ts.map +1 -0
- package/src/generation/foliage/skeleton/tree_skeleton_compute_pipe_radii.js +179 -0
- package/src/generation/foliage/skeleton/tree_skeleton_grow.d.ts +18 -0
- package/src/generation/foliage/skeleton/tree_skeleton_grow.d.ts.map +1 -0
- package/src/generation/foliage/skeleton/tree_skeleton_grow.js +1104 -0
- package/src/shade/playground/additive_blending/index.html +197 -0
- package/src/shade/playground/additive_blending/main.d.ts +2 -0
- package/src/shade/playground/additive_blending/main.d.ts.map +1 -0
- package/src/shade/playground/additive_blending/main.js +529 -0
- package/src/shade/playground/foliage_wind/README.md +18 -0
- package/src/shade/playground/foliage_wind/foliage_world.d.ts +127 -0
- package/src/shade/playground/foliage_wind/foliage_world.d.ts.map +1 -0
- package/src/shade/playground/foliage_wind/foliage_world.js +593 -0
- package/src/shade/playground/foliage_wind/index.html +254 -0
- package/src/shade/playground/foliage_wind/main.d.ts +2 -0
- package/src/shade/playground/foliage_wind/main.d.ts.map +1 -0
- package/src/shade/playground/foliage_wind/main.js +263 -0
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +45 -16
- package/src/shade/renderer/animation/ADDITIVE_BLENDING_PLAN.md +145 -0
- package/src/shade/renderer/animation/ANIMATION_DATABASE_SPEC.d.ts +9 -1
- package/src/shade/renderer/animation/ANIMATION_DATABASE_SPEC.d.ts.map +1 -1
- package/src/shade/renderer/animation/ANIMATION_DATABASE_SPEC.js +53 -1
- package/src/shade/renderer/animation/ANIMATION_FOLIAGE_JOINT_STRUCT.d.ts +8 -0
- package/src/shade/renderer/animation/ANIMATION_FOLIAGE_JOINT_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/animation/ANIMATION_FOLIAGE_JOINT_STRUCT.js +71 -0
- package/src/shade/renderer/animation/ANIMATION_FOLIAGE_RIG_STRUCT.d.ts +11 -0
- package/src/shade/renderer/animation/ANIMATION_FOLIAGE_RIG_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/animation/ANIMATION_FOLIAGE_RIG_STRUCT.js +32 -0
- package/src/shade/renderer/animation/GPUAnimationManager.d.ts +30 -3
- package/src/shade/renderer/animation/GPUAnimationManager.d.ts.map +1 -1
- package/src/shade/renderer/animation/GPUAnimationManager.js +532 -79
- package/src/shade/renderer/animation/POSE_ACCUMULATOR_LAYOUT.d.ts +19 -12
- package/src/shade/renderer/animation/POSE_ACCUMULATOR_LAYOUT.d.ts.map +1 -1
- package/src/shade/renderer/animation/POSE_ACCUMULATOR_LAYOUT.js +20 -13
- package/src/shade/renderer/animation/ShadeAnimationClip.d.ts +35 -8
- package/src/shade/renderer/animation/ShadeAnimationClip.d.ts.map +1 -1
- package/src/shade/renderer/animation/ShadeAnimationClip.js +433 -2
- package/src/shade/renderer/animation/chunk_pose_accumulator.d.ts.map +1 -1
- package/src/shade/renderer/animation/chunk_pose_accumulator.js +40 -32
- package/src/shade/renderer/animation/foliage/FoliageWindJoint.d.ts +97 -0
- package/src/shade/renderer/animation/foliage/FoliageWindJoint.d.ts.map +1 -0
- package/src/shade/renderer/animation/foliage/FoliageWindJoint.js +161 -0
- package/src/shade/renderer/animation/foliage/FoliageWindRig.d.ts +65 -0
- package/src/shade/renderer/animation/foliage/FoliageWindRig.d.ts.map +1 -0
- package/src/shade/renderer/animation/foliage/FoliageWindRig.js +89 -0
- package/src/shade/renderer/animation/foliage/chunk_foliage_wind_step.d.ts +19 -0
- package/src/shade/renderer/animation/foliage/chunk_foliage_wind_step.d.ts.map +1 -0
- package/src/shade/renderer/animation/foliage/chunk_foliage_wind_step.js +143 -0
- package/src/shade/renderer/animation/foliage/shader_foliage_wind_apply.d.ts +14 -0
- package/src/shade/renderer/animation/foliage/shader_foliage_wind_apply.d.ts.map +1 -0
- package/src/shade/renderer/animation/foliage/shader_foliage_wind_apply.js +116 -0
- package/src/shade/renderer/animation/pose/pose_evaluate_local.d.ts.map +1 -1
- package/src/shade/renderer/animation/pose/pose_evaluate_local.js +39 -29
- package/src/shade/renderer/animation/shader_animation_pose_resolve.js +37 -37
- package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +2 -2
- package/src/shade/renderer/extension/RenderExtension.d.ts +7 -0
- package/src/shade/renderer/extension/RenderExtension.d.ts.map +1 -1
- package/src/shade/renderer/extension/RenderExtension.js +9 -0
- package/src/shade/renderer/extension/RenderExtensionRegistry.d.ts +6 -0
- package/src/shade/renderer/extension/RenderExtensionRegistry.d.ts.map +1 -1
- package/src/shade/renderer/extension/RenderExtensionRegistry.js +15 -0
- package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +7 -0
- package/src/shade/renderer/fluid/GPUFluidCascade.d.ts.map +1 -1
- package/src/shade/renderer/fluid/GPUFluidCascade.js +15 -0
- package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +7 -0
- package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts.map +1 -1
- package/src/shade/renderer/fluid/GPUFluidCascadeStack.js +11 -0
- package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_parent.d.ts.map +1 -1
- package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_parent.js +51 -48
- package/src/shade/renderer/fluid/mac/FluidMacPasses.d.ts +6 -0
- package/src/shade/renderer/fluid/mac/FluidMacPasses.d.ts.map +1 -1
- package/src/shade/renderer/fluid/mac/FluidMacPasses.js +16 -0
- package/src/shade/renderer/fluid/mac/chunk_fluid_mac_seams.d.ts.map +1 -1
- package/src/shade/renderer/fluid/mac/chunk_fluid_mac_seams.js +15 -3
- package/src/shade/renderer/fluid/mac/chunk_v3_mac_lattice_corners.d.ts.map +1 -1
- package/src/shade/renderer/fluid/mac/chunk_v3_mac_lattice_corners.js +102 -96
- package/src/shade/renderer/fluid/mac/shader_fluid_mac_advect_correct.js +12 -12
- package/src/shade/renderer/fluid/mac/shader_fluid_mac_advect_predict.js +12 -12
- package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +7 -0
- package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts.map +1 -1
- package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.js +16 -0
- package/src/shade/renderer/fluid/publish/FluidWindPublish.d.ts +7 -0
- package/src/shade/renderer/fluid/publish/FluidWindPublish.d.ts.map +1 -1
- package/src/shade/renderer/fluid/publish/FluidWindPublish.js +10 -0
- package/src/shade/renderer/geometry/bvh/GPUBLASRefitBatch.js +2 -2
- package/src/shade/renderer/loader/SceneBundle.d.ts +7 -0
- package/src/shade/renderer/loader/SceneBundle.d.ts.map +1 -1
- package/src/shade/renderer/loader/SceneBundle.js +119 -111
- package/src/shade/renderer/material/standard/fragment_gbuffer.d.ts +4 -0
- package/src/shade/renderer/material/standard/fragment_gbuffer.d.ts.map +1 -1
- package/src/shade/renderer/material/standard/fragment_gbuffer.js +6 -5
- package/src/shade/renderer/object_property/chunk_write_object_property_node3d.d.ts +8 -7
- package/src/shade/renderer/object_property/chunk_write_object_property_node3d.d.ts.map +1 -1
- package/src/shade/renderer/object_property/chunk_write_object_property_node3d.js +9 -8
- package/src/shade/renderer/particles/GPUParticleSystem.d.ts.map +1 -1
- package/src/shade/renderer/particles/GPUParticleSystem.js +3 -1
- package/src/shade/renderer/particles/shaders/shader_particle_avboit_draw.d.ts.map +1 -1
- package/src/shade/renderer/particles/shaders/shader_particle_avboit_draw.js +9 -4
- package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.js +9 -7
- package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment.js +15 -7
- package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.js +6 -4
- package/src/shade/renderer/rasterize/native/oit/oit_resolve_fragment_body.js +3 -3
- package/src/shade/renderer/rasterize/native/oit/shader_oit_generate_moments.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/oit/shader_oit_generate_moments.js +8 -5
- package/src/shade/renderer/rasterize/native/viz/viz_rasterization_alpha_tested_pass_descriptor.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/viz/viz_rasterization_alpha_tested_pass_descriptor.js +4 -3
- package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.js +1 -1
- package/src/shade/renderer/texture/SAMPLER_ANISOTROPIC_CLAMP.d.ts +9 -0
- package/src/shade/renderer/texture/SAMPLER_ANISOTROPIC_CLAMP.d.ts.map +1 -0
- package/src/shade/renderer/texture/SAMPLER_ANISOTROPIC_CLAMP.js +17 -0
- package/src/shade/renderer/texture/SAMPLER_LINEAR_UPSCALE.d.ts +8 -0
- package/src/shade/renderer/texture/SAMPLER_LINEAR_UPSCALE.d.ts.map +1 -1
- package/src/shade/renderer/texture/SAMPLER_LINEAR_UPSCALE.js +28 -20
- package/src/shade/renderer/texture/SAMPLER_TRILINEAR_CLAMP.d.ts +8 -0
- package/src/shade/renderer/texture/SAMPLER_TRILINEAR_CLAMP.d.ts.map +1 -0
- package/src/shade/renderer/texture/SAMPLER_TRILINEAR_CLAMP.js +15 -0
- package/src/shade/renderer/view/chunk_view_mip_bias.d.ts +21 -0
- package/src/shade/renderer/view/chunk_view_mip_bias.d.ts.map +1 -0
- package/src/shade/renderer/view/chunk_view_mip_bias.js +44 -0
- package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.js +1 -1
- package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
- package/src/shade/wgsl/emulator/WGSLLanguageCore.js +105 -26
- package/src/engine/graphics/composit/CompositingStages.d.ts +0 -6
- package/src/engine/graphics/composit/CompositingStages.d.ts.map +0 -1
- package/src/engine/graphics/composit/CompositingStages.js +0 -8
- package/src/engine/graphics/geometry/buffered/computeBufferAttributeHash.d.ts +0 -7
- package/src/engine/graphics/geometry/buffered/computeBufferAttributeHash.d.ts.map +0 -1
- package/src/engine/graphics/geometry/buffered/computeBufferAttributeHash.js +0 -24
- package/src/engine/graphics/geometry/buffered/computeGeometryBoundingSphereMiniball.d.ts +0 -8
- package/src/engine/graphics/geometry/buffered/computeGeometryBoundingSphereMiniball.d.ts.map +0 -1
- package/src/engine/graphics/geometry/buffered/computeGeometryBoundingSphereMiniball.js +0 -17
- package/src/engine/graphics/geometry/buffered/computeGeometryEquality.d.ts +0 -8
- package/src/engine/graphics/geometry/buffered/computeGeometryEquality.d.ts.map +0 -1
- package/src/engine/graphics/geometry/buffered/computeGeometryEquality.js +0 -60
- package/src/engine/graphics/geometry/buffered/computeGeometryHash.d.ts +0 -7
- package/src/engine/graphics/geometry/buffered/computeGeometryHash.d.ts.map +0 -1
- package/src/engine/graphics/geometry/buffered/computeGeometryHash.js +0 -26
- package/src/engine/graphics/geometry/buffered/compute_buffer_geometry_byte_size.d.ts +0 -7
- package/src/engine/graphics/geometry/buffered/compute_buffer_geometry_byte_size.d.ts.map +0 -1
- package/src/engine/graphics/geometry/buffered/compute_buffer_geometry_byte_size.js +0 -23
- package/src/engine/graphics/geometry/instancing/geometry_copy.d.ts +0 -7
- package/src/engine/graphics/geometry/instancing/geometry_copy.d.ts.map +0 -1
- package/src/engine/graphics/geometry/instancing/geometry_copy.js +0 -15
- package/src/engine/graphics/geometry/instancing/rewriteMaterial.d.ts +0 -2
- package/src/engine/graphics/geometry/instancing/rewriteMaterial.d.ts.map +0 -1
- package/src/engine/graphics/geometry/instancing/rewriteMaterial.js +0 -57
- package/src/engine/graphics/geometry/ribbon/Quad.d.ts +0 -96
- package/src/engine/graphics/geometry/ribbon/Quad.d.ts.map +0 -1
- package/src/engine/graphics/geometry/ribbon/Quad.js +0 -213
- package/src/engine/graphics/geometry/ribbon/copyAttributeV3.d.ts +0 -9
- package/src/engine/graphics/geometry/ribbon/copyAttributeV3.d.ts.map +0 -1
- package/src/engine/graphics/geometry/ribbon/copyAttributeV3.js +0 -12
- package/src/engine/graphics/geometry/ribbon/copyAttributeValue.d.ts +0 -10
- package/src/engine/graphics/geometry/ribbon/copyAttributeValue.d.ts.map +0 -1
- package/src/engine/graphics/geometry/ribbon/copyAttributeValue.js +0 -17
- package/src/engine/graphics/geometry/ribbon/equalAttributeV3.d.ts +0 -10
- package/src/engine/graphics/geometry/ribbon/equalAttributeV3.d.ts.map +0 -1
- package/src/engine/graphics/geometry/ribbon/equalAttributeV3.js +0 -13
- package/src/engine/graphics/geometry/ribbon/equalAttributeValue.d.ts +0 -11
- package/src/engine/graphics/geometry/ribbon/equalAttributeValue.d.ts.map +0 -1
- package/src/engine/graphics/geometry/ribbon/equalAttributeValue.js +0 -24
- package/src/engine/graphics/geometry/ribbon/rotateRibbon.d.ts +0 -6
- package/src/engine/graphics/geometry/ribbon/rotateRibbon.d.ts.map +0 -1
- package/src/engine/graphics/geometry/ribbon/rotateRibbon.js +0 -37
- package/src/engine/graphics/geometry/ribbon/updateTipPosition.d.ts +0 -9
- package/src/engine/graphics/geometry/ribbon/updateTipPosition.d.ts.map +0 -1
- package/src/engine/graphics/geometry/ribbon/updateTipPosition.js +0 -52
- package/src/engine/graphics/geometry/skining/computeSkinnedMeshVertices.d.ts +0 -8
- package/src/engine/graphics/geometry/skining/computeSkinnedMeshVertices.d.ts.map +0 -1
- package/src/engine/graphics/geometry/skining/computeSkinnedMeshVertices.js +0 -54
- package/src/engine/graphics/render/RenderPassType.d.ts +0 -6
- package/src/engine/graphics/render/RenderPassType.d.ts.map +0 -1
- package/src/engine/graphics/render/RenderPassType.js +0 -8
- package/src/engine/graphics/render/layers/RenderLayer.d.ts +0 -78
- package/src/engine/graphics/render/layers/RenderLayer.d.ts.map +0 -1
- package/src/engine/graphics/render/layers/RenderLayer.js +0 -95
- package/src/engine/graphics/render/layers/RenderLayerManager.d.ts +0 -72
- package/src/engine/graphics/render/layers/RenderLayerManager.d.ts.map +0 -1
- package/src/engine/graphics/render/layers/RenderLayerManager.js +0 -160
- package/src/engine/graphics/render/layers/RenderLayerManagerState.d.ts +0 -18
- package/src/engine/graphics/render/layers/RenderLayerManagerState.d.ts.map +0 -1
- package/src/engine/graphics/render/layers/RenderLayerManagerState.js +0 -48
- package/src/engine/graphics/render/layers/RenderLayerState.d.ts +0 -18
- package/src/engine/graphics/render/layers/RenderLayerState.d.ts.map +0 -1
- package/src/engine/graphics/render/layers/RenderLayerState.js +0 -27
- package/src/engine/graphics/render/layers/RenderLayerUtils.d.ts +0 -8
- package/src/engine/graphics/render/layers/RenderLayerUtils.d.ts.map +0 -1
- package/src/engine/graphics/render/layers/RenderLayerUtils.js +0 -103
- package/src/engine/graphics/render/make_bvh_visibility_builder.d.ts +0 -10
- package/src/engine/graphics/render/make_bvh_visibility_builder.d.ts.map +0 -1
- package/src/engine/graphics/render/make_bvh_visibility_builder.js +0 -64
- package/src/engine/graphics/render/view/CameraViewFlags.d.ts +0 -7
- package/src/engine/graphics/render/view/CameraViewFlags.d.ts.map +0 -1
- package/src/engine/graphics/render/view/CameraViewFlags.js +0 -9
- package/src/engine/graphics/render/visibility/IncrementalDeltaSet.d.ts +0 -143
- package/src/engine/graphics/render/visibility/IncrementalDeltaSet.d.ts.map +0 -1
- package/src/engine/graphics/render/visibility/IncrementalDeltaSet.js +0 -328
- package/src/engine/graphics/render/visibility/VisibilityComputer.d.ts +0 -39
- package/src/engine/graphics/render/visibility/VisibilityComputer.d.ts.map +0 -1
- package/src/engine/graphics/render/visibility/VisibilityComputer.js +0 -80
- package/src/engine/graphics/render/visibility/VisibilityFilter.d.ts +0 -29
- package/src/engine/graphics/render/visibility/VisibilityFilter.d.ts.map +0 -1
- package/src/engine/graphics/render/visibility/VisibilityFilter.js +0 -37
- package/src/engine/graphics3/animation/write_graph_playback.d.ts +0 -24
- package/src/engine/graphics3/animation/write_graph_playback.d.ts.map +0 -1
- package/src/engine/graphics3/animation/write_graph_playback.js +0 -48
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import { assert } from "../../core/assert.js";
|
|
2
1
|
import { ResourceAccessKind } from "../../core/model/ResourceAccessKind.js";
|
|
3
2
|
import { ResourceAccessSpecification } from "../../core/model/ResourceAccessSpecification.js";
|
|
4
|
-
import { PosePlayback } from "../../shade/renderer/animation/pose/PosePlayback.js";
|
|
5
3
|
import { System } from "../ecs/System.js";
|
|
6
4
|
import { AnimationClips } from "./animation/AnimationClips.js";
|
|
5
|
+
import { AnimationClipsSink } from "./animation/AnimationClipsSink.js";
|
|
7
6
|
import { AnimationGraphController } from "./animation/AnimationGraphController.js";
|
|
8
|
-
import { write_graph_playback } from "./animation/write_graph_playback.js";
|
|
9
|
-
import { hold_clip_targets, register_clips, release_clip_targets, unregister_clips } from "./register_clips.js";
|
|
10
|
-
import { RowChains } from "./RowChains.js";
|
|
11
7
|
|
|
12
8
|
/**
|
|
13
|
-
* Drives every entity's {@link AnimationGraphController}: runs its clock,
|
|
14
|
-
*
|
|
9
|
+
* Drives every entity's {@link AnimationGraphController}: runs its clock, writes its clips' weights
|
|
10
|
+
* and times into the entity's {@link AnimationClips}, and hands that blend to the renderer through
|
|
11
|
+
* {@link AnimationClipsSink}.
|
|
15
12
|
*
|
|
16
13
|
* **The clips are the entity's {@link AnimationClips}.** An entity is driven while it carries both
|
|
17
14
|
* components, whoever put them there — a model `MeshSystem` loaded, or a rig built in code. New
|
|
18
15
|
* clips are a new component, which this system sees as the entity leaving and coming back.
|
|
19
16
|
*
|
|
20
|
-
* **Every node the clips key holds a row here** ({@link
|
|
17
|
+
* **Every node the clips key holds a row here** ({@link AnimationClipsSink}), from the graph being
|
|
21
18
|
* bound to the clips until they go. A clip binds only once all of them do, and a keyed node outside
|
|
22
19
|
* every skin with nothing drawn under it — a socket, say — is held by no other system.
|
|
23
20
|
*
|
|
@@ -34,29 +31,15 @@ import { RowChains } from "./RowChains.js";
|
|
|
34
31
|
*/
|
|
35
32
|
export class AnimationGraphSystem extends System {
|
|
36
33
|
/**
|
|
37
|
-
* @type {
|
|
34
|
+
* @type {AnimationClipsSink}
|
|
38
35
|
*/
|
|
39
|
-
#
|
|
36
|
+
#sink;
|
|
40
37
|
|
|
41
38
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* @type {Scene}
|
|
45
|
-
*/
|
|
46
|
-
#scene;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @type {Map<number, {controller: AnimationGraphController, clips: ShadeAnimationClip[], bound: boolean, held: boolean, clip_registration: ClipRegistration|null, slots: Int32Array, played_slots: Int32Array, clip_ids: Int32Array, weights: Float32Array, poses: PosePlayback[]}>}
|
|
39
|
+
* @type {Map<number, {controller: AnimationGraphController, clips: AnimationClips, bound: boolean, slots: Int32Array}>}
|
|
50
40
|
*/
|
|
51
41
|
#entries = new Map();
|
|
52
42
|
|
|
53
|
-
/**
|
|
54
|
-
* The chains of the nodes the clips key. Null until the system has a dataset.
|
|
55
|
-
*
|
|
56
|
-
* @type {RowChains|null}
|
|
57
|
-
*/
|
|
58
|
-
#chains = null;
|
|
59
|
-
|
|
60
43
|
/**
|
|
61
44
|
* @param {GraphicsEngine} graphics
|
|
62
45
|
* @param {Scene} scene
|
|
@@ -64,18 +47,16 @@ export class AnimationGraphSystem extends System {
|
|
|
64
47
|
constructor(graphics, scene) {
|
|
65
48
|
super();
|
|
66
49
|
|
|
67
|
-
|
|
68
|
-
assert.equal(scene?.isScene, true, 'scene.isScene !== true');
|
|
69
|
-
|
|
70
|
-
this.#graphics = graphics;
|
|
71
|
-
this.#scene = scene;
|
|
50
|
+
this.#sink = new AnimationClipsSink(graphics, scene);
|
|
72
51
|
|
|
73
52
|
this.dependencies = [AnimationGraphController, AnimationClips];
|
|
74
53
|
|
|
75
|
-
// this tick's clip times are
|
|
76
|
-
// (exact queries, IK's base pose) reads
|
|
54
|
+
// this tick's clip times and weights are written onto AnimationClips: whatever evaluates a
|
|
55
|
+
// pose from them (exact queries, IK's base pose, contact probes) reads AnimationClips and
|
|
56
|
+
// so runs after it
|
|
77
57
|
this.components_used = [
|
|
78
58
|
ResourceAccessSpecification.from(AnimationGraphController, ResourceAccessKind.Read | ResourceAccessKind.Write),
|
|
59
|
+
ResourceAccessSpecification.from(AnimationClips, ResourceAccessKind.Read | ResourceAccessKind.Write),
|
|
79
60
|
];
|
|
80
61
|
}
|
|
81
62
|
|
|
@@ -92,34 +73,15 @@ export class AnimationGraphSystem extends System {
|
|
|
92
73
|
link(controller, clips, entity) {
|
|
93
74
|
this.#entries.set(entity, {
|
|
94
75
|
controller,
|
|
95
|
-
clips
|
|
76
|
+
clips,
|
|
96
77
|
bound: false,
|
|
97
|
-
held: false,
|
|
98
|
-
clip_registration: null,
|
|
99
78
|
slots: new Int32Array(0),
|
|
100
|
-
played_slots: new Int32Array(0),
|
|
101
|
-
clip_ids: new Int32Array(0),
|
|
102
|
-
weights: new Float32Array(0),
|
|
103
|
-
poses: []
|
|
104
79
|
});
|
|
105
80
|
}
|
|
106
81
|
|
|
107
82
|
/**
|
|
108
|
-
* What the entity is playing, in the form the CPU pose evaluator takes:
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* **The clips the graph does not name are not here, because they are not registered** (D37).
|
|
112
|
-
* The GPU's accumulator marks a joint dirty for every bound clip that writes to it, weight and
|
|
113
|
-
* all — so a bound clip at weight zero resolves the joints only it drives to zero rather than
|
|
114
|
-
* leaving them at rest. The answer is not to hand those clips to the evaluator so it can make
|
|
115
|
-
* the same mistake; it is not to bind them. What the graph never names, nothing plays, and the
|
|
116
|
-
* joints it alone would have driven stay where they rest.
|
|
117
|
-
*
|
|
118
|
-
* A clip the graph names but is not currently playing **is** here, at weight zero, because it is
|
|
119
|
-
* bound and the accumulator does see it.
|
|
120
|
-
*
|
|
121
|
-
* The entries are this system's own and are rewritten by the next call, which is what keeps a
|
|
122
|
-
* query on a per-frame path from allocating.
|
|
83
|
+
* What the entity is playing, in the form the CPU pose evaluator takes: delegates to the
|
|
84
|
+
* entity's {@link AnimationClips#write_pose_playbacks}.
|
|
123
85
|
*
|
|
124
86
|
* @param {PosePlayback[]} target appended to
|
|
125
87
|
* @param {number} entity
|
|
@@ -134,43 +96,7 @@ export class AnimationGraphSystem extends System {
|
|
|
134
96
|
return false;
|
|
135
97
|
}
|
|
136
98
|
|
|
137
|
-
|
|
138
|
-
const poses = entry.poses;
|
|
139
|
-
const played = entry.played_slots;
|
|
140
|
-
|
|
141
|
-
for (let i = 0; i < played.length; i++) {
|
|
142
|
-
const slot = played[i];
|
|
143
|
-
const pose = poses[slot];
|
|
144
|
-
|
|
145
|
-
pose.clip = clips[slot];
|
|
146
|
-
pose.weight = 0;
|
|
147
|
-
pose.time = 0;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
const controller = entry.controller;
|
|
151
|
-
const slots = entry.slots;
|
|
152
|
-
const weights = controller.blendState.weights;
|
|
153
|
-
|
|
154
|
-
for (let i = 0; i < slots.length; i++) {
|
|
155
|
-
const pose = poses[slots[i]];
|
|
156
|
-
const weight = weights[i];
|
|
157
|
-
|
|
158
|
-
// assignment rather than accumulation, and it matters only where two of the graph's
|
|
159
|
-
// clips are one clip of the entity: the renderer is written to in this order too, so the
|
|
160
|
-
// last of them is what it holds
|
|
161
|
-
pose.weight = weight;
|
|
162
|
-
|
|
163
|
-
if (weight > 0) {
|
|
164
|
-
pose.time = controller.clip_time(i);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
// once each, however many of the graph's clips named it — the renderer holds one row for it
|
|
169
|
-
for (let i = 0; i < played.length; i++) {
|
|
170
|
-
target.push(poses[played[i]]);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
return true;
|
|
99
|
+
return entry.clips.write_pose_playbacks(target);
|
|
174
100
|
}
|
|
175
101
|
|
|
176
102
|
/**
|
|
@@ -183,69 +109,29 @@ export class AnimationGraphSystem extends System {
|
|
|
183
109
|
|
|
184
110
|
const entry = this.#entries.get(entity);
|
|
185
111
|
|
|
186
|
-
if (entry !== undefined) {
|
|
187
|
-
this.#
|
|
188
|
-
|
|
189
|
-
if (entry.held) {
|
|
190
|
-
release_clip_targets(this.#chains, entry.clips);
|
|
191
|
-
|
|
192
|
-
entry.held = false;
|
|
193
|
-
}
|
|
112
|
+
if (entry !== undefined && entry.bound) {
|
|
113
|
+
this.#sink.release(entry.clips);
|
|
194
114
|
}
|
|
195
115
|
|
|
196
116
|
this.#entries.delete(entity);
|
|
197
117
|
}
|
|
198
118
|
|
|
199
119
|
async startup(entityManager) {
|
|
200
|
-
|
|
201
|
-
const dataset = entityManager.dataset;
|
|
202
|
-
const scene = this.#scene;
|
|
203
|
-
|
|
204
|
-
assert.ok(
|
|
205
|
-
scene.dataset === null || scene.dataset === undefined || scene.dataset === dataset,
|
|
206
|
-
'the scene is bound to another dataset'
|
|
207
|
-
);
|
|
208
|
-
|
|
209
|
-
scene.dataset = dataset;
|
|
210
|
-
|
|
211
|
-
this.#chains = new RowChains(dataset);
|
|
120
|
+
this.#sink.startup(entityManager.dataset);
|
|
212
121
|
}
|
|
213
122
|
|
|
214
123
|
async shutdown(entityManager) {
|
|
215
124
|
for (const entry of this.#entries.values()) {
|
|
216
125
|
entry.controller.unlink();
|
|
217
126
|
|
|
218
|
-
|
|
127
|
+
if (entry.bound) {
|
|
128
|
+
this.#sink.unbind_on_shutdown(entry.clips);
|
|
129
|
+
}
|
|
219
130
|
}
|
|
220
131
|
|
|
221
132
|
this.#entries.clear();
|
|
222
133
|
|
|
223
|
-
this.#
|
|
224
|
-
this.#chains = null;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* Give this entity's clips back, if the manager that issued them is still the one running.
|
|
229
|
-
*
|
|
230
|
-
* **An id may only be handed back to the manager that issued it.** A renderer restart replaces
|
|
231
|
-
* the GPU scene context and voids every id it gave out, so a registration stamped with a context
|
|
232
|
-
* that is no longer current is forgotten rather than returned — returning it would corrupt a
|
|
233
|
-
* stranger's table. Same rule as {@link unregister_clips}, same `===`.
|
|
234
|
-
*
|
|
235
|
-
* @param {object} entry
|
|
236
|
-
*/
|
|
237
|
-
#release_clips(entry) {
|
|
238
|
-
const registration = entry.clip_registration;
|
|
239
|
-
|
|
240
|
-
if (registration === null) {
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
if (registration.context === this.#graphics.scene_context(this.#scene)) {
|
|
245
|
-
unregister_clips(registration);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
entry.clip_registration = null;
|
|
134
|
+
this.#sink.shutdown();
|
|
249
135
|
}
|
|
250
136
|
|
|
251
137
|
/**
|
|
@@ -253,37 +139,23 @@ export class AnimationGraphSystem extends System {
|
|
|
253
139
|
*/
|
|
254
140
|
update(time_delta_seconds) {
|
|
255
141
|
const ecd = this.entityManager.dataset;
|
|
142
|
+
const context = this.#sink.begin_update();
|
|
256
143
|
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
// No device — before the first start, and again after a stop. The clocks still run: a unit
|
|
260
|
-
// that fires an ability while the renderer is being replaced still fires it.
|
|
261
|
-
const manager = context === null ? null : context.animation_manager;
|
|
144
|
+
for (const [entity, entry] of this.#entries) {
|
|
145
|
+
const { controller, clips } = entry;
|
|
262
146
|
|
|
263
|
-
|
|
264
|
-
this.#chains.bind(context === null ? null : context.rows);
|
|
147
|
+
let slots_changed = false;
|
|
265
148
|
|
|
266
|
-
for (const [entity, entry] of this.#entries) {
|
|
267
149
|
if (!entry.bound) {
|
|
268
150
|
this.#bind_clips(entry, entity, ecd);
|
|
151
|
+
slots_changed = true;
|
|
269
152
|
}
|
|
270
153
|
|
|
271
|
-
|
|
154
|
+
controller.tick(time_delta_seconds);
|
|
272
155
|
|
|
273
|
-
|
|
274
|
-
continue;
|
|
275
|
-
}
|
|
156
|
+
this.#write_playback(controller, entry.slots, clips);
|
|
276
157
|
|
|
277
|
-
|
|
278
|
-
Registered against the context that is running now. A renderer restart builds a new one
|
|
279
|
-
and voids every id the old gave out, and the stamp on the registration is how that is
|
|
280
|
-
noticed — in one comparison, without depending on when anything last ran.
|
|
281
|
-
*/
|
|
282
|
-
if (entry.clip_registration === null || entry.clip_registration.context !== context) {
|
|
283
|
-
this.#bind_gpu(entry, context);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
write_graph_playback(manager, entry.controller, entry.clip_ids, entry.weights);
|
|
158
|
+
this.#sink.sync(clips, context, slots_changed);
|
|
287
159
|
}
|
|
288
160
|
}
|
|
289
161
|
|
|
@@ -297,6 +169,7 @@ export class AnimationGraphSystem extends System {
|
|
|
297
169
|
*/
|
|
298
170
|
#bind_clips(entry, entity, ecd) {
|
|
299
171
|
const clips = entry.clips;
|
|
172
|
+
const available = clips.clips;
|
|
300
173
|
|
|
301
174
|
const clip_index = entry.controller.def.clipIndex;
|
|
302
175
|
const clip_count = clip_index.length;
|
|
@@ -307,14 +180,14 @@ export class AnimationGraphSystem extends System {
|
|
|
307
180
|
for (let i = 0; i < clip_count; i++) {
|
|
308
181
|
const name = clip_index[i].name;
|
|
309
182
|
|
|
310
|
-
const slot =
|
|
183
|
+
const slot = available.findIndex(clip => clip.name === name);
|
|
311
184
|
|
|
312
185
|
if (slot === -1) {
|
|
313
186
|
throw new Error(`Animation clip '${name}' is not among the clips of entity ${entity}`);
|
|
314
187
|
}
|
|
315
188
|
|
|
316
189
|
slots[i] = slot;
|
|
317
|
-
durations[i] =
|
|
190
|
+
durations[i] = available[slot].duration;
|
|
318
191
|
}
|
|
319
192
|
|
|
320
193
|
entry.controller.unlink();
|
|
@@ -322,59 +195,41 @@ export class AnimationGraphSystem extends System {
|
|
|
322
195
|
|
|
323
196
|
entry.slots = slots;
|
|
324
197
|
|
|
325
|
-
/*
|
|
326
|
-
The distinct clips this graph plays. Two states can name one clip — an idle a hurt returns
|
|
327
|
-
to, say — and it is one row on the GPU either way, so it is one entry here: registered once,
|
|
328
|
-
reported to the pose evaluator once.
|
|
329
|
-
*/
|
|
330
|
-
const played = [];
|
|
331
|
-
|
|
332
|
-
for (let i = 0; i < clip_count; i++) {
|
|
333
|
-
if (played.indexOf(slots[i]) === -1) {
|
|
334
|
-
played.push(slots[i]);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
entry.played_slots = Int32Array.from(played);
|
|
339
|
-
|
|
340
|
-
entry.clip_ids = new Int32Array(clip_count);
|
|
341
|
-
entry.weights = new Float32Array(clip_count).fill(-1);
|
|
342
|
-
entry.poses = clips.map(() => new PosePlayback());
|
|
343
|
-
|
|
344
|
-
entry.bound = true;
|
|
345
|
-
|
|
346
198
|
// past the throw above, so a graph that cannot be bound holds nothing; and before anything
|
|
347
199
|
// registers, so the clips bind in the update that registers them
|
|
348
|
-
|
|
200
|
+
this.#sink.bind(clips);
|
|
201
|
+
clips.set_played_slots(slots);
|
|
349
202
|
|
|
350
|
-
entry.
|
|
203
|
+
entry.bound = true;
|
|
351
204
|
}
|
|
352
205
|
|
|
353
206
|
/**
|
|
354
|
-
*
|
|
207
|
+
* Copy the graph's current blend into the entity's {@link AnimationClips} sink.
|
|
355
208
|
*
|
|
356
|
-
*
|
|
357
|
-
*
|
|
358
|
-
*
|
|
359
|
-
* weight over the surplus — kept them bound, and a bound clip at weight zero resolves its joints
|
|
360
|
-
* to zero rather than to the rig's own pose.
|
|
361
|
-
*
|
|
362
|
-
* @param {object} entry
|
|
363
|
-
* @param {GPUSceneContext} context
|
|
209
|
+
* @param {AnimationGraphController} controller
|
|
210
|
+
* @param {Int32Array} slots
|
|
211
|
+
* @param {AnimationClips} clips
|
|
364
212
|
*/
|
|
365
|
-
#
|
|
366
|
-
const
|
|
213
|
+
#write_playback(controller, slots, clips) {
|
|
214
|
+
const graph_weights = controller.blendState.weights;
|
|
215
|
+
const weights = clips.weights;
|
|
216
|
+
const times = clips.times;
|
|
367
217
|
|
|
368
|
-
|
|
369
|
-
|
|
218
|
+
weights.fill(0);
|
|
219
|
+
times.fill(0);
|
|
370
220
|
|
|
371
221
|
for (let i = 0; i < slots.length; i++) {
|
|
372
|
-
|
|
373
|
-
|
|
222
|
+
const slot = slots[i];
|
|
223
|
+
const weight = graph_weights[i];
|
|
374
224
|
|
|
375
|
-
|
|
225
|
+
// assignment rather than accumulation, and it matters only where two of the graph's
|
|
226
|
+
// clips are one clip of the entity: the renderer is written to in this order too, so the
|
|
227
|
+
// last of them is what it holds
|
|
228
|
+
weights[slot] = weight;
|
|
376
229
|
|
|
377
|
-
|
|
378
|
-
|
|
230
|
+
if (weight > 0) {
|
|
231
|
+
times[slot] = controller.clip_time(i);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
379
234
|
}
|
|
380
235
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Drives every entity's {@link Animation} component: runs the clocks of the clips its list names,
|
|
3
|
-
*
|
|
3
|
+
* writes their weights and times into the entity's {@link AnimationClips}, and hands that blend to
|
|
4
|
+
* the renderer through {@link AnimationClipsSink}.
|
|
4
5
|
*
|
|
5
6
|
* The list path is what the game uses wherever there is no state machine — buildings, critters and
|
|
6
7
|
* the strategy map's groups — and {@link ClipListPlayer} is what plays it. This is the ECS half:
|
|
7
|
-
* which clips each entity has, and
|
|
8
|
-
* anything.
|
|
8
|
+
* which clips each entity has, and syncing the component's playback sink with the GPU.
|
|
9
9
|
*
|
|
10
10
|
* **The clips are the entity's {@link AnimationClips}.** An entity is driven while it carries both
|
|
11
11
|
* components, whoever put them there — a model `MeshSystem` loaded, or a rig built in code. New
|
|
12
12
|
* clips are a new component, which this system sees as the entity leaving and coming back.
|
|
13
13
|
*
|
|
14
|
-
* **Every node the clips key holds a row here** ({@link
|
|
14
|
+
* **Every node the clips key holds a row here** ({@link AnimationClipsSink}), from the clips being
|
|
15
15
|
* taken up until they go. A clip binds only once all of them do, and a keyed node outside every skin
|
|
16
16
|
* with nothing drawn under it is held by no other system.
|
|
17
17
|
*
|
|
@@ -32,7 +32,7 @@ export class AnimationSystem extends System<any> {
|
|
|
32
32
|
*/
|
|
33
33
|
constructor(graphics: GraphicsEngine, scene: Scene);
|
|
34
34
|
dependencies: (typeof Animation | typeof AnimationClips)[];
|
|
35
|
-
components_used: ResourceAccessSpecification<typeof Animation>[];
|
|
35
|
+
components_used: (ResourceAccessSpecification<typeof AnimationClips> | ResourceAccessSpecification<typeof Animation>)[];
|
|
36
36
|
/**
|
|
37
37
|
* What an entity is playing, and where each of them is.
|
|
38
38
|
*
|
|
@@ -44,18 +44,8 @@ export class AnimationSystem extends System<any> {
|
|
|
44
44
|
*/
|
|
45
45
|
playbacks_of(entity: number): ClipPlayback[];
|
|
46
46
|
/**
|
|
47
|
-
* What the entity is playing, in the form the CPU pose evaluator takes:
|
|
48
|
-
* {@link AnimationClips}
|
|
49
|
-
* given.
|
|
50
|
-
*
|
|
51
|
-
* **Only the clips the list names are here, because they are the only ones registered** (D37).
|
|
52
|
-
* The GPU's accumulator marks a joint dirty for every bound clip that writes to it, weight and
|
|
53
|
-
* all — so a bound clip at weight zero resolves the joints only it drives to zero rather than
|
|
54
|
-
* leaving them at rest. The answer is not to hand the surplus to the evaluator so it agrees with
|
|
55
|
-
* a mistake; it is not to bind them, and then a clip nothing names moves nothing.
|
|
56
|
-
*
|
|
57
|
-
* The entries are this system's own and are rewritten by the next call, which is what keeps a
|
|
58
|
-
* query on a per-frame path from allocating.
|
|
47
|
+
* What the entity is playing, in the form the CPU pose evaluator takes: delegates to the
|
|
48
|
+
* entity's {@link AnimationClips#write_pose_playbacks}.
|
|
59
49
|
*
|
|
60
50
|
* @param {PosePlayback[]} target appended to
|
|
61
51
|
* @param {number} entity
|
|
@@ -88,5 +78,4 @@ import { System } from "../ecs/System.js";
|
|
|
88
78
|
import { Animation } from "../ecs/animation/Animation.js";
|
|
89
79
|
import { AnimationClips } from "./animation/AnimationClips.js";
|
|
90
80
|
import { ResourceAccessSpecification } from "../../core/model/ResourceAccessSpecification.js";
|
|
91
|
-
import { PosePlayback } from "../../shade/renderer/animation/pose/PosePlayback.js";
|
|
92
81
|
//# sourceMappingURL=AnimationSystem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimationSystem.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/AnimationSystem.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnimationSystem.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/AnimationSystem.js"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH;IAWI;;;OAGG;IACH,oDAcC;IATG,2DAA+C;IAK/C,wHAGC;IAGL;;;;;;;;OAQG;IACH,qBAHW,MAAM,GACJ,cAAc,CAU1B;IAED;;;;;;;;;OASG;IACH,6BANW,cAAc,UACd,MAAM,GACJ,OAAO,CAYnB;IAED;;;;;;;;OAQG;IACH,gBAJW,SAAS,SACT,cAAc,UACd,MAAM,QAQhB;IAED;;;;OAIG;IACH,kBAJW,SAAS,SACT,cAAc,UACd,MAAM,QAUhB;IAED,2CAEC;IAED,4CAUC;;CAkEJ;uBAlOsB,kBAAkB;0BADf,+BAA+B;+BAE1B,+BAA+B;4CAHlB,iDAAiD"}
|