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

gltfpack: Remove point normal streams when they are constant #617

Merged
merged 2 commits into from
Oct 10, 2023
Merged

Conversation

zeux
Copy link
Owner

@zeux zeux commented Oct 8, 2023

A fair amount of point cloud exports to glTF seem to have a redundant
normal stream (filled with the same value). This is relatively common
(about one in 6-7 files from Sketchfab has this issue), and it results
in incorrect rendering for renderers that respect normals and extra
data (4 out of 16 bytes in point clouds with normals & colors).

While it may sometimes be incorrect to remove this data, for now let's
err on the side of aggressive optimization and detect & remove it.

zeux added 2 commits October 8, 2023 16:04
Instead of a separate implementation, we now have isConstant function
that can check the entire vertex stream; this will be useful in the
future.
A fair amount of point cloud exports to glTF seem to have a redundant
normal stream (filled with the same value). This is relatively common
(about one in 6-7 files from Sketchfab has this issue), and it results
in incorrect rendering for renderers that respect normals *and* extra
data (4 out of 16 bytes in point clouds with normals & colors).

While it may sometimes be incorrect to remove this data, for now let's
err on the side of aggressive optimization and detect & remove it.
@zeux zeux merged commit ec50995 into master Oct 10, 2023
@zeux zeux deleted the gltf-pnorm branch October 10, 2023 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant