struct
ModelMaterial
pub struct ModelMaterial {
pub name: String,
pub color: Color,
pub map: Option<usize>,
pub metallic: f32,
pub roughness: f32,
pub emissive: f32,
pub opacity: f32,
pub blend: bool,
pub double_sided: bool,
pub physical: bool,
pub emissive_color: Color,
pub metallic_roughness_map: Option<usize>,
pub normal_map: Option<usize>,
pub normal_scale: f32,
pub occlusion_map: Option<usize>,
pub occlusion_strength: f32,
pub emissive_map: Option<usize>,
}A model's material, mapped onto Weft's physical material (glTF's metallic-roughness PBR) or, for formats without PBR, the standard one.
Fields
metallic_roughness_map
pub metallic_roughness_map: Option<usize>Roughness (green) and metalness (blue), as glTF packs them.
occlusion_map
pub occlusion_map: Option<usize>Ambient occlusion (red channel): an index into [Model::textures].
Methods
to_material
pub fn to_material(&self, texture: impl Fn(usize) -> Option<TextureRef>) -> MaterialAs one of Weft's materials, with texture resolving texture indices to images.