Struct three_d::renderer::material::ORMMaterial
source · pub struct ORMMaterial {
pub metallic: f32,
pub roughness: f32,
pub metallic_roughness_texture: Option<Texture2DRef>,
pub occlusion_strength: f32,
pub occlusion_texture: Option<Texture2DRef>,
pub render_states: RenderStates,
}
Expand description
Render the object with colors that reflect its ORM (occlusion, roughness and metallic) values which primarily is used for debug purposes. Occlusion is red, roughness green and metallic blue.
Fields§
§metallic: f32
A value in the range [0..1]
specifying how metallic the material is.
roughness: f32
A value in the range [0..1]
specifying how rough the material surface is.
metallic_roughness_texture: Option<Texture2DRef>
Texture containing the metallic and roughness parameters which are multiplied with the Self::metallic and Self::roughness values in the shader. The metallic values are sampled from the blue channel and the roughness from the green channel.
occlusion_strength: f32
A scalar multiplier controlling the amount of occlusion applied from the Self::occlusion_texture. A value of 0.0 means no occlusion. A value of 1.0 means full occlusion.
occlusion_texture: Option<Texture2DRef>
An occlusion map. Higher values indicate areas that should receive full indirect lighting and lower values indicate no indirect lighting. The occlusion values are sampled from the red channel.
render_states: RenderStates
Render states.
Implementations§
source§impl ORMMaterial
impl ORMMaterial
sourcepub fn new(context: &Context, cpu_material: &CpuMaterial) -> Self
pub fn new(context: &Context, cpu_material: &CpuMaterial) -> Self
Constructs a new ORM material from a CpuMaterial where only relevant information is used.
sourcepub fn from_physical_material(physical_material: &PhysicalMaterial) -> Self
pub fn from_physical_material(physical_material: &PhysicalMaterial) -> Self
Creates a ORM material from a PhysicalMaterial.
Trait Implementations§
source§impl Clone for ORMMaterial
impl Clone for ORMMaterial
source§fn clone(&self) -> ORMMaterial
fn clone(&self) -> ORMMaterial
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more