From cb46b760ae8d4aeaa0e92a9c313927ffdef27873 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 10 Jan 2025 20:49:28 +0100 Subject: fix interleaved vertex arrays --- world/src/main.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'world/src/main.rs') diff --git a/world/src/main.rs b/world/src/main.rs index c90ff0c..72e7df2 100644 --- a/world/src/main.rs +++ b/world/src/main.rs @@ -18,7 +18,7 @@ pub mod mesh; pub mod physics; -use anyhow::{Result, bail}; +use anyhow::Result; use clap::Parser; use gltf::{Gltf, image::Source, import_buffers}; use image::{ImageReader, codecs::webp::WebPEncoder}; @@ -221,8 +221,15 @@ fn load_texture( File::open(path)?.read_to_end(&mut buf)?; Image(buf) } - _ => { - bail!("texture is external and has no mime type") + gltf::image::Source::Uri { + uri, + mime_type: None, + } => { + info!("{name} texture is {uri:?} and has no type"); + let path = path.join(uri); + let mut buf = Vec::new(); + File::open(path)?.read_to_end(&mut buf)?; + Image(buf) } }; -- cgit v1.2.3-70-g09d2