bevyengine / bevyengine/bevy

Upstream `bevy_basisu_loader` / use `basisu_c_sys`

Open
#23,597 0 comments 0 reactions 0 assignees View on GitHub
A-Assets A-Rendering C-Feature S-Waiting-on-SME X-Needs-SME
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

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

See also https://github.com/bevyengine/bevy/discussions/23358
I believe basisu is still worth better support. In the snapshot tests of `bevy_basisu_loader`, a BC7 skybox with mipmaps is 32 MB (though it's not zstd compressed), while ASTC 8x8 and XUASTC 8x8 is only 8 MB and 5.3 MB. See also [The-Three-Generations-of-GPU-Texture-Distribution](https://github.com/BinomialLLC/basis_universal/wiki/The-Three-Generations-of-GPU-Texture-Distribution)
Pros and cons of different texture formats I can think of:
|Format | Pros | Cons |
| ------------------------------ | --------------------------------------------------------- | ---------------------------------------------------------- |
| Common image formats (png, webp) | Small file size. Easy to view, port, and edit | Slow loading. VRAM and Bandwidth aren't reduced |
|Native GPU formats | Fastest loading speed, no decoding. Reduced VRAM and bandwidth | Size on disk is large[^1]. Requires separate versions for different platforms|
|Basis Universal formats | Small file size. Reduced VRAM and bandwidth. Portable | Slow loading[^2]. Requires basis universal dependency[^3] |

[^1]: ASTC with large block size is much smaller than BCn but isn't always available on desktop. There's also RDO which can reduce compressed size.
[^2]: No transcoding if basisu textures are standard ASTC and platform support it. Caching results to disk during installing/first loading is a solution, too.
[^3]: Needs C++ binding + wasm workaround. A pure Rust transcoder is a huge amount of work probably no one can finish it.

## What solution would you like?

Upstream [bevy_basisu_loader](https://github.com/beicause/bevy_basisu_loader).

## What alternative(s) have you considered?

No.

Contributor guide

Open the contributing guide

Research direction

Start with the linked discussion and the bevy_basisu_loader snapshot tests, then review the upstream bevy_basisu_loader project and the proposed basisu_c_sys dependency. Clarify the integration and wasm requirements before implementation; done means Bevy has an agreed upstream loader with the expected Basis Universal texture support.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.