Struct three::material::Pbr

source ·
pub struct Pbr {
    pub base_color_factor: Color,
    pub base_color_alpha: f32,
    pub metallic_factor: f32,
    pub roughness_factor: f32,
    pub occlusion_strength: f32,
    pub emissive_factor: Color,
    pub normal_scale: f32,
    pub base_color_map: Option<Texture<[f32; 4]>>,
    pub normal_map: Option<Texture<[f32; 4]>>,
    pub emissive_map: Option<Texture<[f32; 4]>>,
    pub metallic_roughness_map: Option<Texture<[f32; 4]>>,
    pub occlusion_map: Option<Texture<[f32; 4]>>,
}
Expand description

Parameters for a PBR (physically based rendering) lighting model.

Renders triangle meshes with a PBR (physically-based rendering) illumination model

Fields

base_color_factor: Color

Solid base color applied in the absense of base_color_map.

Default: WHITE.

base_color_alpha: f32

Base color alpha factor applied in the absense of base_color_map.

Default: 1.0 (opaque).

metallic_factor: f32

Metallic factor in the range [0.0, 1.0].

Default: 1.0.

roughness_factor: f32

Roughness factor in the range [0.0, 1.0].

  • A value of 1.0 means the material is completely rough.
  • A value of 0.0 means the material is completely smooth.

Default: 1.0.

occlusion_strength: f32

Scalar multiplier in the range [0.0, 1.0] that controls the amount of occlusion applied in the presense of occlusion_map.

Default: 1.0.

emissive_factor: Color

Solid emissive color applied in the absense of emissive_map.

Default: BLACK.

normal_scale: f32

Scalar multiplier applied to each normal vector of the normal_map.

This value is ignored in the absense of normal_map.

Default: 1.0.

base_color_map: Option<Texture<[f32; 4]>>

Base color texture.

Default: None.

normal_map: Option<Texture<[f32; 4]>>

Normal texture.

Default: None.

emissive_map: Option<Texture<[f32; 4]>>

Emissive texture.

Default: None.

metallic_roughness_map: Option<Texture<[f32; 4]>>

Metallic-roughness texture.

Default: None.

occlusion_map: Option<Texture<[f32; 4]>>

Occlusion texture.

Default: None.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Converts to this type from the input type.
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Sets value as a parameter of self.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.