Byte Engine Docs

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 assets directory or an internet URL.

Choose a task or concept:

Pipeline

When you request a resource, Byte Engine follows this pipeline:

  1. An application requests a resource by ID.
  2. The storage backend checks whether a processed resource already exists.
  3. If the resource is missing and an AssetManager is installed, an asset handler bakes the source asset.
  4. The processed resource metadata is serialized into storage.
  5. The storage backend writes the processed binary payload beside the metadata.
  6. 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::Buffer reads into a caller-provided slice.
  • ReadTargetsMut::Box reads into an owned boxed slice.
  • ReadTargetsMut::Streams reads 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.

Rust API

On this page