enum
Material
pub enum Material {
Standard { color2: Option<Color>, shininess: f32, rim: f32, rim_color: Color, emissive: f32, wobble: f32, opacity: f32, map: Option<TextureRef> },
Physical(PhysicalMaterial),
Custom { vertex: Option<String>, fragment: String, uniforms: BTreeMap<String, Uniform>, attributes: BTreeMap<String, Attribute>, opacity: f32, transparent: bool, side: Side, depth_write: bool, blending: Blending },
}What an object's surface looks like.
Variants
Standard
Standard { color2: Option<Color>, shininess: f32, rim: f32, rim_color: Color, emissive: f32, wobble: f32, opacity: f32, map: Option<TextureRef> }The built-in lit material.
Custom
Custom { vertex: Option<String>, fragment: String, uniforms: BTreeMap<String, Uniform>, attributes: BTreeMap<String, Attribute>, opacity: f32, transparent: bool, side: Side, depth_write: bool, blending: Blending }Your own GLSL. A source without #version gets Weft's prelude (the standard attributes, uniforms and helpers; see crate::shaders::custom_mesh_program).
Methods
custom
pub fn custom(fragment: &str) -> MaterialA custom material with this fragment shader and the defaults.