Conversation
When -vph or -vth is specified, similarly to -vpf or -vtf, we use half-precision floating-point attribute storage. This results in the same scene or material structure without extra transform nodes, but unlike -vpf/-vtf the resulting asset uses the same amount of memory as it does by default when using integer quantization. Half-precision floats have ~11 bits of relative precision (10 + implied 1); this is lower precision than either position or texture coordinates use by default. As such, some assets might see excessive deformation - however, unlike integer quantization, individual meshes do not have to fit the same coordinate grid, so in practice it may be fine.
Half-precision encoding will use infinity to represent values above 65504; we now detect this and warn, suggesting -vpf which has a much larger range.
Mention KHR_accessor_float16 support.
This avoids GCC warning for enum switches; this does mean we'll need to carry a cgltf.h patch around across version updates, but maybe this can be upstreamed in the future.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
-vphor-vthflag is specified, similarly to-vpfor-vtf, we now usehalf-precision floating-point attribute storage via
KHR_accessor_float16extension.Note that the extension is still in draft, and doesn't appear to have support by existing renderers yet. If it does get added, it will be an interesting alternative to other options gltfpack provides, as it results in the same VRAM cost and a similar resulting file size compared to the default 16-bit integer quantization, albeit at a slightly lower (butmore adaptive) precision.
Extension: KhronosGroup/glTF#2397