pub struct MeshRenderer {Show 15 fields
pub mesh: String,
pub color: [f32; 4],
pub roughness: f32,
pub emissive: f32,
pub metallic: f32,
pub reflectivity: f32,
pub cast_shadows: bool,
pub user: [f32; 8],
pub tiling: f32,
pub texture: String,
pub normal_map: String,
pub orm_map: String,
pub normal_strength: f32,
pub triplanar: f32,
pub shader: String,
}Expand description
Static/procedural mesh appearance consumed by the renderer. Texture/shader paths are asset-relative or built-in procedural keys.
Fields§
§mesh: Stringprimitive:<name> or a model path (.obj / .gltf / .glb).
color: [f32; 4]Base RGBA tint. Alpha below one enables the renderer’s transparency path.
roughness: f32Surface roughness; zero is smooth and one is fully rough.
emissive: f32Emission multiplier added independently of incoming light.
metallic: f320 = plastic-like, 1 = metal (reflections take the surface colour, no diffuse).
reflectivity: f32Mirror strength; fades in at grazing angles (Fresnel). 1 with a low colour alpha gives glass.
cast_shadows: boolWhether this mesh contributes to the directional shadow map.
user: [f32; 8]Free parameters passed to custom shaders as object.user0 / object.user1.
tiling: f32How many times the texture repeats across the mesh UVs.
texture: StringBase-colour texture asset or procedural key; empty uses a white fallback.
normal_map: StringTangent-space normal map (OpenGL convention: green up).
orm_map: StringPacked occlusion (R) / roughness (G) / metallic (B) texture, or an orm: key composed from
separate maps. Any normal or ORM map switches the material to PBR shading.
normal_strength: f32Tangent-space normal-map intensity; one uses the map unchanged.
triplanar: f32Triplanar mapping scale in metres per texture repeat (0 = use the mesh UVs). Good for rocks.
shader: StringCustom WGSL file; empty means the built-in lit shader.
Trait Implementations§
Source§impl Clone for MeshRenderer
impl Clone for MeshRenderer
Source§fn clone(&self) -> MeshRenderer
fn clone(&self) -> MeshRenderer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Component for MeshRenderer
impl Component for MeshRenderer
Source§impl Component for MeshRenderer
impl Component for MeshRenderer
Source§impl Default for MeshRenderer
impl Default for MeshRenderer
Source§impl<'de> Deserialize<'de> for MeshRendererwhere
MeshRenderer: Default,
impl<'de> Deserialize<'de> for MeshRendererwhere
MeshRenderer: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for MeshRenderer
impl RefUnwindSafe for MeshRenderer
impl Send for MeshRenderer
impl Sync for MeshRenderer
impl Unpin for MeshRenderer
impl UnsafeUnpin for MeshRenderer
impl UnwindSafe for MeshRenderer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeSync for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.