diff options
author | metamuffin <metamuffin@disroot.org> | 2025-01-09 02:07:03 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-01-09 02:07:03 +0100 |
commit | c98498f5b6cb147bc506f0aba27065e98b08a8d8 (patch) | |
tree | 402dffc76ee0327138959a2c6e92b65039bbed7b /world/src/mesh.rs | |
parent | 060a94327220a61d72b2f064b2d170639bff866a (diff) | |
download | weareserver-c98498f5b6cb147bc506f0aba27065e98b08a8d8.tar weareserver-c98498f5b6cb147bc506f0aba27065e98b08a8d8.tar.bz2 weareserver-c98498f5b6cb147bc506f0aba27065e98b08a8d8.tar.zst |
add mesh alpha property and correct usage of transmission
Diffstat (limited to 'world/src/mesh.rs')
-rw-r--r-- | world/src/mesh.rs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/world/src/mesh.rs b/world/src/mesh.rs index 8742fb7..6a295c7 100644 --- a/world/src/mesh.rs +++ b/world/src/mesh.rs @@ -114,7 +114,7 @@ pub fn import_mesh( }) .transpose()?; - let va_transmission = reader + let va_alpha = reader .read_colors(0) .map(|iter| { let mut color_a = vec![]; @@ -144,7 +144,7 @@ pub fn import_mesh( let index = Some(store.set(&IndexArray(index))?); let mut tex_albedo = None; - let mut tex_transmission = None; + let mut tex_alpha = None; if let Some(tex) = p.material().pbr_metallic_roughness().base_color_texture() { let r = load_texture( "albedo", @@ -155,7 +155,7 @@ pub fn import_mesh( webp, )?; tex_albedo = Some(r.clone()); - tex_transmission = Some(r.clone()); + tex_alpha = Some(r.clone()); } let mut tex_normal = None; if let Some(tex) = p.material().normal_texture() { @@ -213,7 +213,7 @@ pub fn import_mesh( debug!("global albedo pruned"); None }; - let g_transmission = if base_color[3] != 1. { + let g_alpha = if base_color[3] != 1. { info!("global transmission is {}", base_color[3]); Some(base_color[3]) } else { @@ -235,7 +235,7 @@ pub fn import_mesh( let mesh = store.set(&MeshPart { g_albedo, - g_transmission, + g_alpha, g_metallic, g_roughness, g_emission, @@ -243,14 +243,17 @@ pub fn import_mesh( va_normal, va_texcoord, va_albedo, - va_transmission, + va_alpha, tex_albedo, tex_normal, tex_roughness, tex_metallic, - tex_transmission, + tex_alpha, tex_emission, index, + g_transmission: None, + tex_transmission: None, + va_transmission: None, va_emission: None, // not supported by gltf va_metallic: None, // not supported by gltf va_roughness: None, // not supported by gltf |