diff options
Diffstat (limited to 'world/src/main.rs')
-rw-r--r-- | world/src/main.rs | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/world/src/main.rs b/world/src/main.rs index efdd16b..7548d8f 100644 --- a/world/src/main.rs +++ b/world/src/main.rs @@ -21,6 +21,7 @@ pub mod physics; use anyhow::Result; use clap::Parser; use gltf::{Gltf, image::Source, import_buffers}; +use humansize::BINARY; use image::{ImageReader, codecs::webp::WebPEncoder}; use log::{debug, info}; use mesh::import_mesh; @@ -97,21 +98,26 @@ fn main() -> Result<()> { .map(|node| { let mut prefab = Prefab::default(); if let Some(mesh) = node.mesh() { - info!("--- MESH ---"); import_mesh(mesh, &buffers, &store, path_base, &node, &mut prefab, &args)?; } let (position, _, _) = node.transform().decomposed(); if let Some(light) = node.light() { - info!("--- LIGHT ---"); + let name = node.name().map(|e| e.to_owned()); + if let Some(name) = &name { + info!("adding light {name:?}"); + } else { + info!("adding light"); + } let emission = Some(Vec3A::from_array(light.color()) * light.intensity()); if let Some(e) = emission { - info!("emission is {e}"); + debug!("emission is {e}"); } prefab.light.push(( Vec3A::from_array(position), store.set(&LightPart { emission, - ..Default::default() + name, + radius: None, })?, )); } @@ -149,6 +155,13 @@ fn main() -> Result<()> { let pres = store.set(&prefab)?; + let mut size = 0; + store.iter(|d| size += d.len()).unwrap(); + info!( + "prefab has network size of {}", + humansize::format_size(size, BINARY) + ); + if args.dry_run { return Ok(()); } |