From 7ead3dfc316fb109f8f30eea1aa00eb01a4ce1a6 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 17 Jan 2025 17:51:27 +0100 Subject: world: texture cache uri to res --- world/src/mesh.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'world/src/mesh.rs') diff --git a/world/src/mesh.rs b/world/src/mesh.rs index de4617f..2bcf4c0 100644 --- a/world/src/mesh.rs +++ b/world/src/mesh.rs @@ -14,7 +14,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -use crate::{Args, load_texture}; +use crate::{Args, TextureCache, load_texture}; use anyhow::Result; use gltf::{Mesh, Node, buffer::Data}; use log::{debug, info}; @@ -34,6 +34,7 @@ pub fn import_mesh( node: &Node, prefab: &mut Prefab, args: &Args, + texture_cache: &TextureCache, ) -> Result<()> { Ok(for p in mesh.primitives() { let name = mesh.name().or(node.name()).map(|e| e.to_owned()); @@ -121,6 +122,7 @@ pub fn import_mesh( &buffers, &tex.texture().source().source(), args.webp, + texture_cache, )?; tex_albedo = Some(r.clone()); tex_alpha = Some(r.clone()); @@ -134,6 +136,7 @@ pub fn import_mesh( &buffers, &tex.texture().source().source(), args.webp, + texture_cache, )?); } let mut tex_emission = None; @@ -145,6 +148,7 @@ pub fn import_mesh( &buffers, &tex.texture().source().source(), args.webp, + texture_cache, )?); } let mut tex_transmission = None; @@ -161,6 +165,7 @@ pub fn import_mesh( &buffers, &tex.texture().source().source(), args.webp, + texture_cache, )?); } let mut tex_thickness = None; @@ -177,6 +182,7 @@ pub fn import_mesh( &buffers, &tex.texture().source().source(), args.webp, + texture_cache, )?); } let mut tex_occlusion = None; @@ -188,6 +194,7 @@ pub fn import_mesh( &buffers, &tex.texture().source().source(), args.webp, + texture_cache, )?); } let mut tex_roughness = None; @@ -204,6 +211,7 @@ pub fn import_mesh( &buffers, &tex.texture().source().source(), args.webp, + texture_cache, )?; tex_roughness = Some(r.clone()); tex_metallic = Some(r.clone()); -- cgit v1.2.3-70-g09d2