Crate rend3_gltf

Crate rend3_gltf 

Source
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
AnimationChannel
Armature
A set of SkeletonHandles, one per mesh in the wrapping object, plus the index of the skin data in the skins array of LoadedGltfScene.
GltfLoadSettings
Determines parameters that are given to various parts of the gltf world that cannot be specified by gltf alone.
GltfSceneInstance
Data specific to each instance of a gltf scene.
ImageKey
Hashmap key for caching images.
Joint
Labeled
Wrapper around a T that stores an optional label.
LoadedGltfScene
Loaded data on a gltf scene that can be reused across multiple instances of the same set of objects.
Mesh
Set of MeshPrimitives that make up a logical mesh.
MeshPrimitive
A single sub-mesh of a gltf.
Node
Node in the gltf scene tree
Object
Set of ObjectHandles that correspond to a logical object in the node tree. When the node corresponds to an animated mesh, the armature will contain the necessary data to deform the primitives.
PosRotScale
Animation data for a single joint, with translation, rotation and scale channels.
Skin
Texture
A uploaded texture and its format.

Enums§

GltfLoadError
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’s io_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 many Objects 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.

Type Aliases§

ImageMap
Hashmap which stores a mapping from ImageKey to a labeled handle.