Skip to main content

Module instanced_skinned_morph

Module instanced_skinned_morph 

Source
Expand description

The instanced skin-and-morph scene: three entities sharing one deformed mesh.

Ported from the ecs_instanced_skinned_morphed_cubes_match_snapshots test. Three entities share one skinned-and-morphed mesh. They draw the same pipeline, bind the same mesh and material bind groups and read the same vertex and index buffers, so the source folds them into a single instanced draw; what keeps each instance distinct is the pose state the instance stream carries β€” every instance names its own SkinPose and MorphWeights entity. The frames animate those per instance, so the sequence is what proves a merged draw still reads each instance’s own pose.

Re-exportsΒ§

use super::BendSkin; πŸ”’
use super::SEQUENCE_STEP; πŸ”’
use super::SceneControl; πŸ”’
use super::SceneDef; πŸ”’
use super::SceneOptions; πŸ”’
use super::TEST_SIZE; πŸ”’
use super::default_options; πŸ”’
use super::morph_deltas; πŸ”’
use super::rest_pose; πŸ”’
use unlit_ecs::Bundle; πŸ”’
use unlit_ecs::DynamicBundle; πŸ”’
use unlit_ecs::bundle; πŸ”’
use unlit3d::prelude::*; πŸ”’

StructsΒ§

Instance πŸ”’
One instance of the crowd: the shared mesh drawn at its own place, with its own pose and its own morph weights.

ConstantsΒ§

CAMERA_EYE πŸ”’
Where the camera sits, far enough back to see all instances, and what it looks at.
CAMERA_TARGET πŸ”’
The point the camera looks at.
FRAMES πŸ”’
The frames rendered, one snapshot each.
INSTANCES πŸ”’
How many entities share the mesh.

StaticsΒ§

SCENE
The scene: a crowd of three instanced cubes, each skinned and morphed on its own, stored as one snapshot per frame.

FunctionsΒ§

build πŸ”’
Build the instanced scene’s world content.
camera πŸ”’
The camera the whole sequence shares, wide enough to see all instances.
instance_angle πŸ”’
The bending angle instance holds in frame.
instance_weights πŸ”’
The morph weights instance holds in frame, in target order.