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

GLTFLoader: Fix sparse normalized. #29330

Merged
merged 1 commit into from
Sep 5, 2024
Merged

Conversation

stephomi
Copy link
Contributor

@stephomi stephomi commented Sep 5, 2024

bufferAttribute.setX will apply the normalisation when it should not when we copy from the sparse array.


Simple file with morph target and color attributes (using sparse):
sparse.glb.zip

@mrdoob mrdoob added this to the r169 milestone Sep 5, 2024
Copy link
Collaborator

@donmccurdy donmccurdy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@@ -3153,6 +3153,10 @@ class GLTFParser {

}

// Ignore normalized since we copy from sparse
const prevNormalize = bufferAttribute.normalized;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Probably not necessary to save prevNormalize here, the original normalized variable is still in scope.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, updated the commit

@mrdoob mrdoob merged commit dd7e7b7 into mrdoob:dev Sep 5, 2024
11 checks passed
@Mugen87 Mugen87 changed the title Fix gltf sparse normalized Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants