Asset base class. Each type implements Load(), Unload(), and the ISerializable interface, and is loaded through AssetManager. This page describes the purpose, key fields, serialization format, and usage pattern for each type.
Asset base class
All asset types derive fromPrisma::Asset, which provides the shared interface and metadata fields:
AssetType enum lists all recognized asset categories:
TextureAsset
TextureAsset represents a 2D image loaded via the stb_image library. It is the most commonly used asset type and serves as the source for sprites, UI elements, terrain maps, normal maps, and other surface textures.
Key fields
Serialization format
TextureAsset supports both JSON and binary (Base64 + zstd) serialization:
JSON format:
Usage example
MeshAsset
MeshAsset holds the geometry data for a 3D model — vertex positions, normals, UVs, and index buffers. It is used by the rendering system to draw dynamic and static objects in the scene.
Key fields
Serialization format
JSON format:Usage example
Sub-mesh names are preserved during serialization. The renderer uses sub-mesh ranges to apply different materials to parts of a single mesh without splitting the geometry into separate draw calls.
TilemapAsset
TilemapAsset loads 2D tile maps exported from the Tiled map editor in .tmx (XML) format. It uses tinyxml2 for parsing and supports multi-layer maps with tile IDs, object layers, and tileset references.
Key fields
TMX input format
TilemapAsset reads standard Tiled TMX files directly. Example:
Serialization format
After loading from TMX, aTilemapAsset can be re-serialized to JSON or binary for faster runtime reloads:
Usage example
CubemapTextureAsset
CubemapTextureAsset loads six images representing the faces of a cube and assembles them into a cubemap used for skyboxes and environment-based reflections. Each face is loaded via stb_image, the same backend used by TextureAsset.
Face order
Faces are expected in this order, matching OpenGL / Vulkan conventions:Key fields
Serialization format
JSON format — one entry per face:Load() implementation accepts a manifest JSON file that lists the six face paths:
Usage example
Implementing a custom asset type
ExtendAsset and implement the three required methods:
AssetManager like any built-in type: