From 31894c36de83f20b8df73d75af640e91a7819987 Mon Sep 17 00:00:00 2001 From: Shawn Avery Date: Tue, 8 Sep 2026 12:12:29 -0400 Subject: [PATCH] Enable gltf crate KHR feature flags The gltf crate gates each KHR extension behind a cargo feature and rejects any glTF whose extensionsRequired lists an extension it was not compiled with, returning Validation([(Path("extensionsRequired[0] = ..."), Unsupported)]). Because glimpse depends on `gltf = "1.4"` with default features only, models that mark KHR_materials_unlit as required fail to load. load_from_bytes falls through to the lenient Gltf::from_slice path, but that runs the same validation and fails identically, so no thumbnail is produced at all. This is common in the wild: Kenney's blocky-characters, retro-fantasy-kit and retro-urban-kit all mark KHR_materials_unlit as required. Enabling the flags is enough on its own; no code changes are needed, since the existing material handling already reads base color and textures. Measured over 99 real GLB files (86 Kenney models spanning 44 kits, 13 from a personal project): hard failures dropped from 7 to 1. The remaining failure requires KHR_mesh_quantization, which the gltf crate does not support and has no feature flag for. All 110 existing tests pass. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Jv8DyjXuNjQBrCeRnBGDPE --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 5e9ed05..8f4c0cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ path = "src/bin/glimpse.rs" [dependencies] base64 = "0.22" glam = "0.31" -gltf = "1.4" +gltf = { version = "1.4", features = ["KHR_materials_unlit", "KHR_texture_transform", "KHR_materials_specular", "KHR_materials_ior", "KHR_materials_emissive_strength"] } image = { version = "0.25", default-features = false, features = ["png", "jpeg"] } json5 = "0.4" obj-rs = "0.7"