Skip to content

Improve compressed image workflows #24903

Description

@greeble-dev

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.
  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 Bevy Asset V2 Tracking Issue #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?

  1. 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.
  2. Embedded images are not supported.
    • For glTFs, users can compress the images themselves or resave the glTF with non-embedded images.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AssetsLoad files from disk to use for things like images, models, and soundsC-FeatureA new feature, making something new possibleC-UsabilityA targeted quality-of-life change that makes Bevy easier to useS-Needs-DesignThis issue requires design work to think about how it would best be accomplished

    Type

    No type

    Projects

    Status
    Needs SME Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions