Assets

Your source files (models, textures, sounds, fonts, your own data) go in assets/. The build cooks them into cooked/: the format each platform's GPU and audio want, compressed, ready to load in one read. The game only ever loads cooked files, and assets/ isn't shipped.

KindSource formats
Models and animations.glb, .gltf, .fbx, .vrm
Images.png, .jpg, .webp, .hdr (environments)
Audio.wav, .flac, .mp3
Video.mp4
Everything else.hzt: materials, scenes, your own data files

Cooking is incremental: only what changed is recooked. A model brings its materials and textures with it.

Loading

Every load is asynchronous. asset_load returns a handle right away, and the asset is ready some frames later.

Loading a model and putting it in the world
HzHandleT(ModelBlobAsset) tree =
    asset_load(ModelBlobAsset, assets, .path = "my_game/tree.glb");

// once asset_is_ready(assets, tree)
ecs_renderer_spawn(world, renderer, &(EcsRendererSpawnDesc){
    .model_asset = blob_asset_ref_from_handle(ModelBlobAsset, tree),
    .transform = {{2, 0, 5}, quat_identity(), V3_ONE}, // position, rotation, scale
    .casts_shadow = true,
});

Most of the time you don't load models from code at all: you place them in a scene with the editor, and the scene loads what it needs.

If you need to know exactly when something finished, asset_load_cb calls you back on the main lane when it's ready.

Worth knowing

The API is in hz/src/engine/assets/assets.h.