v0.12.0: 3D scenes, glTF loading and PBR materials
v0.12.0 is the largest release so far. It adds a Scene graph, a glTF model loader, and physically based (PBR) materials.
Full detail is in CHANGELOG.md.
3D scene graph and glTF loading
Section titled “3D scene graph and glTF loading”Scenetop-level container implementingRenderable, with a defaultCameraandLightinjected at render time.Scene::load, a glTF 2.0 loader for.gltfand.glb: mesh primitives, per-node transforms flattened intoModelmatrices, embedded cameras, andKHR_lights_punctuallights.Camera,Light, andModelas first-class scene objects, all absorbed through one genericScene::add/Pass::add(theSceneObjecttrait).- Higher-level
Material+Modelobjects layered over the existingShader/Meshcore. - Unified
Lighttype with one constructor per kind: directional, point, and spot. - Multi-light arrays plus scene-wide ambient, with the per-shader light cap raised from 8 to 32.
- Loader robustness: face-normal fallback for
POSITION-only meshes, and glTF sampler state (wrap modes, filtering) mapped intoSamplerOptions.
PBR materials and shading
Section titled “PBR materials and shading”Material::pbr()with metallic-roughness factors and all five glTF texture slots (base color, metallic-roughness, normal, occlusion, emissive).- PBR texture sampling routed through the material uniform binding.
- Lazy texture sources, drained on first render or explicitly via
Renderer::load. - Alpha modes (
Opaque/Mask/Blend) plusdouble_sided. - Automatic back-to-front depth sort for
alpha_mode: Blend, so translucent models compose correctly regardless of insertion order. - Tangent-space normal mapping via a full TBN transform, with
TANGENTfrom the accessor or a fixed-axis fallback. KHR_texture_transformthroughMaterial::uv_transform(offset, scale, rotation).- Per-vertex color (
COLOR_0) and a second UV set (TEXCOORD_1) as PBR vertex inputs.
Geometry and shaders
Section titled “Geometry and shaders”Vertex::pbr(position)seeds the five-attribute PBR layout with neutral defaults.Meshindices for indexed draws.- Vertex attribute name constants (
Vertex::UV0,Vertex::NORMAL, and the rest).
- Texture group restructure:
TextureandMipmapmove out ofcore/into their own group.
Upgrading
Section titled “Upgrading”- Shaders rendered without a material draw with blending off and render both faces. Every pipeline used premultiplied alpha blending before. To blend again, wrap the shader in
Material::custom(shader).alpha_mode(AlphaMode::Blend). TextureMipChainbecomesMipmap. Itsprepareturns intobuild,base_sizeintosize, andlevel_countintocount, whileformatandlevelskeep their names.
Release notes: GitHub v0.12.0.
Rafael
docs/website/src/content/docs/blog/announcing-v0-12-0.mdx