We currently store assets in a optimized format KTX + compression. This is only optimal for specific platforms. On platforms which don't support these optimizations, it can take several minutes to load textures. Textures may also loose quality if using lossy compression
Being compressed and wrapped, assets are also much harder to work with and change. We cant simple swap a texture out or replace textures.
One solution too this is taking components and building a small executable which loads all available assets and performs specific optimizations for specific platforms. This can all be triaged by CMake at compile time.
Search assets for a assets.json file
Optimize assets according to this files requirements per platform
Cache sha256 of each file processed so that we do not rerun on each asset every build
Save to a folder known by the build system
Have assets which load as fast as possibly for a given platform
We currently store assets in a optimized format KTX + compression. This is only optimal for specific platforms. On platforms which don't support these optimizations, it can take several minutes to load textures. Textures may also loose quality if using lossy compression
Being compressed and wrapped, assets are also much harder to work with and change. We cant simple swap a texture out or replace textures.
One solution too this is taking components and building a small executable which loads all available assets and performs specific optimizations for specific platforms. This can all be triaged by CMake at compile time.
assets.json
fileVKB_OPTIMIZE_ASSETS
compression-priority
could potentially check for ASTC device support before optimizing (if running on the host)