Expand description
§Asset Pipeline
A comprehensive asset management system for the Proof Engine.
§Overview
The asset pipeline provides a complete lifecycle for all game/engine assets:
loading from disk, caching, hot-reloading, dependency tracking, post-processing,
and streaming. It is designed to work entirely with std — no external crates.
§Architecture
AssetServer
├── AssetRegistry — type-erased storage of all loaded assets
├── AssetCache — LRU eviction layer
├── HotReload — poll-based file watcher
├── StreamingManager — priority queue for background loads
└── AssetPack[] — optional archive bundles§Usage
use proof_engine::asset::{AssetServer, AssetPath, ImageAsset};
let mut server = AssetServer::new();
let handle = server.load::<ImageAsset>(AssetPath::new("textures/player.png"));
// Later, after the asset is ready:
if let Some(img) = server.get(&handle) {
println!("{}x{}", img.width, img.height);
}Structs§
- Asset
Cache - LRU eviction cache that sits on top of
AssetRegistry. - Asset
Dependency - Records which other assets a given asset depends on.
- Asset
Handle - A strong handle that keeps the underlying asset alive.
- AssetId
- Opaque numeric identifier for a loaded asset, parameterised by asset type.
- Asset
Manifest - A declarative list of assets to pre-load.
- Asset
Pack - A bundle of multiple asset files stored in a single archive.
- Asset
Path - A path to an asset, optionally qualified with a sub-asset label.
- Asset
Registry - Central type-erased registry that maps numeric IDs to asset slots.
- Asset
Server - The central asset server: coordinates loading, caching, hot-reload, and streaming.
- Asset
Server Config - Configuration for
AssetServer. - Asset
Server Stats - Runtime statistics for the asset server.
- Audio
Normalizer - Normalises audio samples to the range
[-1.0, 1.0]. - Font
Asset - A loaded font, decomposed into per-glyph data and face metrics.
- Font
Metrics - Metrics for the whole font face.
- Glyph
Data - Geometry and metrics for a single glyph.
- HotReload
- Poll-based hot-reload watcher.
- Image
Asset - A loaded image — raw decoded pixel data.
- Manifest
Entry - A single entry in an
AssetManifest. - Material
Asset - A PBR material description.
- Mesh
Asset - A loaded triangle mesh.
- MipMap
Generator - Generates box-filtered mip-maps for
ImageAssetdata. - Plain
Text Script Loader - Loader for plain-text script files.
- Plain
Text Shader Loader - Loader for plain-text shader source files.
- Prefab
Ref - A reference to a re-usable prefab template.
- RawImage
Loader - Loader for raw RGBA8 image files.
- RawSound
Loader - Loader for raw PCM audio files.
- Scene
Asset - A complete serialised scene graph.
- Scene
Entity - A serialised entity in a scene.
- Script
Asset - A raw script source file.
- Shader
Asset - A loaded GLSL / WGSL / SPIR-V shader source.
- Sound
Asset - A loaded audio clip stored as normalised float samples.
- Stream
Request - An entry in the streaming queue.
- Streaming
Manager - Priority queue of pending asset loads.
- Vertex
- A single vertex in a mesh.
- Weak
Handle - A weak handle that does not prevent the asset from being evicted.
Enums§
- Load
State - The current load state of an asset identified by its raw ID.
- Material
Param - Either a constant scalar value or a reference to a texture channel.
- Outline
Command - A single command in a glyph outline path.
- Pixel
Format - Pixel format for
ImageAssetdata. - Shader
Stage - Which pipeline stage a shader belongs to.
- Stream
Priority - Priority level for a streaming request.
Traits§
- Asset
- Marker trait for any type that can be stored as an asset.
- Asset
Loader - Trait for loading raw bytes into a concrete
Assettype. - Asset
Processor - Post-processes an asset after it is first loaded.
Functions§
- default_
asset_ server - Build a default
AssetServerwith all built-in loaders registered. - load_
file_ bytes - Load a file synchronously from disk, returning its bytes.