gltfpack: Preserve custom ID attributes #568
Merged
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.
This change keeps attributes
_ID
,_BATCHID
and_FEATURE_ID_*
in tact when processing the scene. We assume that these attributes are scalar and encode them as floating-point (to avoid possible range issues with uint16).This change is similar to #530 (without the extraneous names) but it crucially limits the supported attributes by name otherwise we can not assume that the attribute is scalar or integer, whereas with this filtering the assumption is reasonably safe.
For increased compression efficiency, when
-cc
is applied we use exponential encoding unless the IDs exceed the maximum permissible range. On some test files that use feature and vertex ids, this reduces the compressed size of ID attribute streams by ~2x.Relates to #165
Fixes #529
Closes #530