Expand description
gltf scene and model loader for rend3.
This crate attempts to map the concepts into gltf as best it can into rend3, but there is quite a variety of things that would be insane to properly represent.
To “just load a gltf/glb”, look at the documentation for load_gltf
and
use the default filesystem_io_func
.
Individual components of a gltf can be loaded with the other functions in this crate.
§Supported Extensions
KHR_punctual_lights
KHR_texture_transform
KHR_material_unlit
§Known Limitations
- Only the albedo texture’s transform from
KHR_texture_transform
will be used. - Double sided materials are currently unsupported.
Modules§
- util
- Implementation utilities.
Structs§
- Animation
- Animation
Channel - Armature
- A set of
SkeletonHandle
s, one per mesh in the wrapping object, plus the index of the skin data in theskins
array ofLoadedGltfScene
. - Gltf
Load Settings - Determines parameters that are given to various parts of the gltf world that cannot be specified by gltf alone.
- Gltf
Scene Instance - Data specific to each instance of a gltf scene.
- Image
Key - Hashmap key for caching images.
- Joint
- Labeled
- Wrapper around a T that stores an optional label.
- Loaded
Gltf Scene - Loaded data on a gltf scene that can be reused across multiple instances of the same set of objects.
- Mesh
- Set of
MeshPrimitive
s that make up a logical mesh. - Mesh
Primitive - A single sub-mesh of a gltf.
- Node
- Node in the gltf scene tree
- Object
- Set of
ObjectHandle
s that correspond to a logical object in the node tree. When the node corresponds to an animated mesh, thearmature
will contain the necessary data to deform the primitives. - PosRot
Scale - Animation data for a single joint, with translation, rotation and scale channels.
- Skin
- Texture
- A uploaded texture and its format.
Enums§
- Gltf
Load Error - Describes how loading gltf failed.
Functions§
- add_
mesh_ by_ index - Adds a single mesh from the
LoadedGltfScene
found by its index, as an object to the scene. - filesystem_
io_ func - Default implementation of
load_gltf
’sio_func
that loads from the filesystem relative to the gltf. - instance_
loaded_ scene - Instances a Gltf scene that has been loaded using
load_gltf_data
. Will create as manyObject
s as required. - load_
buffers - Loads buffers from a
gltf::Buffer
iterator, calling io_func to resolve them from URI. - load_
default_ material - Creates a gltf default material.
- load_
gltf - Load a given gltf into the renderer’s world.
- load_
gltf_ data - Load a given gltf’s data, like meshes and materials, without yet adding any of the nodes to the scene.
- load_
image - Loads a single image from a
gltf::Image
. - load_
image_ cached - Loads a single image from a
gltf::Image
, with caching. - load_
materials_ and_ textures - Loads materials and textures from a
gltf::Material
iterator. - load_
meshes - Loads meshes from a
gltf::Mesh
iterator.