Skip to main content

Module resource

Module resource 

Source
Expand description

Runtime resource tables: per-kind, handle-indexed views of a compiled blob’s resource stream. A resource (an audio clip, a texture, a mesh, a material, …) is compiled by cook and addressed at runtime by its dense per-kind handle. The owning system reads the table by that handle instead of querying an ECS column or scanning names, so a resource lives in a table it owns rather than as a component. Renderer-free (the tables are plain handle-indexed data), so they live here where the physics / audio subsystem crates can reach them; the client re-exports them under crate::resource::*, alongside the engine-side install_resource_tables that inserts them as World resources.

Structs§

AudioClipTable
A handle-indexed table of one resource kind.
ColorLutTable
A handle-indexed table of one resource kind.
EnvironmentMapTable
A handle-indexed table of one resource kind.
FontTable
A handle-indexed table of one resource kind.
MaterialTable
A handle-indexed table of one resource kind.
MeshTable
A handle-indexed table of one resource kind.
ResourceEntry
One loaded resource’s runtime form. A payload resource (audio clip, and later meshes / textures) carries a PayloadLocator into the blob payload section; a data resource (a baked Material) carries its runtime bytes in data_bytes.
ResourceHandles
Per-kind handles assigned to each resource, keyed by its identity.
RuntimeMeshPayloads
Mesh payloads baked at world start, each under the asset id of the value that owns it, in the order they were installed.
SkinnedMeshTable
A handle-indexed table of one resource kind.
TextureTable
A handle-indexed table of one resource kind.

Enums§

MeshBlock
Which block of the shared mesh-source handle space an asset belongs to.

Functions§

append_environment_map
Install a baked IBL payload into the world’s environment-map table and return its handle. The renderer lights with the map at handle 0.
append_material
Install material into the world’s material table and return its handle. A material is a data resource: its clamped parameters are the whole entry.
append_mesh
Record payload as id’s geometry and return the handle it lands on.
install_tables
Install every per-kind table built from a compiled world’s resource stream into world. The single place the table set is enumerated: the shipped runtime’s blob load, the in-memory cook build, and the bake builder all reach it, so a kind that migrates into the stream gets wired into every host by adding one line here. Each builder MOVES its kind’s data bytes out of the records, so the caller’s record slice is spent scaffolding afterwards.