diff options
Diffstat (limited to 'world/src/main.rs')
-rw-r--r-- | world/src/main.rs | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/world/src/main.rs b/world/src/main.rs index 81d411e..2014996 100644 --- a/world/src/main.rs +++ b/world/src/main.rs @@ -177,6 +177,16 @@ fn main() -> Result<()> { &tex.texture().source().source(), )?); } + let mut tex_emission = None; + if let Some(tex) = p.material().emissive_texture() { + tex_emission = Some(load_texture( + "emission", + &store, + path_base, + &buffers, + &tex.texture().source().source(), + )?); + } let mut tex_roughness = None; let mut tex_metallic = None; if let Some(tex) = p @@ -203,7 +213,7 @@ fn main() -> Result<()> { let g_albedo = if base_color[0] != 1. || base_color[1] != 1. || base_color[2] != 1. { info!( - "global albedo is r={},g={},b={}", + "global albedo is r={},g={},b={}", base_color[0], base_color[1], base_color[2] ); Some(Vec3A::new(base_color[0], base_color[1], base_color[2])) @@ -219,12 +229,25 @@ fn main() -> Result<()> { None }; + let emission = p.material().emissive_factor(); + let g_emission = if emission[0] != 0. || emission[1] != 0. || emission[2] != 0. { + info!( + "global emission is r={},g={},b={}", + base_color[0], base_color[1], base_color[2] + ); + Some(Vec3A::new(emission[0], emission[1], emission[2])) + } else { + debug!("global emission pruned"); + None + }; + let part = store.set( &Part { g_albedo, g_transmission, g_metallic, g_roughness, + g_emission, va_position, va_normal, va_texcoord, @@ -235,7 +258,9 @@ fn main() -> Result<()> { tex_roughness, tex_metallic, tex_transmission, + tex_emission, index, + va_emission: None, // not supported by gltf va_metallic: None, // not supported by gltf va_roughness: None, // not supported by gltf } |