bevyengine / bevyengine/bevy

Improve compressed image workflows

Open
#24,903 1 comment 0 reactions 0 assignees View on GitHub
A-Assets C-Feature C-Usability S-Needs-Design
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?

#23567 and #24223 improved the compressed image workflow by adding BCn/ASTC support, mipmapping, and other features. However, there's some problems:

1. **Targeting multiple platforms is awkward.**
- Users may want to choose between BasisU/BCn/ASTC per target platform.
- But BasisU and BCn/ASTC are mutually exclusive at compile time (see `compressed_image_saver` and `compressed_image_saver_universal` features).
- And choosing between BCn/ASTC is an environment variable.
- Both of these can be a problem if a single CLI or editor process/binary wants to handle multiple platforms.
2. **The default processing behavior is inflexible.**
- `ImagePlugin:::build` registers a default processor that automatically compresses `*.jpg, *.png`.
- Maybe the user doesn't want this by default.
- Or maybe they want other file extensions (`.tga` etc).
- UPDATE: Fixed to a basic level in #24904.
3. **Embedded images are not supported.**
- There's no workflow for images embedded in glTF files.

## What solution would you like?

1. **Targeting multiple platforms is awkward.**
- The asset processor should have general support for target platforms - this is not specific to images (see #9714 under "Per-Platform Processed Assets").
- Assuming that general API is added, the compressed image saver might just need some light restructuring.
2. **The default processing behavior is inflexible.**
- Adding settings to `ImagePlugin` seems like the obvious solution, at least for the short-term.
3. **Embedded images are not supported.**
- Open question, and arguably a general asset processing issue.
- Also depends on if/how the glTF loader ends up working with BSN.
- Maybe this gets solved as a side effect of other pipeline changes or processor improvements.

## What alternative(s) have you considered?

2. **The default processing behavior is inflexible.**
- Users can register their own default processor for other file extensions (but can't remove the one `ImagePlugin` adds).
- Users can add `.meta` files to override the default processor.
3. **Embedded images are not supported.**
- For glTFs, users can compress the images themselves or resave the glTF with non-embedded images.

Contributor guide

Open the contributing guide

Research direction

Start with #9714's per-platform processed assets discussion, then read the compressed_image_saver and compressed_image_saver_universal features and ImagePlugin::build. Trace how glTF loading and embedded images relate to BSN. Done requires an agreed scope and design covering platform selection, configurable default processing, and embedded-image handling.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.