pub struct MaterialRef {
pub base_color_texture: Option<String>,
pub orm_texture: Option<String>,
pub normal_texture: Option<String>,
pub base_color: [f32; 4],
pub metallic: f32,
pub roughness: f32,
pub emissive: f32,
pub texture: Option<TextureRecipe>,
}Expand description
Standard PBR material (renderer-agnostic). Texture fields are Asset ids.
Fields§
§base_color_texture: Option<String>§orm_texture: Option<String>Packed occlusion-roughness-metallic (glTF convention).
normal_texture: Option<String>§base_color: [f32; 4]§metallic: f32§roughness: f32§emissive: f32Glow strength: > 0 renders unlit, glowing base_color (blooms in
browsers with HDR). 0 (default) = lit normally.
texture: Option<TextureRecipe>A procedural material recipe (see texture) — the browser bakes the
full PBR set (albedo / normal / occlusion-roughness-metallic) locally.
Additive; when set, the baked maps replace the *_texture asset slots
and the scalar factors still multiply (tinting works as usual).
Trait Implementations§
Source§impl Clone for MaterialRef
impl Clone for MaterialRef
Source§impl Debug for MaterialRef
impl Debug for MaterialRef
Source§impl Default for MaterialRef
impl Default for MaterialRef
Source§impl<'de> Deserialize<'de> for MaterialRef
impl<'de> Deserialize<'de> for MaterialRef
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MaterialRef
impl RefUnwindSafe for MaterialRef
impl Send for MaterialRef
impl Sync for MaterialRef
impl Unpin for MaterialRef
impl UnsafeUnpin for MaterialRef
impl UnwindSafe for MaterialRef
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
Mutably borrows from an owned value. Read more