Skip to content

Support KHR_texture_basisu in bevy_gltf #19104

Open
@jf908

Description

@jf908

What problem does this solve or what need does it fill?

When a gltf file is loaded that uses the KHR_texture_basisu extension, bevy fails to load the asset with a KHR_texture_basisu is not supported error.

What solution would you like?

Bevy should load the file.

What alternative(s) have you considered?

None

Additional context

This error was surprising to me because there is a sample gltf file that uses ktx2 texture files but it turns out this file has been altered so that it can be loaded in bevy.

By default, gltf files only support jpg and png images but there are official extensions for ktx2, webp, and dds. Bevy supports loading image of those types but they are specified in gltf files in a different way, explained here, to allow for jpg/png fallbacks.

As far I could tell, gltf-rs does not support those custom image extensions and will error if they are required of the gltf file but if gltf is compiled with the allow_empty_texture feature, it would be somewhat simple for bevy to just read the json and load the correct path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-glTFRelated to the glTF 3D scene/model formatC-FeatureA new feature, making something new possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions