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 normal streams from meshes with unlit materials #633

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

zeux
Copy link
Owner

@zeux zeux commented Nov 16, 2023

Unlit materials do not require normals or tangents; we already automatically filter out tangents because of the lack of normal texture or other material extensions, but normals were not removed until now.

This can reduce the amount of geometry we need to output; this also mostly subsumes the redundant normal stream filtering for point clouds as point clouds often have an unlit material, but for now we'll keep that redundancy.

When material variants are used, we only do this when all material variants for a given mesh are unlit. The use of the default material also blocks this optimization as default material implies basic lighting.

Unlit materials do not require normals or tangents; we already
automatically filter out tangents because of the lack of normal texture
or other material extensions, but normals were not removed until now.

This can reduce the amount of geometry we need to output; this also
mostly subsumes the redundant normal stream filtering for point clouds
as point clouds often have an unlit material, but for now we'll keep
that redundancy.

When material variants are used, we only do this when all material
variants for a given mesh are unlit. The use of the default material
also blocks this optimization as default material implies basic
lighting.
@zeux zeux merged commit a5ad826 into master Nov 17, 2023
12 checks passed
@zeux zeux deleted the gltf-unlit branch November 17, 2023 15:34
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