From 1aca139c985cb71be90da1de6d65adc3c7d0d073 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Thu, 9 Jan 2025 22:30:46 +0100 Subject: KHR_materials_unlit --- shared/src/helper.rs | 8 ++++++++ shared/src/resources.rs | 2 ++ 2 files changed, 10 insertions(+) (limited to 'shared') diff --git a/shared/src/helper.rs b/shared/src/helper.rs index d91313c..706e36b 100644 --- a/shared/src/helper.rs +++ b/shared/src/helper.rs @@ -126,3 +126,11 @@ impl ReadWrite for [T; N] { [(); N].try_map(|()| T::read(r)) } } +impl ReadWrite for () { + fn write(&self, _w: &mut dyn Write) -> Result<()> { + Ok(()) + } + fn read(_r: &mut dyn Read) -> Result { + Ok(()) + } +} diff --git a/shared/src/resources.rs b/shared/src/resources.rs index 25dd965..7a52e85 100644 --- a/shared/src/resources.rs +++ b/shared/src/resources.rs @@ -57,6 +57,7 @@ pub struct MeshPart { pub g_refractive_index: Option, pub g_attenuation: Option, pub g_dispersion: Option, + pub g_unlit: Option<()>, pub va_position: Option<[Resource; 3]>, pub va_normal: Option<[Resource; 3]>, pub va_texcoord: Option<[Resource; 2]>, @@ -183,6 +184,7 @@ impl ReadWrite for MeshPart { write_kv_opt(w, b"g_transmission", &self.g_transmission)?; write_kv_opt(w, b"g_alpha", &self.g_alpha)?; write_kv_opt(w, b"g_emission", &self.g_emission)?; + write_kv_opt(w, b"g_unlit", &self.g_unlit)?; write_kv_opt(w, b"va_position", &self.va_position)?; write_kv_opt(w, b"va_normal", &self.va_normal)?; write_kv_opt(w, b"va_texcoord", &self.va_texcoord)?; -- cgit v1.2.3-70-g09d2