Skip to content

Support for KHR_texture_basisu in bevy-gltf#24380

Closed
mholiv wants to merge 2 commits into
bevyengine:release-0.19.0from
mholiv:release-0.19.0-KHR_texture_basisu
Closed

Support for KHR_texture_basisu in bevy-gltf#24380
mholiv wants to merge 2 commits into
bevyengine:release-0.19.0from
mholiv:release-0.19.0-KHR_texture_basisu

Conversation

@mholiv
Copy link
Copy Markdown
Contributor

@mholiv mholiv commented May 21, 2026

Objective

At this time fully spec complaint gltf files with universal-basisu textures are not loadable in bevy. This PR fixes that by introducing the concept of document image indies.

We add some indies infrastructure and use that to check for basisu as per the spec and prefer it over the native (i.e. strictly png and jpeg) texture.

We also allow for no native gltf texture while we have a universal-basisu texture.

This approach is, can be expanded to allow for the correct parsing of EXT_texture_webp and MSFT_texture_dds (auto rejected it when presented by upstream gltf-rs)

This PR is scoped to strictly fix basisu. A trivial patch could be submitted building on this work to fully correctly parse webp as per the EXT_texture_webp spec.

Background

Right now we can parse gltf files with webp and basisu textures but only if we deviate from the specification. This patch does not act on that.

This patch allows bevy to parse strictly complaint gltfs in addition to how we handle them now.

@mholiv
Copy link
Copy Markdown
Contributor Author

mholiv commented May 21, 2026

This was tested on my local machine and I could load strictly correct gltf files with basisu textures

@ChristopherBiscardi
Copy link
Copy Markdown
Contributor

looks like the ci failure is just some clippy lints at the moment

@ChristopherBiscardi
Copy link
Copy Markdown
Contributor

this will also need to be targeted at the main branch instead of release-0.19.0

@ChristopherBiscardi ChristopherBiscardi self-requested a review May 21, 2026 20:37
@kfc35 kfc35 added S-Needs-Review Needs reviewer attention (from anyone!) to move forward A-glTF Related to the glTF 3D scene/model format labels May 21, 2026
@alice-i-cecile alice-i-cecile added the C-Feature A new feature, making something new possible label May 22, 2026
@alice-i-cecile alice-i-cecile requested a review from beicause May 22, 2026 09:35
@alice-i-cecile alice-i-cecile added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 22, 2026
@mholiv
Copy link
Copy Markdown
Contributor Author

mholiv commented May 22, 2026

This was replaced by #24397 24397

@mholiv mholiv closed this May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-glTF Related to the glTF 3D scene/model format C-Feature A new feature, making something new possible S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants