bevyengine / bevyengine/bevy

Processed assets should be able to have a different file extension than unprocessed assets

Open
#14,383 0 comments 0 reactions 0 assignees View on GitHub
A-Assets C-Usability S-Needs-Design
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

From what I saw, this is not possible at the moment. Correct me if I'm wrong there or if there is already an issue tracking this.

Lets say we have a `my_image.png` that is processed with an `CompressedImageSaver` to a basis universal texture file. At the moment, the saved file inside the `imported_assets` directory sill has the `png` file extension although the file is not an valid png file anymore (because its now a basis universal texture). Of course this makes loading the files simple, since the `asset_server.load` call can just take the source path and lookup the same file inside the `imported_assets` folder. If we want to change the path of the processed asset, we need some kind of lookup table where we have an unprocessed path -> processed path mapping.

One potential way of doing this would be to store the processed file path inside the `AssetMeta` file. Lets say we have our `assets/my_image.png` and we process it with the `CompressedImageSaver` to `imported_assets/my_image.basisu` (I don't know what the proper file extension for basis universal is, lets pretend its right), we could also save the `imported_assets/my_image.png.meta` file. Every time we call `asset_server.load("my_image.png")`, we could now look up the path .meta file, and we could add a `processed_path` field there that points to the processed path ( `my_image.basisu` in this case).

I'm happy to discuss other possibilities there, this was just my initial thought how to do this. I would love to write an implementation for it, but I thought it was important to first discuss roughly what it should look like.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the asset processing flow around CompressedImageSaver, AssetMeta, and asset_server.load, including how files in imported_assets are located. Compare the current source-path lookup with the proposed processed_path mapping. Done should allow a processed asset to use a different extension while preserving loading from its source path.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.