-
Notifications
You must be signed in to change notification settings - Fork 193
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
Various glTF fixes, mostly meshopt related #875
Merged
Merged
Conversation
This file contains 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
lilleyse
reviewed
May 6, 2024
Comment on lines
283
to
287
// Leave intact any buffers that have a URI and no data. | ||
if (sourceBuffer.uri && sourceBuffer.cesium.data.empty()) { | ||
keepBuffer[i] = true; | ||
continue; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meshopt fallback buffers should also be left intact:
I've addressed @lilleyse's comment and added tests, so this is now ready to review and merge. |
The macOS runners are taking a while to launch. But everything else passed and the code looks good to me, so I'm going to merge. |
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.
EXT_meshopt_compression
is fun because it is, as far as I'm aware, the only thing other than a regularbufferView
that can reference abuffer
. This wasn't being accounted for in a lot of the glTF manipulation code.From the changelog:
Model::merge
. Previously these extensions could end up broken after merging.EXT_meshopt_compression
GltfUtilities::collapseToSingleBuffer
now works correctly even if some of the buffers in the model have auri
property and the data at that URI has not yet been loaded. Such buffers are left unmodified.GltfUtilities::collapseToSingleBuffer
now works correctly with bufferViews that have theEXT_meshopt_compression
extension.GltfUtilities::compactBuffer
now accounts for bufferViews with theEXT_meshopt_compression
when determining unused buffer ranges.GltfReader
decodes buffers with data URLs, and the size of the data in the URL does not match the buffer'sbyteLength
, thebyteLength
is now updated and a warning is raised. Previously, the mismatch was ignored and would cause problems later when trying to use these buffers.EXT_meshopt_compression
andKHR_mesh_quantization
are now removed fromextensionsUsed
andextensionsRequired
after they are decoded byGltfReader
.Draft because I need to write tests for a lot of this, though I have empirical evidence in another project that these changes are necessary and that they are working well.