apeltsi / loitsu

Cross-platform Game Engine written in Rust
MIT License
1 stars 0 forks source link

Meta Textures #49

Closed apeltsi closed 6 months ago

apeltsi commented 7 months ago

This is a file containing data about a sprite asset. It contains:

This data is stored in the JSON data, but it gets encoded into a much smaller type during shard-gen.

A sprite renderer is pointing toward a PNG file: example.png.

Case 1: A file in the same path exists named example.png.meta This file will be parsed instead of example.png, if this file points to example.png then it will be encoded.

Case 2: No matching meta file exists In this case the system will fall back to any normal PNG file at the specified path and generate a default meta texture. This meta texture won't be saved on disk, it will only be encoded onto the shard so that runtime can read all of the needed data.

This system could be expanded upon in the future, a sprite sheet could automatically be converted to a set of meta textures with different UVs during shard-gen.

This will make #24 & #29 possible

Task List:

Runtime:

Shard-Gen