🌐 Universal Game Model
Universal game model is a minimal crate designed as a high performance model format. Loading times can be very slow when repeatedly parsing a glTF model into a custom engine representation over and over each time a game is loaded up. Ugm solves this by allowing you to convert a glTF model into a ugm model once at bake time, after which it can be loaded directly as is with a 10x performance improvement!
Features
- glTF parsing
- Bc texture compression
- Normal & tangent generation
- Vertex packing
- Mipmap generation
- Astc texture compression
Usage
Serialization and deserialization are handled by speedy. For more info please look at their docs.
use ;
// Get the bytes of your model, more commonly you'd read it from a file
let gltf_model_bytes: & = include_bytes!;
// Parse a glTF model into a ugm model, this is relatively slow and shouldn't happen each time the application is launched
let ugm_model: Model = parse_glb
.expect;
// Serialize ugm model into bytes
let ugm_model_bytes: = ugm_model.write_to_vec.unwrap;
// Here you'd want to write out the serialized ugm model, which can then be loaded the next times the application is launched...
// Deserialize bytes into a ugm model
let ugm_model = read_from_buffer.unwrap;