-
-
Notifications
You must be signed in to change notification settings - Fork 3
EN-055: animation instancing + staged-commit aux-texture/normal-kind fixes #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| //! EN-028 — per-model animation mixer state. | ||
| //! | ||
| //! Split out of `models.rs` (EN-052 line budget) when EN-055 landed: the | ||
| //! mixer is exactly the state that is PER-INSTANCE under animation | ||
| //! instancing, so it earns its own module. Re-exported from `models`, so | ||
| //! `crate::models::AnimMixer` paths are unchanged. | ||
| //! | ||
| //! Three things a single-clip sampler cannot do, all of which read as | ||
| //! "cheap" on screen: transitions pop, an attacking character has to stop | ||
| //! walking, and authored locomotion arcs (a pounce, a lunge) get replaced | ||
| //! by hand-tuned kinematics because the root is nailed to the rest pose. | ||
| //! | ||
| //! Layout: a base track that crossfades from `prev` to `cur` over | ||
| //! `fade_dur`, plus one optional additive-by-mask layer (an attack driving | ||
| //! the spine-up while the legs keep walking). All clocks advance in | ||
| //! `advance_animation`, so the game hands over a dt and never tracks clip | ||
| //! time itself. | ||
|
|
||
| #[derive(Clone)] | ||
| pub struct AnimMixer { | ||
| pub cur_clip: usize, | ||
| pub cur_time: f32, | ||
| pub cur_speed: f32, | ||
| pub cur_loop: bool, | ||
| /// Clip we are fading *out* of. `fade_dur <= 0` means no fade in flight. | ||
| pub prev_clip: usize, | ||
| pub prev_time: f32, | ||
| pub prev_speed: f32, | ||
| pub prev_loop: bool, | ||
| pub fade_t: f32, | ||
| pub fade_dur: f32, | ||
| /// Masked layer. `layer_clip < 0` = inactive. | ||
| pub layer_clip: i32, | ||
| pub layer_time: f32, | ||
| pub layer_speed: f32, | ||
| pub layer_loop: bool, | ||
| pub layer_weight: f32, | ||
| /// Root joint of the masked subtree (e.g. the spine). Every joint at or | ||
| /// below it takes the layer pose; everything else keeps the base pose. | ||
| pub layer_mask_root: i32, | ||
| /// Opt-in root motion. Off by default so existing games are unchanged. | ||
| pub root_motion: bool, | ||
| pub root_delta: [f32; 3], | ||
| /// True once a non-looping `cur_clip` has played past its duration. | ||
| pub finished: bool, | ||
| pub started: bool, | ||
| } | ||
|
|
||
| impl Default for AnimMixer { | ||
| fn default() -> Self { | ||
| Self { | ||
| cur_clip: 0, cur_time: 0.0, cur_speed: 1.0, cur_loop: true, | ||
| prev_clip: 0, prev_time: 0.0, prev_speed: 1.0, prev_loop: true, | ||
| fade_t: 0.0, fade_dur: 0.0, | ||
| layer_clip: -1, layer_time: 0.0, layer_speed: 1.0, layer_loop: false, | ||
| layer_weight: 0.0, layer_mask_root: -1, | ||
| root_motion: false, root_delta: [0.0; 3], | ||
| finished: false, started: false, | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
Repository: Bloom-Engine/engine
Length of output: 23816
🏁 Script executed:
Repository: Bloom-Engine/engine
Length of output: 6973
🏁 Script executed:
Repository: Bloom-Engine/engine
Length of output: 17010
Track texture kind per material use, not per image. A glTF image can be reused as both a normal map and a base-color texture; this image-level
is_normalflag forces one registration kind for every reference to that image, so one of the roles renders incorrectly. Split the staged texture by usage or carry the role through commit.🤖 Prompt for AI Agents