Skip to content

gltfpack: Support optional tangent space generation#1048

Merged
zeux merged 2 commits intomasterfrom
gltf-tang
Apr 29, 2026
Merged

gltfpack: Support optional tangent space generation#1048
zeux merged 2 commits intomasterfrom
gltf-tang

Conversation

@zeux
Copy link
Copy Markdown
Owner

@zeux zeux commented Apr 28, 2026

When -gt flag is specified, we now replace the original mesh tangents
with newly generated ones, using the new meshoptimizer tangent algorithm.

While it would be possible to only generate tangent streams for meshes
that don't already have one, a lot of existing glTF assets have tangents
that are broken or poor quality, so for now we always overwrite tangents,
and also use the higher quality default algorithm.

In the future we could add extra options to customize this.

Morph tangents are rare and require custom code so that we only split
the mesh based on original normal stream; for now we simply drop them.

zeux added 2 commits April 28, 2026 12:53
When -gt flag is specified, we now replace the original mesh tangents
with newly generated ones, using the new meshoptimizer tangent algorithm.

While it would be possible to only generate tangent streams for meshes
that don't already have one, a lot of existing glTF assets have tangents
that are broken or poor quality, so for now we always overwrite tangents,
and also use the higher quality default algorithm.

In the future we could add extra options to customize this.

Morph tangents are rare and require custom code so that we only split
the mesh based on original normal stream; for now we simply drop them.
We need -kv to force tangent generation for meshes that don't have a
normal map.
@zeux zeux marked this pull request as ready for review April 29, 2026 05:26
@zeux zeux merged commit 90c37e5 into master Apr 29, 2026
13 checks passed
@zeux zeux deleted the gltf-tang branch April 29, 2026 15:18
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