Expand description
Asset loading, caching, and GPU upload.
Each asset type provides a from_disk(path) constructor that in debug
builds loads the source file and overwrites the binary cache, and in
release builds loads the cache for faster startup.
§Types
| Type | File extension | Cache extension |
|---|---|---|
TextureFile | .png, .jpg, … | .otxtr |
Mesh3DFile | .obj, .stl | .omesh |
ShaderFile | .glsl | .oshdr |
Also provides the attr sub-module for vertex and instance attribute
descriptors used by meshes and instance buffers.
Modules§
- attr
- Vertex and instance attribute types.
Structs§
- Mesh2D
File - CPU-side 2D mesh geometry — positions, UVs, colours, indices, layer, and centre.
- Mesh3D
File - CPU-side 3D mesh geometry — positions, normals, UVs, colours, and indices.
- Shader
File - A shader loaded from disk (or cache), ready to compile.
- Texture
File - A texture loaded from disk (or cache) with metadata.
Enums§
- Center
- Controls how 2D mesh positions are offset relative to their centre.
- Shader
Type - Whether a shader source is a vertex+fragment pipeline or a compute shader.