glTF 2.0 loader for Blinc.
Parses .glb / .gltf files via the upstream
gltf crate and maps the result into
Blinc's native interchange types (MeshData, Vertex, Material,
Skeleton, Bone) plus a thin scene graph ready for
blinc_canvas_kit::SceneKit3D.
Screen.Recording.2026-04-14.at.23.17.03.mp4
use blinc_gltf::load_glb;
use blinc_canvas_kit::SceneKit3D;
let bytes = std::fs::read("DamagedHelmet.glb")?;
let scene = load_glb(&bytes)?;
let kit = SceneKit3D::new("viewer");
let handles = scene.add_to(&kit);
println!("spawned {} primitives", handles.len());| glTF concept | Blinc type |
|---|---|
| Primitives (position / normal / UV0 / color / tangent / joints / weights / indices) | MeshData / Vertex |
pbrMetallicRoughness factors + all five texture slots |
Material |
alphaMode (OPAQUE / MASK / BLEND) |
AlphaMode |
KHR_materials_unlit |
Material::unlit |
| Nodes (TRS or matrix, parent/child links) | GltfNode + NodeTransform |
| Skins (joints + inverse bind matrices) | Skeleton / Bone in GltfSkeleton |
| Animations (channels + samplers + interpolation) | GltfAnimation (data only) |
SceneKit3Dspawning:GltfScene::add_tobakes each node's world transform into its vertices at spawn time (SceneKit3D's current transform API exposes only Y-rotation). Skins / animations are not applied — those feed intoblinc_skeleton.- Per-node world transforms: [
GltfScene::compute_world_transforms] returns aVec<Mat4>parallel toscene.nodesfor callers who want their own scene graph.
Covers the common PBR static-geometry case — enough to load Khronos
sample assets like BoxTextured, DamagedHelmet, FlightHelmet.
Skin and animation data is parsed and exposed but runtime posing is
deferred to blinc_skeleton.
See BACKLOG.md for planned work: secondary UV sets, morph targets, sparse accessors, compression extensions, and more PBR extensions.
Apache-2.0.