decentraland / decentraland/godot-explorer
Integrate Metamorph API for Asset Conversion & Animated Image Support
- Dominant language
- Rust
- Stars
- 18
- Forks
- 19
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 43
Description
**Title:** Integrate Metamorph API for Asset Conversion & Animated Image Support
**Description:**
Currently, assets are downloaded directly from one of the following sources:
* Content Server
* Optimized Assets Bucket
* External URLs (e.g., OpenSea images)
Some assets, such as OpenSea-hosted images, will always come from external URLs. To improve performance, consistency, and compatibility, we should integrate [[Metamorph](https://github.com/decentraland/metamorph)](https://github.com/decentraland/metamorph) — a Foundation-built service that:
* Converts any static image format to `.ktx`
* Converts animated image formats (`.gif`, `.webp`) to `.mp4`
* Resizes all images to a maximum of **1024×1024**
**Task:**
* Implement the [[Metamorph API](https://metamorph-api.decentraland.org/convert?url=...)](https://metamorph-api.decentraland.org/convert?url=...) into the asset retrieval process.
* Ensure that all assets (from any source) are processed through Metamorph before being used.
* Make animated images work properly by using `.mp4` output from Metamorph instead of the raw `.gif` or `.webp`.
**Why:**
* **Performance:** `.ktx` and `.mp4` formats are more optimized for rendering.
* **Consistency:** All images will have standardized formats and dimensions.
* **Compatibility:** Animated images will be supported without relying on browser-specific behavior.
**Acceptance Criteria:**
1. All assets, regardless of source, are fetched via the Metamorph conversion endpoint before rendering.
2. Static images are converted to `.ktx` and resized (max 1024×1024).
3. Animated images are converted to `.mp4` and play correctly in the UI.
4. No regressions in asset loading times or rendering quality.
Note:
The converted format is KTX2 with UASTC compression
It is using the following format to convert:
```
toktx --t2 --uastc --genmipmap --zcmp 3 --lower_left_maps_to_s0t0 --assign_oetf srgb $input $output
````
Contributor guide
Assessment
This issue has not been assessed yet.