diff options
-rw-r--r-- | doc/resources.md | 3 | ||||
-rw-r--r-- | shared/src/resources.rs | 3 | ||||
-rw-r--r-- | world/src/mesh.rs | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/doc/resources.md b/doc/resources.md index c015ab7..4fbc54f 100644 --- a/doc/resources.md +++ b/doc/resources.md @@ -78,6 +78,7 @@ white except normals are zero. | `tex_thickness` | `Res<Texture>` | Use green channel | | `tex_occlusion` | `Res<Texture>` | Use red channel | | `hint_mirror` | | | +| `hint_static` | | | - **Attenuation**: Attenuation coefficient for each color channel due to scattering within the material volume expressed as e-folding distance (m^-1). @@ -96,6 +97,8 @@ white except normals are zero. - **Mirror Hint**: Suggest a client to render reflections of this surface properly e.g. show use a texture that shows output of another render pass from the mirrors perspective. It can be assumed that the mesh is on a single plane. +- **Static Hint**: Object will not move often. This allows implementations to + choose instanced rending when MeshPart are added more than once. ## Armature diff --git a/shared/src/resources.rs b/shared/src/resources.rs index 5901eb1..6c71adc 100644 --- a/shared/src/resources.rs +++ b/shared/src/resources.rs @@ -85,6 +85,7 @@ pub struct MeshPart { pub tex_thickness: Option<Resource<Image<'static>>>, pub tex_occlusion: Option<Resource<Image<'static>>>, pub hint_mirror: Option<()>, + pub hint_static: Option<()>, } #[derive(Debug, Default, Clone)] @@ -292,6 +293,7 @@ impl ReadWrite for MeshPart { write_kv_opt(w, b"tex_emission", &self.tex_emission)?; write_kv_opt(w, b"tex_occlusion", &self.tex_occlusion)?; write_kv_opt(w, b"hint_mirror", &self.hint_mirror)?; + write_kv_opt(w, b"hint_static", &self.hint_static)?; Ok(()) } fn read(r: &mut dyn Read) -> Result<Self> { @@ -328,6 +330,7 @@ impl ReadWrite for MeshPart { b"tex_emission" => Ok(s.tex_emission = Some(read_slice(v)?)), b"tex_occlusion" => Ok(s.tex_occlusion = Some(read_slice(v)?)), b"hint_mirror" => Ok(s.hint_mirror = Some(read_slice(v)?)), + b"hint_static" => Ok(s.hint_static = Some(read_slice(v)?)), x => Ok(warn!( "unknown mesh part key: {:?}", String::from_utf8_lossy(x) diff --git a/world/src/mesh.rs b/world/src/mesh.rs index 3d71939..b8dc0c3 100644 --- a/world/src/mesh.rs +++ b/world/src/mesh.rs @@ -383,6 +383,7 @@ pub fn import_mesh( tex_occlusion, // not supported by gltf hint_mirror: None, // TODO + hint_static: None, // TODO Set when instancing va_transmission: None, va_emission: None, va_metallic: None, |