@woosh/meep-engine 3.81.0 → 3.82.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/CHANGELOG.md +42 -0
- package/build/bundle-worker-terrain.js +1 -1
- package/editor/ecs/component/editors/common/BitFlagsEditor.d.ts.map +1 -1
- package/editor/ecs/component/editors/common/BitFlagsEditor.js +11 -0
- package/editor/prototypeEditorShell.d.ts.map +1 -1
- package/editor/prototypeEditorShell.js +4 -1
- package/package.json +1 -1
- package/src/engine/graphics/ecs/mesh-v2/MESH_MORPH_EVENT_CHANGE.d.ts +13 -0
- package/src/engine/graphics/ecs/mesh-v2/MESH_MORPH_EVENT_CHANGE.d.ts.map +1 -0
- package/src/engine/graphics/ecs/mesh-v2/MESH_MORPH_EVENT_CHANGE.js +12 -0
- package/src/engine/graphics/ecs/mesh-v2/MeshMorph.d.ts +64 -0
- package/src/engine/graphics/ecs/mesh-v2/MeshMorph.d.ts.map +1 -0
- package/src/engine/graphics/ecs/mesh-v2/MeshMorph.js +89 -0
- package/src/engine/graphics/ecs/mesh-v2/MeshSkin.d.ts +1 -1
- package/src/engine/graphics/ecs/mesh-v2/MeshSkin.js +1 -1
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometryFlags.d.ts +1 -0
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometryFlags.js +10 -3
- package/src/engine/graphics/ecs/mesh-v2/mesh_morph_announce_change.d.ts +14 -0
- package/src/engine/graphics/ecs/mesh-v2/mesh_morph_announce_change.d.ts.map +1 -0
- package/src/engine/graphics/ecs/mesh-v2/mesh_morph_announce_change.js +21 -0
- package/src/engine/graphics3/HairSystem.js +1 -1
- package/src/engine/graphics3/MeshMorphSystem.d.ts +48 -0
- package/src/engine/graphics3/MeshMorphSystem.d.ts.map +1 -0
- package/src/engine/graphics3/MeshMorphSystem.js +355 -0
- package/src/engine/graphics3/MeshSkinSystem.js +2 -2
- package/src/engine/graphics3/MeshSystem.d.ts +2 -1
- package/src/engine/graphics3/MeshSystem.d.ts.map +1 -1
- package/src/engine/graphics3/MeshSystem.js +2 -1
- package/src/engine/graphics3/ShadedGeometrySystem.d.ts +1 -1
- package/src/engine/graphics3/ShadedGeometrySystem.js +2 -2
- package/src/engine/graphics3/prefab/Prefab.d.ts +14 -0
- package/src/engine/graphics3/prefab/Prefab.d.ts.map +1 -1
- package/src/engine/graphics3/prefab/Prefab.js +16 -0
- package/src/engine/graphics3/prefab/prefab_compile.d.ts.map +1 -1
- package/src/engine/graphics3/prefab/prefab_compile.js +8 -1
- package/src/engine/graphics3/prefab/prefab_instantiate.d.ts +3 -2
- package/src/engine/graphics3/prefab/prefab_instantiate.d.ts.map +1 -1
- package/src/engine/graphics3/prefab/prefab_instantiate.js +17 -4
- package/src/engine/graphics3/prefab/prefab_place.d.ts +27 -9
- package/src/engine/graphics3/prefab/prefab_place.d.ts.map +1 -1
- package/src/engine/graphics3/prefab/prefab_place.js +69 -13
- package/src/engine/graphics3/register_clips.d.ts.map +1 -1
- package/src/engine/graphics3/register_clips.js +8 -2
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/shade/playground/hair_skinned/skinned_hair.js +2 -2
- package/src/shade/playground/skinned_blas_refit/verify_clone_leaves.js +1 -1
- package/src/shade/playground/skinned_blas_refit/verify_instance_bounds.js +1 -1
- package/src/shade/playground/skinned_blas_refit/verify_skinned_blas_refit.js +1 -1
- package/src/shade/playground/skinned_mesh_soup/main.js +1 -1
- package/src/shade/playground/skinned_mesh_soup/verify_clone_vertices.js +2 -2
- package/src/shade/renderer/Renderer.js +2 -2
- package/src/shade/renderer/acoustics/GPUAcousticLattice.d.ts +1 -1
- package/src/shade/renderer/acoustics/GPUAcousticProbes.d.ts +1 -1
- package/src/shade/renderer/acoustics/GPUAcoustics.d.ts +1 -1
- package/src/shade/renderer/animation/ANIMATION_DATABASE_SPEC.d.ts +5 -0
- package/src/shade/renderer/animation/ANIMATION_DATABASE_SPEC.d.ts.map +1 -1
- package/src/shade/renderer/animation/ANIMATION_DATABASE_SPEC.js +19 -0
- package/src/shade/renderer/animation/ANIMATION_MORPH_STRUCT.d.ts +8 -0
- package/src/shade/renderer/animation/ANIMATION_MORPH_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/animation/ANIMATION_MORPH_STRUCT.js +19 -0
- package/src/shade/renderer/animation/ANIMATION_MORPH_WEIGHT_STRUCT.d.ts +6 -0
- package/src/shade/renderer/animation/ANIMATION_MORPH_WEIGHT_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/animation/ANIMATION_MORPH_WEIGHT_STRUCT.js +13 -0
- package/src/shade/renderer/animation/GPUAnimationManager.d.ts +71 -0
- package/src/shade/renderer/animation/GPUAnimationManager.d.ts.map +1 -1
- package/src/shade/renderer/animation/GPUAnimationManager.js +559 -9
- package/src/shade/renderer/animation/ShadeAnimationChannel.d.ts +23 -2
- package/src/shade/renderer/animation/ShadeAnimationChannel.d.ts.map +1 -1
- package/src/shade/renderer/animation/ShadeAnimationChannel.js +43 -2
- package/src/shade/renderer/animation/ShadeAnimationClip.d.ts +9 -3
- package/src/shade/renderer/animation/ShadeAnimationClip.d.ts.map +1 -1
- package/src/shade/renderer/animation/ShadeAnimationClip.js +67 -3
- package/src/shade/renderer/animation/ShadeAnimationClipSerializationAdapter.d.ts +3 -2
- package/src/shade/renderer/animation/ShadeAnimationClipSerializationAdapter.d.ts.map +1 -1
- package/src/shade/renderer/animation/ShadeAnimationClipSerializationAdapter.js +6 -3
- package/src/shade/renderer/animation/ShadeAnimationClipSerializationUpgrader_0_1.d.ts +14 -0
- package/src/shade/renderer/animation/ShadeAnimationClipSerializationUpgrader_0_1.d.ts.map +1 -0
- package/src/shade/renderer/animation/ShadeAnimationClipSerializationUpgrader_0_1.js +49 -0
- package/src/shade/renderer/animation/ShadeAnimationProperty.d.ts +12 -0
- package/src/shade/renderer/animation/ShadeAnimationProperty.d.ts.map +1 -0
- package/src/shade/renderer/animation/ShadeAnimationProperty.js +30 -0
- package/src/shade/renderer/animation/Skin.d.ts +1 -1
- package/src/shade/renderer/animation/Skin.js +1 -1
- package/src/shade/renderer/animation/deformation/DEFORMATION_BINDING_STRUCT.d.ts +26 -0
- package/src/shade/renderer/animation/deformation/DEFORMATION_BINDING_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/animation/{skinning/SKINNING_BINDING_STRUCT.js → deformation/DEFORMATION_BINDING_STRUCT.js} +33 -8
- package/src/shade/renderer/animation/{skinning/GPUMeshSkinningContext.d.ts → deformation/GPUMeshDeformationContext.d.ts} +60 -17
- package/src/shade/renderer/animation/deformation/GPUMeshDeformationContext.d.ts.map +1 -0
- package/src/shade/renderer/animation/{skinning/GPUMeshSkinningContext.js → deformation/GPUMeshDeformationContext.js} +458 -55
- package/src/shade/renderer/animation/{skinning/bounds_refresh/shader_skinned_mesh_bounds_refresh.d.ts → deformation/bounds_refresh/shader_deformed_mesh_bounds_refresh.d.ts} +2 -2
- package/src/shade/renderer/animation/deformation/bounds_refresh/shader_deformed_mesh_bounds_refresh.d.ts.map +1 -0
- package/src/shade/renderer/animation/{skinning/bounds_refresh/shader_skinned_mesh_bounds_refresh.js → deformation/bounds_refresh/shader_deformed_mesh_bounds_refresh.js} +3 -3
- package/src/shade/renderer/animation/deformation/bounds_refresh/shader_geometry_sphere_derive.d.ts.map +1 -0
- package/src/shade/renderer/animation/{skinning → deformation}/bounds_refresh/shader_geometry_sphere_derive.js +2 -2
- package/src/shade/renderer/animation/deformation/bounds_refresh/shader_meshlet_bounds_reduce.d.ts.map +1 -0
- package/src/shade/renderer/animation/{skinning → deformation}/bounds_refresh/shader_meshlet_bounds_reduce.js +2 -2
- package/src/shade/renderer/animation/deformation/bounds_refresh/shader_meshlet_bounds_scatter.d.ts.map +1 -0
- package/src/shade/renderer/animation/{skinning → deformation}/bounds_refresh/shader_meshlet_bounds_scatter.js +2 -2
- package/src/shade/renderer/animation/morph/shader_meshlet_apply_morph.d.ts +24 -0
- package/src/shade/renderer/animation/morph/shader_meshlet_apply_morph.d.ts.map +1 -0
- package/src/shade/renderer/animation/morph/shader_meshlet_apply_morph.js +257 -0
- package/src/shade/renderer/animation/morph/shader_morph_weights_resolve.d.ts +18 -0
- package/src/shade/renderer/animation/morph/shader_morph_weights_resolve.d.ts.map +1 -0
- package/src/shade/renderer/animation/morph/shader_morph_weights_resolve.js +75 -0
- package/src/shade/renderer/animation/shader_animation_apply.d.ts.map +1 -1
- package/src/shade/renderer/animation/shader_animation_apply.js +3 -1
- package/src/shade/renderer/animation/skinning/shader_meshlet_apply_skinning.d.ts.map +1 -1
- package/src/shade/renderer/animation/skinning/shader_meshlet_apply_skinning.js +31 -7
- package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
- package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
- package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +7 -7
- package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
- package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
- package/src/shade/renderer/geometry/GPUGeometryManager.d.ts +8 -1
- package/src/shade/renderer/geometry/GPUGeometryManager.d.ts.map +1 -1
- package/src/shade/renderer/geometry/GPUGeometryManager.js +18 -1
- package/src/shade/renderer/geometry/bvh/GPUBLASRefitBatch.d.ts +1 -1
- package/src/shade/renderer/geometry/bvh/GPUBLASRefitBatch.js +1 -1
- package/src/shade/renderer/geometry/meshlet/GPUMeshletManager.d.ts +9 -0
- package/src/shade/renderer/geometry/meshlet/GPUMeshletManager.d.ts.map +1 -1
- package/src/shade/renderer/geometry/meshlet/GPUMeshletManager.js +30 -2
- package/src/shade/renderer/geometry/meshlet/MeshletBatch.d.ts +27 -0
- package/src/shade/renderer/geometry/meshlet/MeshletBatch.d.ts.map +1 -1
- package/src/shade/renderer/geometry/meshlet/MeshletBatch.js +85 -6
- package/src/shade/renderer/geometry/meshlet/meshlet_payload_collapse.d.ts +5 -1
- package/src/shade/renderer/geometry/meshlet/meshlet_payload_collapse.d.ts.map +1 -1
- package/src/shade/renderer/geometry/meshlet/meshlet_payload_collapse.js +8 -3
- package/src/shade/renderer/geometry/meshlet_geometry_build_from_geometry.d.ts +13 -0
- package/src/shade/renderer/geometry/meshlet_geometry_build_from_geometry.d.ts.map +1 -1
- package/src/shade/renderer/geometry/meshlet_geometry_build_from_geometry.js +47 -4
- package/src/shade/renderer/geometry/morph/MESHLET_MORPH_LAYOUT.d.ts +51 -0
- package/src/shade/renderer/geometry/morph/MESHLET_MORPH_LAYOUT.d.ts.map +1 -0
- package/src/shade/renderer/geometry/morph/MESHLET_MORPH_LAYOUT.js +60 -0
- package/src/shade/renderer/geometry/morph/MESHLET_MORPH_NORMAL_EXPONENT.d.ts +12 -0
- package/src/shade/renderer/geometry/morph/MESHLET_MORPH_NORMAL_EXPONENT.d.ts.map +1 -0
- package/src/shade/renderer/geometry/morph/MESHLET_MORPH_NORMAL_EXPONENT.js +11 -0
- package/src/shade/renderer/geometry/morph/MeshletMorphTargets.d.ts +73 -0
- package/src/shade/renderer/geometry/morph/MeshletMorphTargets.d.ts.map +1 -0
- package/src/shade/renderer/geometry/morph/MeshletMorphTargets.js +130 -0
- package/src/shade/renderer/geometry/morph/MeshletMorphTargetsSerializationAdapter.d.ts +34 -0
- package/src/shade/renderer/geometry/morph/MeshletMorphTargetsSerializationAdapter.d.ts.map +1 -0
- package/src/shade/renderer/geometry/morph/MeshletMorphTargetsSerializationAdapter.js +126 -0
- package/src/shade/renderer/geometry/morph/MorphedGeometry.d.ts +50 -0
- package/src/shade/renderer/geometry/morph/MorphedGeometry.d.ts.map +1 -0
- package/src/shade/renderer/geometry/morph/MorphedGeometry.js +81 -0
- package/src/shade/renderer/geometry/morph/meshlet_morph_targets_build.d.ts +22 -0
- package/src/shade/renderer/geometry/morph/meshlet_morph_targets_build.d.ts.map +1 -0
- package/src/shade/renderer/geometry/morph/meshlet_morph_targets_build.js +375 -0
- package/src/shade/renderer/geometry/morph/meshlet_morph_targets_read.d.ts +25 -0
- package/src/shade/renderer/geometry/morph/meshlet_morph_targets_read.d.ts.map +1 -0
- package/src/shade/renderer/geometry/morph/meshlet_morph_targets_read.js +134 -0
- package/src/shade/renderer/geometry/morph/meshlet_morph_targets_validate.d.ts +15 -0
- package/src/shade/renderer/geometry/morph/meshlet_morph_targets_validate.d.ts.map +1 -0
- package/src/shade/renderer/geometry/morph/meshlet_morph_targets_validate.js +110 -0
- package/src/shade/renderer/geometry/morph/morphed_geometry_build.d.ts +22 -0
- package/src/shade/renderer/geometry/morph/morphed_geometry_build.d.ts.map +1 -0
- package/src/shade/renderer/geometry/morph/morphed_geometry_build.js +32 -0
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_cluster.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_cluster.js +2 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.js +3 -3
- package/src/shade/renderer/hair/GPUHairSystem.js +1 -1
- package/src/shade/renderer/loader/SceneNode.d.ts +20 -1
- package/src/shade/renderer/loader/SceneNode.d.ts.map +1 -1
- package/src/shade/renderer/loader/SceneNode.js +142 -114
- package/src/shade/renderer/loader/gltf/load_gltf.d.ts +1 -0
- package/src/shade/renderer/loader/gltf/load_gltf.d.ts.map +1 -1
- package/src/shade/renderer/loader/gltf/load_gltf.js +214 -30
- package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
- package/src/shade/renderer/loader/mtf/MTFMorphBinding.d.ts +41 -0
- package/src/shade/renderer/loader/mtf/MTFMorphBinding.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/MTFMorphBinding.js +60 -0
- package/src/shade/renderer/loader/mtf/MTFMorphBindingSerializationAdapter.d.ts +31 -0
- package/src/shade/renderer/loader/mtf/MTFMorphBindingSerializationAdapter.d.ts.map +1 -0
- package/src/shade/renderer/loader/mtf/MTFMorphBindingSerializationAdapter.js +108 -0
- package/src/shade/renderer/loader/mtf/MTF_PACKAGE_VERSION.d.ts +3 -0
- package/src/shade/renderer/loader/mtf/MTF_PACKAGE_VERSION.d.ts.map +1 -1
- package/src/shade/renderer/loader/mtf/MTF_PACKAGE_VERSION.js +4 -1
- package/src/shade/renderer/loader/mtf/mtf_export.d.ts.map +1 -1
- package/src/shade/renderer/loader/mtf/mtf_export.js +7 -0
- package/src/shade/renderer/loader/mtf/mtf_read_scene.d.ts +6 -3
- package/src/shade/renderer/loader/mtf/mtf_read_scene.d.ts.map +1 -1
- package/src/shade/renderer/loader/mtf/mtf_read_scene.js +43 -3
- package/src/shade/renderer/loader/mtf/mtf_serialization_registry.d.ts +2 -0
- package/src/shade/renderer/loader/mtf/mtf_serialization_registry.d.ts.map +1 -1
- package/src/shade/renderer/loader/mtf/mtf_serialization_registry.js +9 -0
- package/src/shade/renderer/loader/mtf/mtf_write.d.ts +3 -1
- package/src/shade/renderer/loader/mtf/mtf_write.d.ts.map +1 -1
- package/src/shade/renderer/loader/mtf/mtf_write.js +20 -1
- package/src/shade/renderer/object_property/ObjectType.d.ts +1 -0
- package/src/shade/renderer/object_property/ObjectType.js +8 -0
- package/src/shade/renderer/object_property/chunk_write_object_property.d.ts +6 -7
- package/src/shade/renderer/object_property/chunk_write_object_property.d.ts.map +1 -1
- package/src/shade/renderer/object_property/chunk_write_object_property.js +13 -7
- package/src/shade/renderer/object_property/chunk_write_object_property_morph_weight.d.ts +17 -0
- package/src/shade/renderer/object_property/chunk_write_object_property_morph_weight.d.ts.map +1 -0
- package/src/shade/renderer/object_property/chunk_write_object_property_morph_weight.js +38 -0
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
- package/src/shade/renderer/scene/GPUSceneContext.d.ts +5 -6
- package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
- package/src/shade/renderer/scene/GPUSceneContext.js +17 -20
- package/src/shade/renderer/scene/MESH_INSTANCE_METADATA_STRUCT.d.ts +1 -1
- package/src/shade/renderer/scene/MESH_INSTANCE_METADATA_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/scene/MESH_INSTANCE_METADATA_STRUCT.js +2 -2
- package/src/shade/renderer/scene/chunk_mesh_flags.js +3 -3
- package/src/shade/renderer/scene/movers/graph_scene_movers.d.ts +1 -1
- package/src/shade/renderer/scene/movers/graph_scene_movers.d.ts.map +1 -1
- package/src/shade/renderer/scene/movers/graph_scene_movers.js +20 -13
- package/src/shade/renderer/scene/movers/shader_scene_deformed_movers.d.ts +25 -0
- package/src/shade/renderer/scene/movers/shader_scene_deformed_movers.d.ts.map +1 -0
- package/src/shade/renderer/scene/movers/{shader_scene_skinned_movers.js → shader_scene_deformed_movers.js} +28 -18
- package/src/shade/renderer/scene/movers/shader_scene_movers.d.ts +1 -1
- package/src/shade/renderer/scene/movers/shader_scene_movers.js +2 -2
- package/src/shade/renderer/scene/rows/GPUSceneRows.d.ts +13 -13
- package/src/shade/renderer/scene/rows/GPUSceneRows.d.ts.map +1 -1
- package/src/shade/renderer/scene/rows/GPUSceneRows.js +30 -30
- package/src/shade/renderer/shader/chunk/geometry/meshlet/chunk_read_lattice_position.d.ts +17 -0
- package/src/shade/renderer/shader/chunk/geometry/meshlet/chunk_read_lattice_position.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/geometry/meshlet/chunk_read_lattice_position.js +78 -0
- package/src/shade/renderer/shader/chunk/geometry/meshlet/chunk_read_meshlet_position.d.ts +2 -1
- package/src/shade/renderer/shader/chunk/geometry/meshlet/chunk_read_meshlet_position.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/geometry/meshlet/chunk_read_meshlet_position.js +10 -54
- package/src/shade/renderer/shadow/vsm/VSMPageManager.d.ts.map +1 -1
- package/src/shade/renderer/shadow/vsm/VSMPageManager.js +33 -163
- package/src/shade/renderer/texture/virtual/README.md +12 -4
- package/src/shade/renderer/texture/virtual/VTLodBiasController.d.ts +116 -0
- package/src/shade/renderer/texture/virtual/VTLodBiasController.d.ts.map +1 -0
- package/src/shade/renderer/texture/virtual/VTLodBiasController.js +301 -0
- package/src/shade/renderer/texture/virtual/VirtualTextureManager.d.ts +8 -3
- package/src/shade/renderer/texture/virtual/VirtualTextureManager.d.ts.map +1 -1
- package/src/shade/renderer/texture/virtual/VirtualTextureManager.js +110 -20
- package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
- package/src/shade/renderer/wind/GPUSceneWind.d.ts +1 -1
- package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts.map +0 -1
- package/src/shade/renderer/animation/skinning/SKINNING_BINDING_STRUCT.d.ts +0 -22
- package/src/shade/renderer/animation/skinning/SKINNING_BINDING_STRUCT.d.ts.map +0 -1
- package/src/shade/renderer/animation/skinning/bounds_refresh/shader_geometry_sphere_derive.d.ts.map +0 -1
- package/src/shade/renderer/animation/skinning/bounds_refresh/shader_meshlet_bounds_reduce.d.ts.map +0 -1
- package/src/shade/renderer/animation/skinning/bounds_refresh/shader_meshlet_bounds_scatter.d.ts.map +0 -1
- package/src/shade/renderer/animation/skinning/bounds_refresh/shader_skinned_mesh_bounds_refresh.d.ts.map +0 -1
- package/src/shade/renderer/scene/movers/shader_scene_skinned_movers.d.ts +0 -24
- package/src/shade/renderer/scene/movers/shader_scene_skinned_movers.d.ts.map +0 -1
- /package/src/shade/renderer/animation/{skinning → deformation}/bounds_refresh/shader_geometry_sphere_derive.d.ts +0 -0
- /package/src/shade/renderer/animation/{skinning → deformation}/bounds_refresh/shader_meshlet_bounds_reduce.d.ts +0 -0
- /package/src/shade/renderer/animation/{skinning → deformation}/bounds_refresh/shader_meshlet_bounds_scatter.d.ts +0 -0
|
@@ -97,6 +97,13 @@ export async function mtf_export({
|
|
|
97
97
|
throw new Error(`the model has ${bundle.skins.length} skin(s), and scene optimization does not carry skinning: export it as it is`);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
const morphed = bundle.nodes.filter(node => node.morph_targets !== null).length;
|
|
101
|
+
|
|
102
|
+
if (morphed > 0) {
|
|
103
|
+
// morph targets are built against their geometry as it is, and the optimizer rebuilds and splits geometries
|
|
104
|
+
throw new Error(`the model has ${morphed} primitive(s) with morph targets, and scene optimization does not carry them: export it as it is`);
|
|
105
|
+
}
|
|
106
|
+
|
|
100
107
|
scene_optimize(bundle);
|
|
101
108
|
}
|
|
102
109
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The second half of reading an MTF package: its materials, geometries, nodes, skins
|
|
3
|
-
* every loader produces.
|
|
2
|
+
* The second half of reading an MTF package: its materials, geometries, nodes, skins, clips and morph targets,
|
|
3
|
+
* as the bundle every loader produces. A package of version 0 ends at its clips, and its nodes carry no morph
|
|
4
|
+
* targets.
|
|
4
5
|
*
|
|
5
6
|
* A geometry or a material several nodes draw is one object in the bundle, as it is one record in the package.
|
|
6
7
|
* Nothing is built: a geometry comes back with the tree it was written with, and a clip with its curves as they
|
|
@@ -8,7 +9,7 @@
|
|
|
8
9
|
*
|
|
9
10
|
* Every refusal is a thrown error and none is an assert: a file is outside data.
|
|
10
11
|
*
|
|
11
|
-
* @param {BinaryBuffer} buffer where {@link mtf_read_textures} left it
|
|
12
|
+
* @param {BinaryBuffer} buffer where {@link mtf_read_textures} left it, over the whole package
|
|
12
13
|
* @param {ShadeTexture[]} textures one for each record {@link mtf_read_textures} returned, in that order
|
|
13
14
|
* @returns {SceneBundle}
|
|
14
15
|
* @throws {Error} if a record names something the package does not hold, a node comes before its parent, or
|
|
@@ -23,5 +24,7 @@ export type ShadeTexture = import("../../texture/ShadeTexture.js").ShadeTexture;
|
|
|
23
24
|
export type StandardShadeMaterial = import("../../material/StandardShadeMaterial.js").StandardShadeMaterial;
|
|
24
25
|
export type MeshletGeometry = import("../../geometry/MeshletGeometry.js").MeshletGeometry;
|
|
25
26
|
export type SceneNode = import("../SceneNode.js").SceneNode;
|
|
27
|
+
export type MeshletMorphTargets = import("../../geometry/morph/MeshletMorphTargets.js").MeshletMorphTargets;
|
|
28
|
+
export type MTFMorphBinding = import("./MTFMorphBinding.js").MTFMorphBinding;
|
|
26
29
|
import { SceneBundle } from "../SceneBundle.js";
|
|
27
30
|
//# sourceMappingURL=mtf_read_scene.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mtf_read_scene.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/loader/mtf/mtf_read_scene.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mtf_read_scene.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/loader/mtf/mtf_read_scene.js"],"names":[],"mappings":"AAyCA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,uCATW,YAAY,YACZ,YAAY,EAAE,GACZ,WAAW,CA0GvB;2BAjJY,OAAO,yCAAyC,EAAE,YAAY;2BAC9D,OAAO,+BAA+B,EAAE,YAAY;oCACpD,OAAO,yCAAyC,EAAE,qBAAqB;8BACvE,OAAO,mCAAmC,EAAE,eAAe;wBAC3D,OAAO,iBAAiB,EAAE,SAAS;kCACnC,OAAO,6CAA6C,EAAE,mBAAmB;8BACzE,OAAO,sBAAsB,EAAE,eAAe;4BApB/B,mBAAmB"}
|
|
@@ -5,6 +5,8 @@ import {
|
|
|
5
5
|
MTF_CLASS_CLIP,
|
|
6
6
|
MTF_CLASS_GEOMETRY,
|
|
7
7
|
MTF_CLASS_MATERIAL,
|
|
8
|
+
MTF_CLASS_MORPH_BINDING,
|
|
9
|
+
MTF_CLASS_MORPH_TARGETS,
|
|
8
10
|
MTF_CLASS_NODE,
|
|
9
11
|
MTF_CLASS_SKIN,
|
|
10
12
|
mtf_serialization_registry
|
|
@@ -16,6 +18,8 @@ import {
|
|
|
16
18
|
* @typedef {import("../../material/StandardShadeMaterial.js").StandardShadeMaterial} StandardShadeMaterial
|
|
17
19
|
* @typedef {import("../../geometry/MeshletGeometry.js").MeshletGeometry} MeshletGeometry
|
|
18
20
|
* @typedef {import("../SceneNode.js").SceneNode} SceneNode
|
|
21
|
+
* @typedef {import("../../geometry/morph/MeshletMorphTargets.js").MeshletMorphTargets} MeshletMorphTargets
|
|
22
|
+
* @typedef {import("./MTFMorphBinding.js").MTFMorphBinding} MTFMorphBinding
|
|
19
23
|
*/
|
|
20
24
|
|
|
21
25
|
const NO_OPTIONS = [];
|
|
@@ -36,8 +40,9 @@ function check_node_indices(owner, indices, node_count) {
|
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
/**
|
|
39
|
-
* The second half of reading an MTF package: its materials, geometries, nodes, skins
|
|
40
|
-
* every loader produces.
|
|
43
|
+
* The second half of reading an MTF package: its materials, geometries, nodes, skins, clips and morph targets,
|
|
44
|
+
* as the bundle every loader produces. A package of version 0 ends at its clips, and its nodes carry no morph
|
|
45
|
+
* targets.
|
|
41
46
|
*
|
|
42
47
|
* A geometry or a material several nodes draw is one object in the bundle, as it is one record in the package.
|
|
43
48
|
* Nothing is built: a geometry comes back with the tree it was written with, and a clip with its curves as they
|
|
@@ -45,7 +50,7 @@ function check_node_indices(owner, indices, node_count) {
|
|
|
45
50
|
*
|
|
46
51
|
* Every refusal is a thrown error and none is an assert: a file is outside data.
|
|
47
52
|
*
|
|
48
|
-
* @param {BinaryBuffer} buffer where {@link mtf_read_textures} left it
|
|
53
|
+
* @param {BinaryBuffer} buffer where {@link mtf_read_textures} left it, over the whole package
|
|
49
54
|
* @param {ShadeTexture[]} textures one for each record {@link mtf_read_textures} returned, in that order
|
|
50
55
|
* @returns {SceneBundle}
|
|
51
56
|
* @throws {Error} if a record names something the package does not hold, a node comes before its parent, or
|
|
@@ -113,6 +118,41 @@ export function mtf_read_scene(buffer, textures) {
|
|
|
113
118
|
}
|
|
114
119
|
}
|
|
115
120
|
|
|
121
|
+
// the header's version says whether the collections a later version appended follow
|
|
122
|
+
const version = new DataView(buffer.data).getUint32(4, true);
|
|
123
|
+
|
|
124
|
+
if (version >= 1) {
|
|
125
|
+
/** @type {MeshletMorphTargets[]} */
|
|
126
|
+
const morph_targets = [];
|
|
127
|
+
|
|
128
|
+
/** @type {MTFMorphBinding[]} */
|
|
129
|
+
const morph_bindings = [];
|
|
130
|
+
|
|
131
|
+
mtf_read_collection(deserializer, MTF_CLASS_MORPH_TARGETS, [geometries], morph_targets);
|
|
132
|
+
mtf_read_collection(deserializer, MTF_CLASS_MORPH_BINDING, [morph_targets], morph_bindings);
|
|
133
|
+
|
|
134
|
+
for (let i = 0; i < morph_bindings.length; i++) {
|
|
135
|
+
const binding = morph_bindings[i];
|
|
136
|
+
|
|
137
|
+
if (binding.node >= node_count) {
|
|
138
|
+
throw new Error(`a morph binding names node ${binding.node}, and the MTF package holds ${node_count}`);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const node = nodes[binding.node];
|
|
142
|
+
|
|
143
|
+
if (binding.targets.geometry !== node.geometry) {
|
|
144
|
+
throw new Error(`node ${binding.node} '${node.name}' carries morph targets built against another geometry than the one it draws`);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (node.morph_targets !== null) {
|
|
148
|
+
throw new Error(`node ${binding.node} '${node.name}' carries morph targets twice`);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
node.morph_targets = binding.targets;
|
|
152
|
+
node.morph_weights = binding.weights;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
116
156
|
if (buffer.position !== buffer.capacity) {
|
|
117
157
|
throw new Error(`the MTF package holds ${buffer.capacity - buffer.position} bytes after its last collection`);
|
|
118
158
|
}
|
|
@@ -21,5 +21,7 @@ export const MTF_CLASS_GEOMETRY: "MeshletGeometry";
|
|
|
21
21
|
export const MTF_CLASS_NODE: "SceneNode";
|
|
22
22
|
export const MTF_CLASS_SKIN: "Skin";
|
|
23
23
|
export const MTF_CLASS_CLIP: "ShadeAnimationClip";
|
|
24
|
+
export const MTF_CLASS_MORPH_TARGETS: "MeshletMorphTargets";
|
|
25
|
+
export const MTF_CLASS_MORPH_BINDING: "MTFMorphBinding";
|
|
24
26
|
import { BinarySerializationRegistry } from "../../../../engine/ecs/storage/binary/BinarySerializationRegistry.js";
|
|
25
27
|
//# sourceMappingURL=mtf_serialization_registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mtf_serialization_registry.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/loader/mtf/mtf_serialization_registry.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mtf_serialization_registry.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/loader/mtf/mtf_serialization_registry.js"],"names":[],"mappings":"AAyBA;;;;;;;;;;;GAWG;AACH,8CALa,2BAA2B,CA2BvC;AA/CD;;;GAGG;AACH,6CAA8C;AAC9C,yDAA0D;AAC1D,mDAAoD;AACpD,yCAA0C;AAC1C,oCAAqC;AACrC,kDAAmD;AACnD,4DAA6D;AAC7D,wDAAyD;4CAvBb,sEAAsE"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { BinarySerializationRegistry } from "../../../../engine/ecs/storage/binary/BinarySerializationRegistry.js";
|
|
2
2
|
import { ShadeAnimationClipSerializationAdapter } from "../../animation/ShadeAnimationClipSerializationAdapter.js";
|
|
3
|
+
import { ShadeAnimationClipSerializationUpgrader_0_1 } from "../../animation/ShadeAnimationClipSerializationUpgrader_0_1.js";
|
|
3
4
|
import { SkinSerializationAdapter } from "../../animation/SkinSerializationAdapter.js";
|
|
4
5
|
import { MeshletGeometrySerializationAdapter } from "../../geometry/MeshletGeometrySerializationAdapter.js";
|
|
5
6
|
import { MeshletGeometrySerializationUpgrader_0_1 } from "../../geometry/MeshletGeometrySerializationUpgrader_0_1.js";
|
|
7
|
+
import { MeshletMorphTargetsSerializationAdapter } from "../../geometry/morph/MeshletMorphTargetsSerializationAdapter.js";
|
|
6
8
|
import { StandardShadeMaterialSerializationAdapter } from "../../material/StandardShadeMaterialSerializationAdapter.js";
|
|
7
9
|
import { SceneNodeSerializationAdapter } from "../SceneNodeSerializationAdapter.js";
|
|
10
|
+
import { MTFMorphBindingSerializationAdapter } from "./MTFMorphBindingSerializationAdapter.js";
|
|
8
11
|
import { MTFTextureSerializationAdapter } from "./MTFTextureSerializationAdapter.js";
|
|
9
12
|
|
|
10
13
|
/**
|
|
@@ -17,6 +20,8 @@ export const MTF_CLASS_GEOMETRY = "MeshletGeometry";
|
|
|
17
20
|
export const MTF_CLASS_NODE = "SceneNode";
|
|
18
21
|
export const MTF_CLASS_SKIN = "Skin";
|
|
19
22
|
export const MTF_CLASS_CLIP = "ShadeAnimationClip";
|
|
23
|
+
export const MTF_CLASS_MORPH_TARGETS = "MeshletMorphTargets";
|
|
24
|
+
export const MTF_CLASS_MORPH_BINDING = "MTFMorphBinding";
|
|
20
25
|
|
|
21
26
|
/**
|
|
22
27
|
* The adapters an MTF package is written and read with, and the upgraders that bring a collection written at an
|
|
@@ -46,6 +51,10 @@ export function mtf_serialization_registry() {
|
|
|
46
51
|
registry.registerAdapter(new SceneNodeSerializationAdapter(), MTF_CLASS_NODE);
|
|
47
52
|
registry.registerAdapter(new SkinSerializationAdapter(), MTF_CLASS_SKIN);
|
|
48
53
|
registry.registerAdapter(new ShadeAnimationClipSerializationAdapter(), MTF_CLASS_CLIP);
|
|
54
|
+
registry.registerUpgrader(MTF_CLASS_CLIP, new ShadeAnimationClipSerializationUpgrader_0_1());
|
|
55
|
+
|
|
56
|
+
registry.registerAdapter(new MeshletMorphTargetsSerializationAdapter(), MTF_CLASS_MORPH_TARGETS);
|
|
57
|
+
registry.registerAdapter(new MTFMorphBindingSerializationAdapter(), MTF_CLASS_MORPH_BINDING);
|
|
49
58
|
|
|
50
59
|
return registry;
|
|
51
60
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A model as an MTF package: a header, then
|
|
2
|
+
* A model as an MTF package: a header, then eight collections in the order each needs the ones before it.
|
|
3
3
|
*
|
|
4
4
|
* <pre>
|
|
5
5
|
* u32 magic {@link MTF_PACKAGE_MAGIC}
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* collection of {@link SceneNode} the bundle's nodes, in their order
|
|
11
11
|
* collection of {@link Skin}
|
|
12
12
|
* collection of {@link ShadeAnimationClip}
|
|
13
|
+
* collection of {@link MeshletMorphTargets} one a set of morph targets a node's geometry carries
|
|
14
|
+
* collection of {@link MTFMorphBinding} one a node that carries morph targets
|
|
13
15
|
* </pre>
|
|
14
16
|
*
|
|
15
17
|
* A collection is what {@link BinaryCollectionSerializer} writes: its class's name and version, a count, and each
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mtf_write.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/loader/mtf/mtf_write.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mtf_write.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/loader/mtf/mtf_write.js"],"names":[],"mappings":"AA4BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,kCAXW,WAAW,oBACX,IAAI,YAAY,EAAE,iBAAiB,CAAC,GAElC,WAAW,CAsGvB;0BAtIY,OAAO,mBAAmB,EAAE,WAAW;2BACvC,OAAO,+BAA+B,EAAE,YAAY;gCACpD,OAAO,oCAAoC,EAAE,iBAAiB"}
|
|
@@ -7,12 +7,15 @@ import {
|
|
|
7
7
|
MTF_CLASS_CLIP,
|
|
8
8
|
MTF_CLASS_GEOMETRY,
|
|
9
9
|
MTF_CLASS_MATERIAL,
|
|
10
|
+
MTF_CLASS_MORPH_BINDING,
|
|
11
|
+
MTF_CLASS_MORPH_TARGETS,
|
|
10
12
|
MTF_CLASS_NODE,
|
|
11
13
|
MTF_CLASS_SKIN,
|
|
12
14
|
MTF_CLASS_TEXTURE,
|
|
13
15
|
mtf_serialization_registry
|
|
14
16
|
} from "./mtf_serialization_registry.js";
|
|
15
17
|
import { mtf_write_collection } from "./mtf_write_collection.js";
|
|
18
|
+
import { MTFMorphBinding } from "./MTFMorphBinding.js";
|
|
16
19
|
import { MTFTexture } from "./MTFTexture.js";
|
|
17
20
|
|
|
18
21
|
/**
|
|
@@ -24,7 +27,7 @@ import { MTFTexture } from "./MTFTexture.js";
|
|
|
24
27
|
const NO_OPTIONS = [];
|
|
25
28
|
|
|
26
29
|
/**
|
|
27
|
-
* A model as an MTF package: a header, then
|
|
30
|
+
* A model as an MTF package: a header, then eight collections in the order each needs the ones before it.
|
|
28
31
|
*
|
|
29
32
|
* <pre>
|
|
30
33
|
* u32 magic {@link MTF_PACKAGE_MAGIC}
|
|
@@ -35,6 +38,8 @@ const NO_OPTIONS = [];
|
|
|
35
38
|
* collection of {@link SceneNode} the bundle's nodes, in their order
|
|
36
39
|
* collection of {@link Skin}
|
|
37
40
|
* collection of {@link ShadeAnimationClip}
|
|
41
|
+
* collection of {@link MeshletMorphTargets} one a set of morph targets a node's geometry carries
|
|
42
|
+
* collection of {@link MTFMorphBinding} one a node that carries morph targets
|
|
38
43
|
* </pre>
|
|
39
44
|
*
|
|
40
45
|
* A collection is what {@link BinaryCollectionSerializer} writes: its class's name and version, a count, and each
|
|
@@ -69,6 +74,10 @@ export function mtf_write(bundle, texture_variants) {
|
|
|
69
74
|
// in the order nodes first name them; a Set keeps that order
|
|
70
75
|
const geometry_set = new Set();
|
|
71
76
|
const material_set = new Set();
|
|
77
|
+
const morph_target_set = new Set();
|
|
78
|
+
|
|
79
|
+
/** @type {MTFMorphBinding[]} */
|
|
80
|
+
const morph_bindings = [];
|
|
72
81
|
|
|
73
82
|
for (let i = 0; i < nodes.length; i++) {
|
|
74
83
|
const node = nodes[i];
|
|
@@ -92,6 +101,11 @@ export function mtf_write(bundle, texture_variants) {
|
|
|
92
101
|
|
|
93
102
|
geometry_set.add(geometry);
|
|
94
103
|
material_set.add(material);
|
|
104
|
+
|
|
105
|
+
if (node.morph_targets !== null) {
|
|
106
|
+
morph_target_set.add(node.morph_targets);
|
|
107
|
+
morph_bindings.push(MTFMorphBinding.from(i, node.morph_targets, node.morph_weights));
|
|
108
|
+
}
|
|
95
109
|
}
|
|
96
110
|
|
|
97
111
|
const geometries = Array.from(geometry_set);
|
|
@@ -131,6 +145,11 @@ export function mtf_write(bundle, texture_variants) {
|
|
|
131
145
|
mtf_write_collection(serializer, MTF_CLASS_SKIN, bundle.skins, NO_OPTIONS);
|
|
132
146
|
mtf_write_collection(serializer, MTF_CLASS_CLIP, bundle.clips, NO_OPTIONS);
|
|
133
147
|
|
|
148
|
+
const morph_targets = Array.from(morph_target_set);
|
|
149
|
+
|
|
150
|
+
mtf_write_collection(serializer, MTF_CLASS_MORPH_TARGETS, morph_targets, [geometries]);
|
|
151
|
+
mtf_write_collection(serializer, MTF_CLASS_MORPH_BINDING, morph_bindings, [morph_targets]);
|
|
152
|
+
|
|
134
153
|
buffer.trim();
|
|
135
154
|
|
|
136
155
|
return buffer.data;
|
|
@@ -34,4 +34,12 @@ export const ObjectType = {
|
|
|
34
34
|
* by upstream writers when the underlying transform changes.
|
|
35
35
|
*/
|
|
36
36
|
MeshInstance: 2,
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* One morph target weight of one mesh entity: the index is the weight's row of
|
|
40
|
+
* `animation_morph_weights`, the entity's first weight row plus the target index. Animation
|
|
41
|
+
* contributes to it through the morph accumulator, which the morph resolve pass drains into the
|
|
42
|
+
* frame's weights. There is one property, the weight itself; a track drives it with its `x` lane.
|
|
43
|
+
*/
|
|
44
|
+
MorphWeight: 3,
|
|
37
45
|
};
|
|
@@ -9,18 +9,17 @@
|
|
|
9
9
|
* the full handle (so it can re-emit it onto the object-property reference
|
|
10
10
|
* stream when needed) and unpacks the index itself.
|
|
11
11
|
*
|
|
12
|
-
* `weight` is the weight `value` has already been multiplied by.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* rest rotation from its binding, and the same goes for it: only a Node3D
|
|
17
|
-
* rotation reads it.
|
|
12
|
+
* `weight` is the weight `value` has already been multiplied by. The Node3D
|
|
13
|
+
* writer wants it for its rest-relative sums, and so does the morph weight
|
|
14
|
+
* writer. `rest_rotation` is the target's rest rotation from its binding:
|
|
15
|
+
* only a Node3D rotation reads it.
|
|
18
16
|
*
|
|
19
17
|
* Each writer lives in its own CodeChunk and operates on whatever storage
|
|
20
18
|
* buffers the importing shader has bound under the documented names —
|
|
21
19
|
* the Node3D writer expects `pose_accumulator: array<atomic<u32>>` (the
|
|
22
20
|
* apply pass contributes weighted TRS values; resolve drains it), the
|
|
23
|
-
* material writer expects `materials: array<MaterialMetadata
|
|
21
|
+
* material writer expects `materials: array<MaterialMetadata>`, and the morph
|
|
22
|
+
* weight writer `animation_database` and `morph_accumulator: array<atomic<u32>>`.
|
|
24
23
|
*
|
|
25
24
|
* @type {CodeChunk}
|
|
26
25
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_write_object_property.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/object_property/chunk_write_object_property.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chunk_write_object_property.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/object_property/chunk_write_object_property.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,0CAFU,SAAS,CAgCb;0BAnEoB,iCAAiC"}
|
|
@@ -2,6 +2,9 @@ import { CodeChunk } from "../shader/compiler/CodeChunk.js";
|
|
|
2
2
|
import {
|
|
3
3
|
chunk_write_object_property_material
|
|
4
4
|
} from "./chunk_write_object_property_material.js";
|
|
5
|
+
import {
|
|
6
|
+
chunk_write_object_property_morph_weight
|
|
7
|
+
} from "./chunk_write_object_property_morph_weight.js";
|
|
5
8
|
import {
|
|
6
9
|
chunk_write_object_property_node3d
|
|
7
10
|
} from "./chunk_write_object_property_node3d.js";
|
|
@@ -18,18 +21,17 @@ import { ObjectType } from "./ObjectType.js";
|
|
|
18
21
|
* the full handle (so it can re-emit it onto the object-property reference
|
|
19
22
|
* stream when needed) and unpacks the index itself.
|
|
20
23
|
*
|
|
21
|
-
* `weight` is the weight `value` has already been multiplied by.
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* rest rotation from its binding, and the same goes for it: only a Node3D
|
|
26
|
-
* rotation reads it.
|
|
24
|
+
* `weight` is the weight `value` has already been multiplied by. The Node3D
|
|
25
|
+
* writer wants it for its rest-relative sums, and so does the morph weight
|
|
26
|
+
* writer. `rest_rotation` is the target's rest rotation from its binding:
|
|
27
|
+
* only a Node3D rotation reads it.
|
|
27
28
|
*
|
|
28
29
|
* Each writer lives in its own CodeChunk and operates on whatever storage
|
|
29
30
|
* buffers the importing shader has bound under the documented names —
|
|
30
31
|
* the Node3D writer expects `pose_accumulator: array<atomic<u32>>` (the
|
|
31
32
|
* apply pass contributes weighted TRS values; resolve drains it), the
|
|
32
|
-
* material writer expects `materials: array<MaterialMetadata
|
|
33
|
+
* material writer expects `materials: array<MaterialMetadata>`, and the morph
|
|
34
|
+
* weight writer `animation_database` and `morph_accumulator: array<atomic<u32>>`.
|
|
33
35
|
*
|
|
34
36
|
* @type {CodeChunk}
|
|
35
37
|
*/
|
|
@@ -53,10 +55,14 @@ fn write_object_property(
|
|
|
53
55
|
case ${ObjectType.Material}u: {
|
|
54
56
|
write_object_property_material(instance, property, mask, value);
|
|
55
57
|
}
|
|
58
|
+
case ${ObjectType.MorphWeight}u: {
|
|
59
|
+
write_object_property_morph_weight(instance, value, weight);
|
|
60
|
+
}
|
|
56
61
|
default: {}
|
|
57
62
|
}
|
|
58
63
|
}
|
|
59
64
|
`, [
|
|
60
65
|
chunk_write_object_property_node3d,
|
|
61
66
|
chunk_write_object_property_material,
|
|
67
|
+
chunk_write_object_property_morph_weight,
|
|
62
68
|
])
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type-specific writer for {@link ObjectType.MorphWeight}.
|
|
3
|
+
*
|
|
4
|
+
* Adds a clip's contribution to one weight into the morph accumulator, relative to the weight's base, as
|
|
5
|
+
* the pose accumulator takes a joint's: `value - weight * base`, `value` already multiplied by the
|
|
6
|
+
* clip's `weight`. The morph resolve pass then writes `base + sum` and empties the cell, so a normalised
|
|
7
|
+
* blend, a fade to the base and additive layers are the one equation they are for joints.
|
|
8
|
+
*
|
|
9
|
+
* **Importing-shader contract**: the shader that pulls in this chunk declares
|
|
10
|
+
* `animation_database` (the animation database, for the weight's base) and
|
|
11
|
+
* `var<storage, read_write> morph_accumulator: array<atomic<u32>>;`, one cell per weight row.
|
|
12
|
+
*
|
|
13
|
+
* @type {CodeChunk}
|
|
14
|
+
*/
|
|
15
|
+
export const chunk_write_object_property_morph_weight: CodeChunk;
|
|
16
|
+
import { CodeChunk } from "../shader/compiler/CodeChunk.js";
|
|
17
|
+
//# sourceMappingURL=chunk_write_object_property_morph_weight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_write_object_property_morph_weight.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/object_property/chunk_write_object_property_morph_weight.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;GAaG;AACH,uDAFU,SAAS,CAmBZ;0BAnCmB,iCAAiC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ANIMATION_DATABASE_SPEC } from "../animation/ANIMATION_DATABASE_SPEC.js";
|
|
2
|
+
import { chunk_atomic_add_f32_storage } from "../shader/chunk/atomic/chunk_atomic_add_f32_storage.js";
|
|
3
|
+
import { CodeChunk } from "../shader/compiler/CodeChunk.js";
|
|
4
|
+
|
|
5
|
+
const MORPH_WEIGHT_TABLE = ANIMATION_DATABASE_SPEC.get('animation_morph_weights');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Type-specific writer for {@link ObjectType.MorphWeight}.
|
|
9
|
+
*
|
|
10
|
+
* Adds a clip's contribution to one weight into the morph accumulator, relative to the weight's base, as
|
|
11
|
+
* the pose accumulator takes a joint's: `value - weight * base`, `value` already multiplied by the
|
|
12
|
+
* clip's `weight`. The morph resolve pass then writes `base + sum` and empties the cell, so a normalised
|
|
13
|
+
* blend, a fade to the base and additive layers are the one equation they are for joints.
|
|
14
|
+
*
|
|
15
|
+
* **Importing-shader contract**: the shader that pulls in this chunk declares
|
|
16
|
+
* `animation_database` (the animation database, for the weight's base) and
|
|
17
|
+
* `var<storage, read_write> morph_accumulator: array<atomic<u32>>;`, one cell per weight row.
|
|
18
|
+
*
|
|
19
|
+
* @type {CodeChunk}
|
|
20
|
+
*/
|
|
21
|
+
export const chunk_write_object_property_morph_weight = CodeChunk.from(
|
|
22
|
+
//language=WGSL
|
|
23
|
+
`
|
|
24
|
+
fn write_object_property_morph_weight(
|
|
25
|
+
instance: u32,
|
|
26
|
+
value: vec4f,
|
|
27
|
+
weight: f32,
|
|
28
|
+
) {
|
|
29
|
+
let row = instance & 0x00FFFFFFu;
|
|
30
|
+
|
|
31
|
+
let base = ${MORPH_WEIGHT_TABLE.marshalling_method_read}(&animation_database, row).base;
|
|
32
|
+
|
|
33
|
+
atomic_add_f32_storage(&morph_accumulator[row], value.x - weight * base);
|
|
34
|
+
}
|
|
35
|
+
`, [
|
|
36
|
+
MORPH_WEIGHT_TABLE.chunk_read,
|
|
37
|
+
chunk_atomic_add_f32_storage,
|
|
38
|
+
]);
|
|
@@ -59,7 +59,7 @@ export class NSS {
|
|
|
59
59
|
* @returns {number}
|
|
60
60
|
*/
|
|
61
61
|
static recommended_jitter_sequence_size(upscale_ratio: number): number;
|
|
62
|
-
static "__#
|
|
62
|
+
static "__#224@#preprocess_tensor_descriptor"(render_w: any, render_h: any): TextureResourceDescriptor;
|
|
63
63
|
/**
|
|
64
64
|
* @param {GraphicsContext} graphics
|
|
65
65
|
*/
|
|
@@ -149,18 +149,17 @@ export class GPUSceneContext {
|
|
|
149
149
|
*/
|
|
150
150
|
get scene_database_buffer(): GPUBuffer;
|
|
151
151
|
/**
|
|
152
|
-
* Per-scene
|
|
153
|
-
*
|
|
154
|
-
* management and the per-frame skinning compute onto it.
|
|
152
|
+
* Per-scene deformation subsystem: a deformed row draws a per-instance clone of its geometry,
|
|
153
|
+
* which the skinning and morph passes write.
|
|
155
154
|
*
|
|
156
155
|
* Lazy because it depends on {@link geometries}, which is assigned
|
|
157
156
|
* externally after this object's constructor returns
|
|
158
157
|
* (see {@link SceneManager}). The first access happens during
|
|
159
158
|
* {@link build}, which runs well after that assignment.
|
|
160
159
|
*
|
|
161
|
-
* @returns {
|
|
160
|
+
* @returns {GPUMeshDeformationContext}
|
|
162
161
|
*/
|
|
163
|
-
get
|
|
162
|
+
get deformation(): GPUMeshDeformationContext;
|
|
164
163
|
get gpu_memory_usage(): number;
|
|
165
164
|
/**
|
|
166
165
|
* Entities as rows of the scene database, at `entity + 1` in both tables.
|
|
@@ -285,7 +284,7 @@ import { VGeoFeedbackLoop } from "../geometry/virtual/runtime/VGeoFeedbackLoop.j
|
|
|
285
284
|
import { VGeoResidencyOptions } from "../geometry/virtual/runtime/VGeoResidencyOptions.js";
|
|
286
285
|
import { GPUAnimationManager } from "../animation/GPUAnimationManager.js";
|
|
287
286
|
import { GPUDatabase } from "../buffer/table/GPUDatabase.js";
|
|
288
|
-
import {
|
|
287
|
+
import { GPUMeshDeformationContext } from "../animation/deformation/GPUMeshDeformationContext.js";
|
|
289
288
|
import { GPUSceneRows } from "./rows/GPUSceneRows.js";
|
|
290
289
|
import { GPUEntityBoundsReadback } from "./rows/GPUEntityBoundsReadback.js";
|
|
291
290
|
import { ShadeGPUCommandContext } from "../../device/ShadeGPUCommandContext.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GPUSceneContext.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/scene/GPUSceneContext.js"],"names":[],"mappings":"AA4EA;;;;;;;;;GASG;AACH;IAEI;;;;;;;OAOG;IACH,iCAFW,eAAe,QAUzB;
|
|
1
|
+
{"version":3,"file":"GPUSceneContext.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/scene/GPUSceneContext.js"],"names":[],"mappings":"AA4EA;;;;;;;;;GASG;AACH;IAEI;;;;;;;OAOG;IACH,iCAFW,eAAe,QAUzB;IA4LD;;;;OAIG;IACH,sBAHW,eAAe,SACf,KAAK,EAyCf;IAtOD;;;OAGG;IACH,aAFU,MAAM,CAEE;IAElB;;OAEG;IACH,YAFU,kBAAkB,CAEjB;IAEX;;OAEG;IACH,WAFU,kBAAkB,CAElB;IAGV;;OAEG;IACH,sBAFU,cAAc,CAEH;IASrB;;;OAGG;IACH,mBAEC;IAOD,uCAEC;IAaD;;;;;OAKG;IACH,oBAEC;IAOD;;;;;OAKG;IACH,0CAEC;IAED;;;;;OAKG;IACH,yBAEC;IAUD;;;;;OAKG;IACH,kBAEC;IAQD;;;OAGG;IACH,iCAEC;IAOD;;;OAGG;IACH,8CAEC;IAyID;;OAEG;IACH,kDAEC;IAED;;OAEG;IACH,gDAEC;IAED;;OAEG;IACH,kDAEC;IAED;;OAEG;IACH,+FAEC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH;QAH0C,SAAS,GAAxC,oBAAoB;QAClB,yBAAyB,CAkErC;IAED;;OAEG;IACH,6CAEC;IAYD;;;;;OAKG;IACH,gEAEC;IAED;;;OAGG;IACH,kCAEC;IAED;;;;;OAKG;IACH,uCAEC;IAED;;;;;;;;;;OAUG;IACH,6CAUC;IAED,+BASC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,yBAEC;IAED;;;;;OAKG;IACH,sCAMC;IAOD;;;;;;;OAOG;IACH,8EAEC;IA6BD;;;;;OAKG;IACH,cAsEC;IAED;;;;;OAKG;IACH,YAFW,eAAe,QA6BzB;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,cAHW,sBAAsB,cACtB,MAAM,QAuBhB;IAUD;;;;;;;;;;;OAWG;IACH,oBAHW,UAAU,GACR,MAAM,CAQlB;IAoCD;;;;;;;OAOG;IACH,gBAyBC;IAwCL;;;OAGG;IACH,4BAFU,OAAO,CAE0B;;CAN1C;8BA94BY,OAAO,0CAA0C,EAAE,eAAe;8BAClE,OAAO,uBAAuB,EAAE,eAAe;iCAC/C,OAAO,mCAAmC,EAAE,kBAAkB;0BAC9D,OAAO,0CAA0C,EAAE,WAAW;iCAC9D,OAAO,mCAAmC,EAAE,kBAAkB;4BAC9D,OAAO,8BAA8B,EAAE,aAAa;8BACpD,OAAO,iDAAiD,EAAE,eAAe;yBACzE,OAAO,2DAA2D,EAAE,UAAU;+BA7B5D,iDAAiD;sBAM1D,YAAY;oCAFE,uCAAuC;qCAHtC,oEAAoE;6BAI5E,yBAAyB;uBAH/B,yBAAyB;mCACb,gCAAgC;kDAIjB,wCAAwC;0CAjBhD,0DAA0D;8BAItE,8CAA8C;iCAF3C,iDAAiD;qCAG7C,qDAAqD;oCAGtD,qCAAqC;4BAC7C,gCAAgC;0CASlB,uDAAuD;6BAQpE,wBAAwB;wCADb,mCAAmC;uCAlBpC,wCAAwC"}
|
|
@@ -17,7 +17,7 @@ import { GPUSceneVolumetrics } from "../volumetrics/GPUSceneVolumetrics.js";
|
|
|
17
17
|
import { GPUSceneWind } from "../wind/GPUSceneWind.js";
|
|
18
18
|
import { Scene } from "./Scene.js";
|
|
19
19
|
import { GPUInstancesAccelerationStructure } from "./GPUInstancesAccelerationStructure.js";
|
|
20
|
-
import {
|
|
20
|
+
import { GPUMeshDeformationContext } from "../animation/deformation/GPUMeshDeformationContext.js";
|
|
21
21
|
import {
|
|
22
22
|
shader_refresh_all_mesh_bounds,
|
|
23
23
|
WORKGROUP_SIZE as REFRESH_ALL_MESH_BOUNDS_WORKGROUP_SIZE
|
|
@@ -269,16 +269,14 @@ export class GPUSceneContext {
|
|
|
269
269
|
#root_written = false;
|
|
270
270
|
|
|
271
271
|
/**
|
|
272
|
-
* Per-scene
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
* externally after this constructor runs. See {@link skinning} for
|
|
277
|
-
* access.
|
|
272
|
+
* Per-scene deformation state: per-instance geometry clones, and the skinning and morph
|
|
273
|
+
* bindings and passes that write them. Lazily constructed because it depends on
|
|
274
|
+
* {@link geometries}, which {@link SceneManager#create} assigns externally after this
|
|
275
|
+
* constructor runs. See {@link deformation} for access.
|
|
278
276
|
*
|
|
279
|
-
* @type {
|
|
277
|
+
* @type {GPUMeshDeformationContext|null}
|
|
280
278
|
*/
|
|
281
|
-
#
|
|
279
|
+
#deformation = null;
|
|
282
280
|
|
|
283
281
|
/**
|
|
284
282
|
* Per-scene animation system — clips, tracks, curves, skins, and
|
|
@@ -539,27 +537,26 @@ export class GPUSceneContext {
|
|
|
539
537
|
}
|
|
540
538
|
|
|
541
539
|
/**
|
|
542
|
-
* Per-scene
|
|
543
|
-
*
|
|
544
|
-
* management and the per-frame skinning compute onto it.
|
|
540
|
+
* Per-scene deformation subsystem: a deformed row draws a per-instance clone of its geometry,
|
|
541
|
+
* which the skinning and morph passes write.
|
|
545
542
|
*
|
|
546
543
|
* Lazy because it depends on {@link geometries}, which is assigned
|
|
547
544
|
* externally after this object's constructor returns
|
|
548
545
|
* (see {@link SceneManager}). The first access happens during
|
|
549
546
|
* {@link build}, which runs well after that assignment.
|
|
550
547
|
*
|
|
551
|
-
* @returns {
|
|
548
|
+
* @returns {GPUMeshDeformationContext}
|
|
552
549
|
*/
|
|
553
|
-
get
|
|
554
|
-
if (this.#
|
|
555
|
-
this.#
|
|
550
|
+
get deformation() {
|
|
551
|
+
if (this.#deformation === null) {
|
|
552
|
+
this.#deformation = new GPUMeshDeformationContext({
|
|
556
553
|
geometries: this.geometries,
|
|
557
554
|
animation_manager: this.#animation_manager,
|
|
558
555
|
scene_context: this,
|
|
559
556
|
device: this.#device,
|
|
560
557
|
});
|
|
561
558
|
}
|
|
562
|
-
return this.#
|
|
559
|
+
return this.#deformation;
|
|
563
560
|
}
|
|
564
561
|
|
|
565
562
|
get gpu_memory_usage(){
|
|
@@ -643,7 +640,7 @@ export class GPUSceneContext {
|
|
|
643
640
|
geometries: this.geometries,
|
|
644
641
|
materials: this.materials,
|
|
645
642
|
tlas: this.#tlas,
|
|
646
|
-
|
|
643
|
+
deformation: () => this.deformation,
|
|
647
644
|
});
|
|
648
645
|
} else if (dataset !== rows.dataset && dataset !== null && dataset !== undefined) {
|
|
649
646
|
rows.bind(dataset);
|
|
@@ -899,8 +896,8 @@ export class GPUSceneContext {
|
|
|
899
896
|
this.#sky.destroy();
|
|
900
897
|
this.volumetric_light_map.destroy();
|
|
901
898
|
this.#animation_manager.destroy();
|
|
902
|
-
if (this.#
|
|
903
|
-
this.#
|
|
899
|
+
if (this.#deformation !== null) {
|
|
900
|
+
this.#deformation.destroy();
|
|
904
901
|
}
|
|
905
902
|
if (this.#mover_tracker !== null) {
|
|
906
903
|
this.#mover_tracker.destroy();
|
|
@@ -24,6 +24,6 @@ export const MESH_FLAG_SDF_WORLD: number;
|
|
|
24
24
|
*
|
|
25
25
|
* @type {number}
|
|
26
26
|
*/
|
|
27
|
-
export const
|
|
27
|
+
export const MESH_FLAG_DEFORMED: number;
|
|
28
28
|
import { WebGPUStruct } from "../shader/type/WebGPUStruct.js";
|
|
29
29
|
//# sourceMappingURL=MESH_INSTANCE_METADATA_STRUCT.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MESH_INSTANCE_METADATA_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/scene/MESH_INSTANCE_METADATA_STRUCT.js"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,yDAuB0B;AAE1B;;;;;;;GAOG;AACH,kCAFU,MAAM,CAEqB;AAErC;;;;;;GAMG;AACH,
|
|
1
|
+
{"version":3,"file":"MESH_INSTANCE_METADATA_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/scene/MESH_INSTANCE_METADATA_STRUCT.js"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,yDAuB0B;AAE1B;;;;;;;GAOG;AACH,kCAFU,MAAM,CAEqB;AAErC;;;;;;GAMG;AACH,iCAFU,MAAM,CAEoB;6BArDP,gCAAgC"}
|
|
@@ -21,7 +21,7 @@ export const MESH_INSTANCE_METADATA_STRUCT = WebGPUStruct.from({
|
|
|
21
21
|
node: u32,
|
|
22
22
|
/**
|
|
23
23
|
* Facts about the row that its readers on the GPU branch on: {@link MESH_FLAG_SDF_WORLD},
|
|
24
|
-
* {@link
|
|
24
|
+
* {@link MESH_FLAG_DEFORMED}. Written with the rest of the record whenever the row is.
|
|
25
25
|
*
|
|
26
26
|
* Free: the packed record is 80 bytes with the tail padding this word now occupies, and is 80
|
|
27
27
|
* bytes with it.
|
|
@@ -53,4 +53,4 @@ export const MESH_FLAG_SDF_WORLD = 1;
|
|
|
53
53
|
*
|
|
54
54
|
* @type {number}
|
|
55
55
|
*/
|
|
56
|
-
export const
|
|
56
|
+
export const MESH_FLAG_DEFORMED = 2;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CodeChunk } from "../shader/compiler/CodeChunk.js";
|
|
2
|
-
import {
|
|
2
|
+
import { MESH_FLAG_DEFORMED, MESH_INSTANCE_METADATA_STRUCT } from "./MESH_INSTANCE_METADATA_STRUCT.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Readers for {@link MESH_INSTANCE_METADATA_STRUCT}'s `flags`. Every consumer of the encoding goes
|
|
@@ -14,8 +14,8 @@ export const chunk_mesh_flags = CodeChunk.from(
|
|
|
14
14
|
* Whether the row draws a per-instance clone that the skinning pass deforms, so that its box follows
|
|
15
15
|
* its pose.
|
|
16
16
|
*/
|
|
17
|
-
fn
|
|
18
|
-
return ( mesh.flags & ${
|
|
17
|
+
fn mesh_is_deformed( mesh: ${MESH_INSTANCE_METADATA_STRUCT.wgsl_ref} ) -> bool{
|
|
18
|
+
return ( mesh.flags & ${MESH_FLAG_DEFORMED}u ) != 0u;
|
|
19
19
|
}
|
|
20
20
|
`, [
|
|
21
21
|
MESH_INSTANCE_METADATA_STRUCT.declaration_chunk,
|
|
@@ -13,7 +13,7 @@ export function enquire_scene_movers_pipelines(enquiry: import("../../../device/
|
|
|
13
13
|
/**
|
|
14
14
|
* Record the scene's mover list for a frame (`SceneMovers`, {@link SCENE_MOVERS_BYTE_SIZE} bytes):
|
|
15
15
|
* every mesh row against the box it had last frame ({@link shader_scene_movers}), and every skinned
|
|
16
|
-
* mesh against the pose it had ({@link
|
|
16
|
+
* mesh against the pose it had ({@link shader_scene_deformed_movers}), into one list.
|
|
17
17
|
*
|
|
18
18
|
* Its readers read the handle this returns. The pass is no side effect, so a frame with no reader
|
|
19
19
|
* culls it — and allocates nothing, `tracker`'s memory included — and `tracker` remembers what it
|