8 breaking releases

new 0.9.0 May 17, 2024
0.7.0 Mar 15, 2024
0.3.0 Dec 24, 2023
0.2.0 Nov 22, 2023

#329 in Graphics APIs

Download history 147/week @ 2024-02-12 14/week @ 2024-02-19 35/week @ 2024-02-26 110/week @ 2024-03-11 19/week @ 2024-03-18 34/week @ 2024-04-01 173/week @ 2024-04-22 106/week @ 2024-04-29 119/week @ 2024-05-13

398 downloads per month
Used in xc3_wgpu

MIT license

17K SLoC


xc3_model is a high level library for xc3_lib.

xc3_model provides a simple, standardized interface for working with models, textures, materials, and animations. All models and maps from all supported game versions are converted to the same set of types. This greatly reduces the amount of code needed for applications and libraries to work with in game models.

xc3_model has limited support for converting data back to xc3_lib types to enable saving changes to disk. The goal is for the resulting file structs to be functionally equivalent in game even if the data changes slightly due to simplifying assumptions or adjustments to improve cross game compatibility.

Python bindings for xc3_model are available with xc3_model_py.



xc3_model provides high level data access for the files that make up a model.

Each type represents fully compressed and decoded data associated with one or more [xc3_lib] types. This simplifies the processing that needs to be done to access model data and abstracts away most of the game specific complexities.

Getting Started

Loading a normal model returns a single [ModelRoot]. Loading a map returns multiple [ModelRoot]. Each [ModelRoot] has its own set of images.

The [ShaderDatabase] is optional and improves the accuracy of texture and material assignments.

use xc3_model::shader_database::ShaderDatabase;

let database = ShaderDatabase::from_file("xc3.json")?;

let root = xc3_model::load_model("ch01011013.wimdo", Some(&database))?;
println!("{}", root.image_textures.len());

let roots = xc3_model::load_map("ma59a.wismhd", Some(&database))?;
println!("{}", roots[0].image_textures.len());


~313K SLoC