Skip to content
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

Fix, allow missing bone indices vertex attribute in Metal driver #1663

Merged
merged 1 commit into from
Sep 18, 2019

Conversation

bejado
Copy link
Member

@bejado bejado commented Sep 18, 2019

Fixes #1525

mesh_bone_indices is a special vertex attribute (it's uvec4, as opposed to vec4). If a renderable
doesn't provide the attribute, we read from a faux vertex buffer called the "zero buffer". The
vertex format still needs to be specified as MTLVertexFormatUInt4, otherwise Metal errors.

This is a hack for now—we've discussed the idea of programatic vertex pulling as a potential future
workaround.

prideout added a commit that referenced this pull request Sep 18, 2019
To prevent an excess of variants, sometimes our vertex shaders declare
inputs that they never read from. For example, our skin-and-morph
variant might never read from the skinning attribute, but still declares
the input.

This PR is a sister to #1663, which is a fix for #1525.

See also #1279.
@bejado bejado merged commit 5d725f6 into master Sep 18, 2019
@bejado bejado deleted the bjd/missing-bone-indices branch September 18, 2019 23:59
prideout added a commit that referenced this pull request Sep 19, 2019
To prevent an excess of variants, sometimes our vertex shaders declare
inputs that they never read from. For example, our skin-and-morph
variant might never read from the skinning attribute, but still declares
the input.

This PR is a sister to #1663, which is a fix for #1525.

See also #1279.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reading ANY glb with morph targets will crash on iOS platform with backend::Metal
5 participants