Asset and resource management
Understand Byte Engine asset processing and resource loading.
Use this section to move authored files through Byte Engine's asset pipeline and load the resulting runtime data.
Byte Engine separates source assets from runtime-ready resources. The resource manager decides whether it can read a resource from storage or must process its source asset first.
Start with these terms:
- Asset: A source file for your application, such as a PNG image, glTF model, or JSON declaration.
- Resource: Runtime-ready data that Byte Engine produces from an asset. It includes metadata such as size, format, hash, image extent, or mesh layout.
- URL: A reference to an asset or resource. It can be a path relative to the
assetsdirectory or an internet URL.
Choose a task or concept:
- Assets
- Resources
- .bema material files
- BELD tool
- Install BELD
- Bake application resources
- Build and bundle an application
- Debug loading
Pipeline
When you request a resource, Byte Engine follows this pipeline:
- An application requests a resource by ID.
- The storage backend checks whether a processed resource already exists.
- If the resource is missing and an
AssetManageris installed, an asset handler bakes the source asset. - The processed resource metadata is serialized into storage.
- The storage backend writes the processed binary payload beside the metadata.
- The request returns a typed
Reference<T>that can load bytes and resolve dependencies.
Your systems can request typed images, meshes, materials, variants, or shaders without knowing whether BELD baked the data earlier or a debug build produced it on demand.
Runtime binary reads
A resource reference contains metadata and a reader for its binary payload. If you load data without providing a buffer, the reader uses its backing storage. For the Redb backend, this can serve bytes from a mapped payload file when the platform supports mapping.
Provide an explicit target when you need ownership or a specific memory layout:
ReadTargetsMut::Bufferreads into a caller-provided slice.ReadTargetsMut::Boxreads into an owned boxed slice.ReadTargetsMut::Streamsreads selected resource streams into caller-provided stream buffers.
If the reader cannot expose backing storage, loading falls back to an owned buffer. This keeps the default file-backed path copy-free while supporting consumers that need explicit storage.