Repository navigation
Support KHR_mesh_quantization in bevy_gltf - #25954
Merged
alice-i-cecile merged 3 commits intoOct 15, 2026
Merged
Conversation
Contributor
|
Can you confirm there's no need for an AI disclosure? I'm asking just in case it was overlooked - most of your other PRs have one. |
Contributor
Author
Sorry, re-added, not sure where it went, I blame GitHub |
greeble-dev
removed their request for review
September 29, 2026 13:07
stuartparmenter
added a commit
to stuartparmenter/bevy
that referenced
this pull request
Oct 3, 2026
Squashed from bevyengine#25954 (stuartparmenter:gltf-mesh-quantization). Dequantizes quantized positions, normals, tangents, texture coordinates and morph targets to floats while loading. Integer formats the extension doesn't allow still warn and are skipped, as before. Validation lets a required `KHR_mesh_quantization` through alongside the meshopt extensions.
jbuehler23
approved these changes
Oct 4, 2026
jbuehler23
left a comment
Contributor
There was a problem hiding this comment.
I'm not an expert on GLTF loading, but this looks to be an improvement and can be used for exporting scenes as GLTF in jackdaw i would think!
…esh-quantization
stuartparmenter
added a commit
to stuartparmenter/bevy
that referenced
this pull request
Oct 4, 2026
Squashed from bevyengine#26030 (stuartparmenter:gltf-gpu-quantization), which includes bevyengine#25954. Loads `KHR_mesh_quantization` files and, with `GltfPlugin::preserve_quantization` (on by default, overridable per load in `GltfLoaderSettings`), encodes quantized positions, normals, tangents and texture coordinates directly into the `MeshAttributeCompressionFlags` formats the mesh shaders already decode. `Mesh::decoded_positions`, `decoded_normals` and `decoded_uvs` keep CPU readers working on compressed meshes. Solari builds BLASes from compressed positions when the GPU supports `EXTENDED_ACCELERATION_STRUCTURE_VERTEX_FORMATS`.
stuartparmenter
added a commit
to stuartparmenter/bevy
that referenced
this pull request
Oct 5, 2026
Squashed from bevyengine#26030 (stuartparmenter:gltf-gpu-quantization), which includes bevyengine#25954. Loads `KHR_mesh_quantization` files and, with `GltfPlugin::preserve_quantization` (on by default, overridable per load in `GltfLoaderSettings`), encodes quantized positions, normals, tangents and texture coordinates directly into the `MeshAttributeCompressionFlags` formats the mesh shaders already decode. `Mesh::decoded_positions`, `decoded_normals` and `decoded_uvs` keep CPU readers working on compressed meshes. Solari builds BLASes from compressed positions when the GPU supports `EXTENDED_ACCELERATION_STRUCTURE_VERTEX_FORMATS`.
stuartparmenter
added a commit
to stuartparmenter/bevy
that referenced
this pull request
Oct 5, 2026
Squashed from bevyengine#26030 (stuartparmenter:gltf-gpu-quantization), which includes bevyengine#25954. Loads `KHR_mesh_quantization` files and, with `GltfPlugin::preserve_quantization` (on by default, overridable per load in `GltfLoaderSettings`), encodes quantized positions, normals, tangents and texture coordinates directly into the `MeshAttributeCompressionFlags` formats the mesh shaders already decode. `Mesh::decoded_positions`, `decoded_normals` and `decoded_uvs` keep CPU readers working on compressed meshes. Solari builds BLASes from compressed positions when the GPU supports `EXTENDED_ACCELERATION_STRUCTURE_VERTEX_FORMATS`.
hukasu
approved these changes
Oct 15, 2026
opensource-fork-sync Bot
pushed a commit
to cla7aye15I4nd/opensource-bevyengine__bevy
that referenced
this pull request
Oct 15, 2026
…vy_gltf (bevyengine#25953) # Objective Bevy can't load glTF files that use `EXT_meshopt_compression` or the newer `KHR_meshopt_compression`. ## Solution Add a `gltf_meshopt` feature (`meshopt` on bevy_gltf). It uses the `meshopt` crate that bevy_pbr already depends on for meshlets. After the buffers load, each compressed buffer view is decoded into its fallback buffer, so the rest of the loader reads it like uncompressed data. `bevy_gltf::extensions::khr_meshopt_compression::decode_buffer_views` exposes the same pass for code that reads glTF with the `gltf` crate directly. The `gltf` crate's validation rejects the extension as an unsupported required extension, so the loader runs the same validation with that one error removed. Without the feature, loading a file that requires the extension logs a warning that names the feature. `KHR_mesh_quantization` support is in a separate PR bevyengine#25954. ## Testing Tested w/ Zorah scene and my game --- This was AI assisted w/ Fable 5.1 and Opus 5.5 as part of my work to get the Zorah scene working. I used it to look for the cleanest way to add support and to do it. Then reviewed it, validated it worked in multiple applications, cleaned it up, and posted PR.
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.
Objective
Bevy can't load glTF files that use
KHR_mesh_quantization.Solution
Add support for quantized positions, normals, tangents, texture coordinates and morph targets by dequantizing them to floats while loading. Integer formats the extension doesn't allow still warn and are skipped, as before.
Testing
Tested w/ Zorah scene and my game
This was AI assisted w/ Fable 5.1 and Opus 5.5 as part of my work to on my game specifically around high poly foliage. I used the LLMs to look for the cleanest way to add support and to do it. Validated with my gltfpack'd meshes. I've reviewed reviewed it, tested it, cleaned it up, and posted this PR.