Skip to content

Conversation

robtfm
Copy link
Contributor

@robtfm robtfm commented Oct 6, 2025

Objective

our current morph target / blend shape limit is 64 per model, documented as "to support all hardware". many assets use more than this ("over a hundred" is common), so i'd like to increase this limit.

the relevant hardware constraint is uniform buffer size (usage in morph.wgsl). morph targets use 4 bytes per entry, and wgpu's downlevel uniform buffer size limit is 16k so we have a lot of room from the 256 bytes we are currently limiting to, while still supporting the vast majority of hardware.

Solution

increase the limit to 256 targets / 1k.

we also increase the input to the buffer to this 1k size: this was not done previously but worked as long as the min buffer alignment was 256 (which it probably always is at the moment) as it was sized up to match alignment previously.

there may be a slight performance impact from using a larger size in all cases but it should be negligible.

@robtfm robtfm force-pushed the more-morph-targets branch from 979ab11 to d72f486 Compare October 6, 2025 12:17
@robtfm robtfm marked this pull request as draft October 6, 2025 14:57
@robtfm robtfm marked this pull request as ready for review October 6, 2025 17:22
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use X-Controversial There is active debate or serious implications around merging this PR labels Oct 6, 2025
@alice-i-cecile
Copy link
Member

This is very controversial: see the discussion in #21256 and the objections from @james7132.

I agree that we need to allow users to lift this, but y'all need to come to a consensus about the best approach forward.

@alice-i-cecile alice-i-cecile added S-Needs-Design This issue requires design work to think about how it would best be accomplished A-Animation Make things move and change over time labels Oct 6, 2025
@robtfm
Copy link
Contributor Author

robtfm commented Oct 6, 2025

it looks like the controversial aspect was exceeding 64kb uniform buffer size, i don't believe we'd do that until we went past 16384 max morph targets (@james7132).

apologies if i'm missing something.

@alice-i-cecile alice-i-cecile added S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed S-Needs-Design This issue requires design work to think about how it would best be accomplished labels Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Animation Make things move and change over time A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Needs-Review Needs reviewer attention (from anyone!) to move forward X-Controversial There is active debate or serious implications around merging this PR
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants