@woosh/meep-engine 3.51.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/playground/tonemap_sdr/README.md +5 -3
- package/src/shade/renderer/Renderer.d.ts +1 -1
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +88 -31
- package/src/shade/renderer/ShadeToneMappingMode.d.ts +3 -2
- package/src/shade/renderer/ShadeToneMappingMode.js +15 -4
- 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/deferred/tonemap/TonemapAces2Tables.d.ts +38 -0
- package/src/shade/renderer/deferred/tonemap/TonemapAces2Tables.d.ts.map +1 -0
- package/src/shade/renderer/deferred/tonemap/TonemapAces2Tables.js +97 -0
- package/src/shade/renderer/deferred/{TonemapDisplaySettings.d.ts → tonemap/TonemapDisplaySettings.d.ts} +1 -1
- package/src/shade/renderer/deferred/tonemap/TonemapDisplaySettings.d.ts.map +1 -0
- package/src/shade/renderer/deferred/{TonemapDisplaySettings.js → tonemap/TonemapDisplaySettings.js} +5 -5
- package/src/shade/renderer/deferred/{shader_tonemap_HDR.d.ts → tonemap/shader_tonemap_HDR.d.ts} +1 -1
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_HDR.d.ts.map +1 -0
- package/src/shade/renderer/deferred/{shader_tonemap_HDR.js → tonemap/shader_tonemap_HDR.js} +9 -9
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_HDR_aces.d.ts +17 -0
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_HDR_aces.d.ts.map +1 -0
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_HDR_aces.js +101 -0
- package/src/shade/renderer/deferred/{shader_tonemap_HDR_none.d.ts → tonemap/shader_tonemap_HDR_none.d.ts} +1 -1
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_HDR_none.d.ts.map +1 -0
- package/src/shade/renderer/deferred/{shader_tonemap_HDR_none.js → tonemap/shader_tonemap_HDR_none.js} +6 -6
- package/src/shade/renderer/deferred/{shader_tonemap_HDR_pbr_neutral.d.ts → tonemap/shader_tonemap_HDR_pbr_neutral.d.ts} +1 -1
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_HDR_pbr_neutral.d.ts.map +1 -0
- package/src/shade/renderer/deferred/{shader_tonemap_HDR_pbr_neutral.js → tonemap/shader_tonemap_HDR_pbr_neutral.js} +8 -8
- package/src/shade/renderer/deferred/{shader_tonemap_LDR.d.ts → tonemap/shader_tonemap_LDR.d.ts} +1 -1
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_LDR.d.ts.map +1 -0
- package/src/shade/renderer/deferred/{shader_tonemap_LDR.js → tonemap/shader_tonemap_LDR.js} +10 -10
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_LDR_aces.d.ts +10 -0
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_LDR_aces.d.ts.map +1 -0
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_LDR_aces.js +77 -0
- package/src/shade/renderer/deferred/{shader_tonemap_LDR_none.d.ts → tonemap/shader_tonemap_LDR_none.d.ts} +1 -1
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_LDR_none.d.ts.map +1 -0
- package/src/shade/renderer/deferred/{shader_tonemap_LDR_none.js → tonemap/shader_tonemap_LDR_none.js} +7 -7
- package/src/shade/renderer/deferred/{shader_tonemap_LDR_pbr_neutral.d.ts → tonemap/shader_tonemap_LDR_pbr_neutral.d.ts} +1 -1
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_LDR_pbr_neutral.d.ts.map +1 -0
- package/src/shade/renderer/deferred/{shader_tonemap_LDR_pbr_neutral.js → tonemap/shader_tonemap_LDR_pbr_neutral.js} +8 -8
- 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 +10 -3
- 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 +8 -1
- 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/forcing/GPUFluidForcing.d.ts +6 -6
- 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 +8 -1
- 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/fluid/query/GPUFluidQueries.d.ts +1 -1
- 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/loader/gltf/tiny-gltf.d.ts +1 -1
- 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/nss/NSS.d.ts +1 -1
- 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/shader/chunk/color/tonemap/ACES_TONE_MAPPING_BRIEF_2026_10_17.md +160 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/HDR_TONE_MAPPING_FORMS_BRIEF_2026_10_16.md +5 -1
- package/src/shade/renderer/shader/chunk/color/tonemap/SDR_TONE_MAPPING_BRIEF_2026_10_16.md +15 -5
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/aces2_transform_block.d.ts +41 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/aces2_transform_block.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/aces2_transform_block.js +692 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_aces2_output_transform.d.ts +25 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_aces2_output_transform.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_aces2_output_transform.js +446 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_aces_ue_matrices.d.ts +22 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_aces_ue_matrices.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_aces_ue_matrices.js +68 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.d.ts +32 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.js +163 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/chunk_PAPER_WHITE_NITS.d.ts +10 -3
- package/src/shade/renderer/shader/chunk/color/tonemap/chunk_PAPER_WHITE_NITS.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/tonemap/chunk_PAPER_WHITE_NITS.js +12 -4
- 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
- package/src/shade/renderer/deferred/TonemapDisplaySettings.d.ts.map +0 -1
- package/src/shade/renderer/deferred/shader_tonemap_HDR.d.ts.map +0 -1
- package/src/shade/renderer/deferred/shader_tonemap_HDR_none.d.ts.map +0 -1
- package/src/shade/renderer/deferred/shader_tonemap_HDR_pbr_neutral.d.ts.map +0 -1
- package/src/shade/renderer/deferred/shader_tonemap_LDR.d.ts.map +0 -1
- package/src/shade/renderer/deferred/shader_tonemap_LDR_none.d.ts.map +0 -1
- package/src/shade/renderer/deferred/shader_tonemap_LDR_pbr_neutral.d.ts.map +0 -1
|
@@ -1,22 +1,37 @@
|
|
|
1
1
|
import { assert } from "../../../core/assert.js";
|
|
2
|
+
import { PosePlayback } from "../../../shade/renderer/animation/pose/PosePlayback.js";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @typedef {import("../../../shade/renderer/animation/ShadeAnimationClip.js").ShadeAnimationClip} ShadeAnimationClip
|
|
6
|
+
* @typedef {import("../register_clips.js").ClipRegistration} ClipRegistration
|
|
5
7
|
*/
|
|
6
8
|
|
|
9
|
+
const EMPTY_SLOTS = new Int32Array(0);
|
|
10
|
+
const EMPTY_WEIGHTS = new Float32Array(0);
|
|
11
|
+
const EMPTY_TIMES = new Float64Array(0);
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Scratch list for deduplicating played slot indices without allocating when the set is unchanged.
|
|
15
|
+
*
|
|
16
|
+
* @type {number[]}
|
|
17
|
+
*/
|
|
18
|
+
const WANTED_SLOTS = [];
|
|
19
|
+
|
|
7
20
|
/**
|
|
8
|
-
* The clips this entity can play
|
|
9
|
-
* the joints of a rig, the nodes of a loaded model
|
|
21
|
+
* The clips this entity can play — each a {@link ShadeAnimationClip} whose channels key entities
|
|
22
|
+
* (the joints of a rig, the nodes of a loaded model) — and the playback sink where whichever driver
|
|
23
|
+
* plays them writes what each weighs and where it is playing this tick.
|
|
10
24
|
*
|
|
11
25
|
* **It lives on the entity that plays them**, beside its `Animation` or `AnimationGraphController`.
|
|
12
26
|
* A clip is one clock over many targets and describes no single one of them, so it is not a
|
|
13
27
|
* component on a joint. `AnimationSystem` and `AnimationGraphSystem` resolve the names their lists
|
|
14
|
-
* and graphs ask for against this set
|
|
15
|
-
*
|
|
28
|
+
* and graphs ask for against this set and write the resulting blend back onto it; the GPU clip
|
|
29
|
+
* uploader and the CPU pose consumers (IK, ContactProbe, cloth, `query_entity_node_world_pose`)
|
|
30
|
+
* read from here without caring which driver produced the blend.
|
|
16
31
|
*
|
|
17
32
|
* **Not `Animation.clips`.** That list says what to play — a name, a weight, a repeat count each;
|
|
18
|
-
* this says what there is to play
|
|
19
|
-
*
|
|
33
|
+
* this says what there is to play, what each of those does to which entity, and where the active
|
|
34
|
+
* driver has placed each clip this frame.
|
|
20
35
|
*
|
|
21
36
|
* A model loaded by `MeshSystem` carries one on its root, re-addressed to the entities of that
|
|
22
37
|
* placement; code that builds a rig puts one there the same way. A model with no clips carries an
|
|
@@ -26,10 +41,10 @@ import { assert } from "../../../core/assert.js";
|
|
|
26
41
|
* clip, take the component off and put another on, which the drivers see as their entity leaving
|
|
27
42
|
* and coming back.
|
|
28
43
|
*
|
|
29
|
-
* **The entities it keys go no sooner than it does.** While it is
|
|
30
|
-
* every entity a channel keys, as a skin holds its joints'. Removing one of them means
|
|
31
|
-
* off before the next frame — `prefab_instance_destroy` removes the entities and then
|
|
32
|
-
* one step — or the scene is left holding the row of an entity that is gone.
|
|
44
|
+
* **The entities it keys go no sooner than it does.** While it is bound, the driver's sink holds a
|
|
45
|
+
* row for every entity a channel keys, as a skin holds its joints'. Removing one of them means
|
|
46
|
+
* taking this off before the next frame — `prefab_instance_destroy` removes the entities and then
|
|
47
|
+
* the clips, in one step — or the scene is left holding the row of an entity that is gone.
|
|
33
48
|
*
|
|
34
49
|
* **Not saved**, for the reason `MeshSkin` is not: the channels key entities that whatever builds
|
|
35
50
|
* the rig creates, and the curves are asset data. A load rebuilds them the way it rebuilds the rig.
|
|
@@ -46,6 +61,67 @@ export class AnimationClips {
|
|
|
46
61
|
*/
|
|
47
62
|
clips = [];
|
|
48
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Whether a driver currently has these clips bound. `false` before the driver's first `update`
|
|
66
|
+
* after `link`, and `false` again once the driver unlinks or shuts down.
|
|
67
|
+
*
|
|
68
|
+
* @type {boolean}
|
|
69
|
+
*/
|
|
70
|
+
bound = false;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Distinct indices into {@link clips} that the active driver plays (and registers on the GPU),
|
|
74
|
+
* in the driver's own order.
|
|
75
|
+
*
|
|
76
|
+
* Maintained here rather than alongside the GPU registration because **the pose evaluator needs
|
|
77
|
+
* it whether or not there is a device**: `collect_entity_playbacks` answers on the CPU from the
|
|
78
|
+
* clips the driver plays, and a game with rendering disabled still asks (I-4).
|
|
79
|
+
*
|
|
80
|
+
* @type {Int32Array}
|
|
81
|
+
*/
|
|
82
|
+
played_slots = EMPTY_SLOTS;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* What each of {@link clips} weighs this tick, in {@link clips}' order and at `f32` width — the
|
|
86
|
+
* width the renderer's clip table takes, so the CPU pose evaluator and the GPU agree on every
|
|
87
|
+
* share.
|
|
88
|
+
*
|
|
89
|
+
* @type {Float32Array}
|
|
90
|
+
*/
|
|
91
|
+
weights = EMPTY_WEIGHTS;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Where each of {@link clips} is playing this tick, in seconds from its start, in {@link clips}'
|
|
95
|
+
* order.
|
|
96
|
+
*
|
|
97
|
+
* @type {Float64Array}
|
|
98
|
+
*/
|
|
99
|
+
times = EMPTY_TIMES;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* One reusable {@link PosePlayback} per entry of {@link clips}, rewritten by
|
|
103
|
+
* {@link write_pose_playbacks} so per-frame CPU pose queries allocate nothing.
|
|
104
|
+
*
|
|
105
|
+
* @type {PosePlayback[]}
|
|
106
|
+
*/
|
|
107
|
+
poses = [];
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The active GPU registration for {@link played_slots}, or `null` when no device context has
|
|
111
|
+
* registered them yet.
|
|
112
|
+
*
|
|
113
|
+
* @type {ClipRegistration|null}
|
|
114
|
+
*/
|
|
115
|
+
clip_registration = null;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* The weight each entry of {@link clips} was last given on the GPU (`-1` where not yet written
|
|
119
|
+
* to the current registration).
|
|
120
|
+
*
|
|
121
|
+
* @type {Float32Array}
|
|
122
|
+
*/
|
|
123
|
+
written = EMPTY_WEIGHTS;
|
|
124
|
+
|
|
49
125
|
/**
|
|
50
126
|
* @param {ShadeAnimationClip[]} clips may be empty
|
|
51
127
|
* @returns {AnimationClips}
|
|
@@ -63,6 +139,127 @@ export class AnimationClips {
|
|
|
63
139
|
|
|
64
140
|
return r;
|
|
65
141
|
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Prepare the playback buffers when a driver takes up these clips.
|
|
145
|
+
*/
|
|
146
|
+
bind() {
|
|
147
|
+
const clips = this.clips;
|
|
148
|
+
const count = clips.length;
|
|
149
|
+
|
|
150
|
+
this.played_slots = EMPTY_SLOTS;
|
|
151
|
+
this.weights = new Float32Array(count);
|
|
152
|
+
this.times = new Float64Array(count);
|
|
153
|
+
this.poses = clips.map(clip => PosePlayback.from(clip, 0, 0));
|
|
154
|
+
this.clip_registration = null;
|
|
155
|
+
this.written = new Float32Array(count).fill(-1);
|
|
156
|
+
this.bound = true;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Clear the playback state when the driver releases these clips.
|
|
161
|
+
*/
|
|
162
|
+
unbind() {
|
|
163
|
+
this.bound = false;
|
|
164
|
+
this.played_slots = EMPTY_SLOTS;
|
|
165
|
+
this.weights = EMPTY_WEIGHTS;
|
|
166
|
+
this.times = EMPTY_TIMES;
|
|
167
|
+
this.poses = [];
|
|
168
|
+
this.clip_registration = null;
|
|
169
|
+
this.written = EMPTY_WEIGHTS;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Update which of {@link clips} the driver plays, deduplicated in order of first appearance.
|
|
174
|
+
*
|
|
175
|
+
* Two entries of a clip list or two states of a graph can name one clip, and it is one row on
|
|
176
|
+
* the GPU either way — registered once, and reported to the pose evaluator once.
|
|
177
|
+
*
|
|
178
|
+
* @param {ArrayLike<number>} slots indices into {@link clips}
|
|
179
|
+
* @returns {boolean} whether the distinct set changed
|
|
180
|
+
*/
|
|
181
|
+
set_played_slots(slots) {
|
|
182
|
+
const played = this.played_slots;
|
|
183
|
+
const wanted = WANTED_SLOTS;
|
|
184
|
+
|
|
185
|
+
wanted.length = 0;
|
|
186
|
+
|
|
187
|
+
for (let i = 0; i < slots.length; i++) {
|
|
188
|
+
const slot = slots[i];
|
|
189
|
+
|
|
190
|
+
if (wanted.indexOf(slot) === -1) {
|
|
191
|
+
wanted.push(slot);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (wanted.length === played.length) {
|
|
196
|
+
let same = true;
|
|
197
|
+
|
|
198
|
+
for (let i = 0; i < wanted.length; i++) {
|
|
199
|
+
if (played[i] !== wanted[i]) {
|
|
200
|
+
same = false;
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if (same) {
|
|
206
|
+
wanted.length = 0;
|
|
207
|
+
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
this.played_slots = Int32Array.from(wanted);
|
|
213
|
+
|
|
214
|
+
wanted.length = 0;
|
|
215
|
+
|
|
216
|
+
return true;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* What the entity is playing, in the form the CPU pose evaluator takes: one entry per clip of
|
|
221
|
+
* {@link clips} in {@link played_slots}, at the weight and the time the renderer has been given.
|
|
222
|
+
*
|
|
223
|
+
* **Only the clips the driver names are here, because they are the only ones registered** (D37).
|
|
224
|
+
* The GPU's accumulator marks a joint dirty for every bound clip that writes to it, weight and
|
|
225
|
+
* all — so a bound clip at weight zero resolves the joints only it drives to zero rather than
|
|
226
|
+
* leaving them at rest. The answer is not to hand the surplus to the evaluator so it agrees
|
|
227
|
+
* with a mistake; it is not to bind them, and then a clip nothing names moves nothing.
|
|
228
|
+
*
|
|
229
|
+
* A clip the driver names that is not currently playing **is** here, at weight zero, because it
|
|
230
|
+
* is bound and the accumulator does see it.
|
|
231
|
+
*
|
|
232
|
+
* The entries are this component's own and are rewritten by the next call, which is what keeps
|
|
233
|
+
* a query on a per-frame path from allocating.
|
|
234
|
+
*
|
|
235
|
+
* @param {PosePlayback[]} target appended to
|
|
236
|
+
* @returns {boolean} whether a driver has bound these clips — `false` when no driver is playing
|
|
237
|
+
* them, or when they arrived since the driver's last update
|
|
238
|
+
*/
|
|
239
|
+
write_pose_playbacks(target) {
|
|
240
|
+
if (!this.bound) {
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const clips = this.clips;
|
|
245
|
+
const weights = this.weights;
|
|
246
|
+
const times = this.times;
|
|
247
|
+
const poses = this.poses;
|
|
248
|
+
const played = this.played_slots;
|
|
249
|
+
|
|
250
|
+
for (let i = 0; i < played.length; i++) {
|
|
251
|
+
const slot = played[i];
|
|
252
|
+
const pose = poses[slot];
|
|
253
|
+
|
|
254
|
+
pose.clip = clips[slot];
|
|
255
|
+
pose.weight = weights[slot];
|
|
256
|
+
pose.time = times[slot];
|
|
257
|
+
|
|
258
|
+
target.push(pose);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
return true;
|
|
262
|
+
}
|
|
66
263
|
}
|
|
67
264
|
|
|
68
265
|
/**
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import("../../ecs/EntityComponentDataset.js").EntityComponentDataset} EntityComponentDataset
|
|
3
|
+
* @typedef {import("../../../shade/renderer/scene/GPUSceneContext.js").GPUSceneContext} GPUSceneContext
|
|
4
|
+
* @typedef {import("../../../shade/renderer/scene/Scene.js").Scene} Scene
|
|
5
|
+
* @typedef {import("../GraphicsEngine.js").GraphicsEngine} GraphicsEngine
|
|
6
|
+
* @typedef {import("./AnimationClips.js").AnimationClips} AnimationClips
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Connects an animation driver (`AnimationSystem` or `AnimationGraphSystem`) to the scene's GPU
|
|
10
|
+
* context for every {@link AnimationClips} component the driver plays:
|
|
11
|
+
*
|
|
12
|
+
* - **Holds a row chain for every node the clips key** ({@link hold_clip_targets}), from the clips
|
|
13
|
+
* being bound until they go. A clip binds on the GPU only once every node it keys holds a row, and
|
|
14
|
+
* a keyed node outside every skin with nothing drawn under it is held by no other system.
|
|
15
|
+
* - **Registers only the clips the driver names** ({@link AnimationClips#played_slots}), and
|
|
16
|
+
* re-registers when that set moves or when a renderer restart replaces the GPU scene context.
|
|
17
|
+
* - **Pushes this tick's weights and times** from {@link AnimationClips} to
|
|
18
|
+
* {@link GPUAnimationManager} via {@link write_clip_playback}.
|
|
19
|
+
*
|
|
20
|
+
* @author Alex Goldring
|
|
21
|
+
* @copyright Company Named Limited (c) 2026
|
|
22
|
+
*/
|
|
23
|
+
export class AnimationClipsSink {
|
|
24
|
+
/**
|
|
25
|
+
* @param {GraphicsEngine} graphics
|
|
26
|
+
* @param {Scene} scene
|
|
27
|
+
*/
|
|
28
|
+
constructor(graphics: GraphicsEngine, scene: Scene);
|
|
29
|
+
/**
|
|
30
|
+
* Bind the scene to the dataset and start tracking row chains for keyed nodes.
|
|
31
|
+
*
|
|
32
|
+
* @param {EntityComponentDataset} dataset
|
|
33
|
+
*/
|
|
34
|
+
startup(dataset: EntityComponentDataset): void;
|
|
35
|
+
/**
|
|
36
|
+
* Release the GPU registration and playback state of one {@link AnimationClips} during system
|
|
37
|
+
* shutdown, leaving row-chain teardown to {@link shutdown}.
|
|
38
|
+
*
|
|
39
|
+
* @param {AnimationClips} clips
|
|
40
|
+
*/
|
|
41
|
+
unbind_on_shutdown(clips: AnimationClips): void;
|
|
42
|
+
/**
|
|
43
|
+
* Tear down the row chains on system shutdown.
|
|
44
|
+
*/
|
|
45
|
+
shutdown(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Bind the row chains to the current GPU context's rows and answer that context.
|
|
48
|
+
*
|
|
49
|
+
* No device — before the first start, and again after a stop — answers `null`. The driver's
|
|
50
|
+
* clocks still run; holds are recorded and acquired in whole when a context arrives.
|
|
51
|
+
*
|
|
52
|
+
* @returns {GPUSceneContext|null}
|
|
53
|
+
*/
|
|
54
|
+
begin_update(): GPUSceneContext | null;
|
|
55
|
+
/**
|
|
56
|
+
* Take up an entity's {@link AnimationClips}: allocate its playback buffers and hold a row chain
|
|
57
|
+
* for every node its channels key.
|
|
58
|
+
*
|
|
59
|
+
* Called before anything registers, so the clips bind on the GPU in the update that registers
|
|
60
|
+
* them.
|
|
61
|
+
*
|
|
62
|
+
* @param {AnimationClips} clips
|
|
63
|
+
*/
|
|
64
|
+
bind(clips: AnimationClips): void;
|
|
65
|
+
/**
|
|
66
|
+
* Let go of an entity's {@link AnimationClips}: return its GPU registration if the manager that
|
|
67
|
+
* issued it is still current, release the row chains held for its targets, and clear its
|
|
68
|
+
* playback state.
|
|
69
|
+
*
|
|
70
|
+
* @param {AnimationClips} clips
|
|
71
|
+
*/
|
|
72
|
+
release(clips: AnimationClips): void;
|
|
73
|
+
/**
|
|
74
|
+
* Keep the GPU registration equal to {@link AnimationClips#played_slots} on the current context,
|
|
75
|
+
* and write this tick's weights and times down to the animation manager.
|
|
76
|
+
*
|
|
77
|
+
* @param {AnimationClips} clips
|
|
78
|
+
* @param {GPUSceneContext|null} context
|
|
79
|
+
* @param {boolean} slots_changed whether {@link AnimationClips#played_slots} changed this tick
|
|
80
|
+
*/
|
|
81
|
+
sync(clips: AnimationClips, context: GPUSceneContext | null, slots_changed: boolean): void;
|
|
82
|
+
#private;
|
|
83
|
+
}
|
|
84
|
+
export type EntityComponentDataset = import("../../ecs/EntityComponentDataset.js").EntityComponentDataset;
|
|
85
|
+
export type GPUSceneContext = import("../../../shade/renderer/scene/GPUSceneContext.js").GPUSceneContext;
|
|
86
|
+
export type Scene = import("../../../shade/renderer/scene/Scene.js").Scene;
|
|
87
|
+
export type GraphicsEngine = import("../GraphicsEngine.js").GraphicsEngine;
|
|
88
|
+
export type AnimationClips = import("./AnimationClips.js").AnimationClips;
|
|
89
|
+
//# sourceMappingURL=AnimationClipsSink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnimationClipsSink.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics3/animation/AnimationClipsSink.js"],"names":[],"mappings":"AAKA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;GAcG;AACH;IAoBI;;;OAGG;IACH,sBAHW,cAAc,SACd,KAAK,EAQf;IAED;;;;OAIG;IACH,iBAFW,sBAAsB,QAchC;IAED;;;;;OAKG;IACH,0BAFW,cAAc,QAMxB;IAED;;OAEG;IACH,iBAGC;IAED;;;;;;;OAOG;IACH,gBAFa,eAAe,GAAC,IAAI,CAShC;IAED;;;;;;;;OAQG;IACH,YAFW,cAAc,QAUxB;IAED;;;;;;OAMG;IACH,eAFW,cAAc,QAYxB;IAED;;;;;;;OAOG;IACH,YAJW,cAAc,WACd,eAAe,GAAC,IAAI,iBACpB,OAAO,QAmBjB;;CAyBJ;qCAtMY,OAAO,qCAAqC,EAAE,sBAAsB;8BACpE,OAAO,kDAAkD,EAAE,eAAe;oBAC1E,OAAO,wCAAwC,EAAE,KAAK;6BACtD,OAAO,sBAAsB,EAAE,cAAc;6BAC7C,OAAO,qBAAqB,EAAE,cAAc"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { assert } from "../../../core/assert.js";
|
|
2
|
+
import { hold_clip_targets, register_clips, release_clip_targets, unregister_clips } from "../register_clips.js";
|
|
3
|
+
import { RowChains } from "../RowChains.js";
|
|
4
|
+
import { write_clip_playback } from "./write_clip_playback.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {import("../../ecs/EntityComponentDataset.js").EntityComponentDataset} EntityComponentDataset
|
|
8
|
+
* @typedef {import("../../../shade/renderer/scene/GPUSceneContext.js").GPUSceneContext} GPUSceneContext
|
|
9
|
+
* @typedef {import("../../../shade/renderer/scene/Scene.js").Scene} Scene
|
|
10
|
+
* @typedef {import("../GraphicsEngine.js").GraphicsEngine} GraphicsEngine
|
|
11
|
+
* @typedef {import("./AnimationClips.js").AnimationClips} AnimationClips
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Connects an animation driver (`AnimationSystem` or `AnimationGraphSystem`) to the scene's GPU
|
|
16
|
+
* context for every {@link AnimationClips} component the driver plays:
|
|
17
|
+
*
|
|
18
|
+
* - **Holds a row chain for every node the clips key** ({@link hold_clip_targets}), from the clips
|
|
19
|
+
* being bound until they go. A clip binds on the GPU only once every node it keys holds a row, and
|
|
20
|
+
* a keyed node outside every skin with nothing drawn under it is held by no other system.
|
|
21
|
+
* - **Registers only the clips the driver names** ({@link AnimationClips#played_slots}), and
|
|
22
|
+
* re-registers when that set moves or when a renderer restart replaces the GPU scene context.
|
|
23
|
+
* - **Pushes this tick's weights and times** from {@link AnimationClips} to
|
|
24
|
+
* {@link GPUAnimationManager} via {@link write_clip_playback}.
|
|
25
|
+
*
|
|
26
|
+
* @author Alex Goldring
|
|
27
|
+
* @copyright Company Named Limited (c) 2026
|
|
28
|
+
*/
|
|
29
|
+
export class AnimationClipsSink {
|
|
30
|
+
/**
|
|
31
|
+
* @type {GraphicsEngine}
|
|
32
|
+
*/
|
|
33
|
+
#graphics;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The scene whose GPU context issues the clip ids.
|
|
37
|
+
*
|
|
38
|
+
* @type {Scene}
|
|
39
|
+
*/
|
|
40
|
+
#scene;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The chains of the nodes the clips key. Null until the driver has a dataset.
|
|
44
|
+
*
|
|
45
|
+
* @type {RowChains|null}
|
|
46
|
+
*/
|
|
47
|
+
#chains = null;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @param {GraphicsEngine} graphics
|
|
51
|
+
* @param {Scene} scene
|
|
52
|
+
*/
|
|
53
|
+
constructor(graphics, scene) {
|
|
54
|
+
assert.defined(graphics, 'graphics');
|
|
55
|
+
assert.equal(scene?.isScene, true, 'scene.isScene !== true');
|
|
56
|
+
|
|
57
|
+
this.#graphics = graphics;
|
|
58
|
+
this.#scene = scene;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Bind the scene to the dataset and start tracking row chains for keyed nodes.
|
|
63
|
+
*
|
|
64
|
+
* @param {EntityComponentDataset} dataset
|
|
65
|
+
*/
|
|
66
|
+
startup(dataset) {
|
|
67
|
+
// the scene's rows are this dataset's entities; the first system to place one says so
|
|
68
|
+
const scene = this.#scene;
|
|
69
|
+
|
|
70
|
+
assert.ok(
|
|
71
|
+
scene.dataset === null || scene.dataset === undefined || scene.dataset === dataset,
|
|
72
|
+
'the scene is bound to another dataset'
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
scene.dataset = dataset;
|
|
76
|
+
|
|
77
|
+
this.#chains = new RowChains(dataset);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Release the GPU registration and playback state of one {@link AnimationClips} during system
|
|
82
|
+
* shutdown, leaving row-chain teardown to {@link shutdown}.
|
|
83
|
+
*
|
|
84
|
+
* @param {AnimationClips} clips
|
|
85
|
+
*/
|
|
86
|
+
unbind_on_shutdown(clips) {
|
|
87
|
+
this.#release_registration(clips);
|
|
88
|
+
|
|
89
|
+
clips.unbind();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Tear down the row chains on system shutdown.
|
|
94
|
+
*/
|
|
95
|
+
shutdown() {
|
|
96
|
+
this.#chains.destroy();
|
|
97
|
+
this.#chains = null;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Bind the row chains to the current GPU context's rows and answer that context.
|
|
102
|
+
*
|
|
103
|
+
* No device — before the first start, and again after a stop — answers `null`. The driver's
|
|
104
|
+
* clocks still run; holds are recorded and acquired in whole when a context arrives.
|
|
105
|
+
*
|
|
106
|
+
* @returns {GPUSceneContext|null}
|
|
107
|
+
*/
|
|
108
|
+
begin_update() {
|
|
109
|
+
const context = this.#graphics.scene_context(this.#scene);
|
|
110
|
+
|
|
111
|
+
// a new context after a restart is acquired in whole; until there is one, holds are recorded
|
|
112
|
+
this.#chains.bind(context === null ? null : context.rows);
|
|
113
|
+
|
|
114
|
+
return context;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Take up an entity's {@link AnimationClips}: allocate its playback buffers and hold a row chain
|
|
119
|
+
* for every node its channels key.
|
|
120
|
+
*
|
|
121
|
+
* Called before anything registers, so the clips bind on the GPU in the update that registers
|
|
122
|
+
* them.
|
|
123
|
+
*
|
|
124
|
+
* @param {AnimationClips} clips
|
|
125
|
+
*/
|
|
126
|
+
bind(clips) {
|
|
127
|
+
if (clips.bound) {
|
|
128
|
+
this.release(clips);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
clips.bind();
|
|
132
|
+
|
|
133
|
+
hold_clip_targets(this.#chains, clips.clips);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Let go of an entity's {@link AnimationClips}: return its GPU registration if the manager that
|
|
138
|
+
* issued it is still current, release the row chains held for its targets, and clear its
|
|
139
|
+
* playback state.
|
|
140
|
+
*
|
|
141
|
+
* @param {AnimationClips} clips
|
|
142
|
+
*/
|
|
143
|
+
release(clips) {
|
|
144
|
+
if (!clips.bound) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
this.#release_registration(clips);
|
|
149
|
+
|
|
150
|
+
release_clip_targets(this.#chains, clips.clips);
|
|
151
|
+
|
|
152
|
+
clips.unbind();
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Keep the GPU registration equal to {@link AnimationClips#played_slots} on the current context,
|
|
157
|
+
* and write this tick's weights and times down to the animation manager.
|
|
158
|
+
*
|
|
159
|
+
* @param {AnimationClips} clips
|
|
160
|
+
* @param {GPUSceneContext|null} context
|
|
161
|
+
* @param {boolean} slots_changed whether {@link AnimationClips#played_slots} changed this tick
|
|
162
|
+
*/
|
|
163
|
+
sync(clips, context, slots_changed) {
|
|
164
|
+
if (context === null) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const registration = clips.clip_registration;
|
|
169
|
+
|
|
170
|
+
if (slots_changed || registration === null || registration.context !== context) {
|
|
171
|
+
this.#release_registration(clips);
|
|
172
|
+
|
|
173
|
+
clips.clip_registration = register_clips(context, clips.clips, clips.played_slots);
|
|
174
|
+
|
|
175
|
+
// whatever the last registration was told is not what this one knows
|
|
176
|
+
clips.written.fill(-1);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
write_clip_playback(context.animation_manager, clips);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Give these clips' registration back, if the manager that issued it is still the one running.
|
|
184
|
+
*
|
|
185
|
+
* **An id may only be handed back to the manager that issued it.** A renderer restart replaces
|
|
186
|
+
* the GPU scene context and voids every id it gave out, so a registration stamped with a context
|
|
187
|
+
* that is no longer current is forgotten rather than returned — returning it would corrupt a
|
|
188
|
+
* stranger's table.
|
|
189
|
+
*
|
|
190
|
+
* @param {AnimationClips} clips
|
|
191
|
+
*/
|
|
192
|
+
#release_registration(clips) {
|
|
193
|
+
const registration = clips.clip_registration;
|
|
194
|
+
|
|
195
|
+
if (registration === null) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (registration.context === this.#graphics.scene_context(this.#scene)) {
|
|
200
|
+
unregister_clips(registration);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
clips.clip_registration = null;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The procedural foliage wind rigs a model came with, re-addressed to one placed instance's entities.
|
|
3
|
+
*
|
|
4
|
+
* **What it is for.** {@link prefab_instantiate} puts one of these on the root of a placed foliage
|
|
5
|
+
* model when the prefab carries {@link Prefab#foliage_rigs}, with every joint's `target` and the
|
|
6
|
+
* rig's `root` rewritten from the prefab's node index to the entity that node became in the
|
|
7
|
+
* instance. {@link FoliageWindSystem} pairs it with a {@link Transform64} on the same entity:
|
|
8
|
+
* `FoliageWindRigs` is *what* aeroelastic bone rigs the tree has and their blend weight, and
|
|
9
|
+
* `FoliageWindSystem` registers them with {@link GPUAnimationManager} and holds their scene rows.
|
|
10
|
+
*/
|
|
11
|
+
export class FoliageWindRigs {
|
|
12
|
+
/**
|
|
13
|
+
* @param {FoliageWindRig[]} [rigs]
|
|
14
|
+
* @param {number} [weight=1]
|
|
15
|
+
* @returns {FoliageWindRigs}
|
|
16
|
+
*/
|
|
17
|
+
static from(rigs?: FoliageWindRig[], weight?: number): FoliageWindRigs;
|
|
18
|
+
/**
|
|
19
|
+
* Each rig's `root` and every joint's `target` are entity ids in the dataset this component
|
|
20
|
+
* lives in.
|
|
21
|
+
*
|
|
22
|
+
* @type {FoliageWindRig[]}
|
|
23
|
+
*/
|
|
24
|
+
rigs: FoliageWindRig[];
|
|
25
|
+
/**
|
|
26
|
+
* Blend weight applied to all foliage wind rigs on this entity in `[0, 1]` (or `>= 0`). Setting
|
|
27
|
+
* `weight = 0` disables wind contribution in `GPUAnimationManager`'s pose accumulator.
|
|
28
|
+
*
|
|
29
|
+
* @type {number}
|
|
30
|
+
*/
|
|
31
|
+
weight: number;
|
|
32
|
+
/**
|
|
33
|
+
* @readonly
|
|
34
|
+
* @type {boolean}
|
|
35
|
+
*/
|
|
36
|
+
readonly isFoliageWindRigs: boolean;
|
|
37
|
+
}
|
|
38
|
+
export namespace FoliageWindRigs {
|
|
39
|
+
let typeName: string;
|
|
40
|
+
let serializable: boolean;
|
|
41
|
+
}
|
|
42
|
+
import { FoliageWindRig } from "../../../shade/renderer/animation/foliage/FoliageWindRig.js";
|
|
43
|
+
//# sourceMappingURL=FoliageWindRigs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FoliageWindRigs.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics3/animation/FoliageWindRigs.js"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH;IAiBI;;;;OAIG;IACH,mBAJW,cAAc,EAAE,WAChB,MAAM,GACJ,eAAe,CAgB3B;IAnCD;;;;;OAKG;IACH,MAFU,cAAc,EAAE,CAEhB;IAEV;;;;;OAKG;IACH,QAFU,MAAM,CAEL;IAwBf;;;OAGG;IACH,4BAFU,OAAO,CAE0B;CAN1C;;kBAUS,MAAM;sBAMN,OAAO;;+BAjEc,6DAA6D"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { assert } from "../../../core/assert.js";
|
|
2
|
+
import { FoliageWindRig } from "../../../shade/renderer/animation/foliage/FoliageWindRig.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The procedural foliage wind rigs a model came with, re-addressed to one placed instance's entities.
|
|
6
|
+
*
|
|
7
|
+
* **What it is for.** {@link prefab_instantiate} puts one of these on the root of a placed foliage
|
|
8
|
+
* model when the prefab carries {@link Prefab#foliage_rigs}, with every joint's `target` and the
|
|
9
|
+
* rig's `root` rewritten from the prefab's node index to the entity that node became in the
|
|
10
|
+
* instance. {@link FoliageWindSystem} pairs it with a {@link Transform64} on the same entity:
|
|
11
|
+
* `FoliageWindRigs` is *what* aeroelastic bone rigs the tree has and their blend weight, and
|
|
12
|
+
* `FoliageWindSystem` registers them with {@link GPUAnimationManager} and holds their scene rows.
|
|
13
|
+
*/
|
|
14
|
+
export class FoliageWindRigs {
|
|
15
|
+
/**
|
|
16
|
+
* Each rig's `root` and every joint's `target` are entity ids in the dataset this component
|
|
17
|
+
* lives in.
|
|
18
|
+
*
|
|
19
|
+
* @type {FoliageWindRig[]}
|
|
20
|
+
*/
|
|
21
|
+
rigs = [];
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Blend weight applied to all foliage wind rigs on this entity in `[0, 1]` (or `>= 0`). Setting
|
|
25
|
+
* `weight = 0` disables wind contribution in `GPUAnimationManager`'s pose accumulator.
|
|
26
|
+
*
|
|
27
|
+
* @type {number}
|
|
28
|
+
*/
|
|
29
|
+
weight = 1;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @param {FoliageWindRig[]} [rigs]
|
|
33
|
+
* @param {number} [weight=1]
|
|
34
|
+
* @returns {FoliageWindRigs}
|
|
35
|
+
*/
|
|
36
|
+
static from(rigs = [], weight = 1) {
|
|
37
|
+
assert.isArray(rigs, 'rigs');
|
|
38
|
+
assert.isNumber(weight, 'weight');
|
|
39
|
+
|
|
40
|
+
for (let i = 0; i < rigs.length; i++) {
|
|
41
|
+
assert.isInstanceOf(rigs[i], FoliageWindRig, `rigs[${i}]`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const r = new FoliageWindRigs();
|
|
45
|
+
|
|
46
|
+
r.rigs = rigs;
|
|
47
|
+
r.weight = weight;
|
|
48
|
+
|
|
49
|
+
return r;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @readonly
|
|
55
|
+
* @type {boolean}
|
|
56
|
+
*/
|
|
57
|
+
FoliageWindRigs.prototype.isFoliageWindRigs = true;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @readonly
|
|
61
|
+
* @type {string}
|
|
62
|
+
*/
|
|
63
|
+
FoliageWindRigs.typeName = "FoliageWindRigs";
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @readonly
|
|
67
|
+
* @type {boolean}
|
|
68
|
+
*/
|
|
69
|
+
FoliageWindRigs.serializable = false;
|