Struct bevy_pbr::StandardMaterial[][src]

pub struct StandardMaterial {
Show 13 fields pub base_color: Color, pub base_color_texture: Option<Handle<Image>>, pub emissive: Color, pub emissive_texture: Option<Handle<Image>>, pub perceptual_roughness: f32, pub metallic: f32, pub metallic_roughness_texture: Option<Handle<Image>>, pub reflectance: f32, pub normal_map_texture: Option<Handle<Image>>, pub occlusion_texture: Option<Handle<Image>>, pub double_sided: bool, pub unlit: bool, pub alpha_mode: AlphaMode,
}
Expand description

A material with “standard” properties used in PBR lighting Standard property values with pictures here https://google.github.io/filament/Material%20Properties.pdf.

May be created directly from a Color or an Image.

Fields

base_color: Color

Doubles as diffuse albedo for non-metallic, specular for metallic and a mix for everything in between. If used together with a base_color_texture, this is factored into the final base color as base_color * base_color_texture_value

base_color_texture: Option<Handle<Image>>emissive: Coloremissive_texture: Option<Handle<Image>>perceptual_roughness: f32

Linear perceptual roughness, clamped to [0.089, 1.0] in the shader Defaults to minimum of 0.089 If used together with a roughness/metallic texture, this is factored into the final base color as roughness * roughness_texture_value

metallic: f32

From [0.0, 1.0], dielectric to pure metallic If used together with a roughness/metallic texture, this is factored into the final base color as metallic * metallic_texture_value

metallic_roughness_texture: Option<Handle<Image>>reflectance: f32

Specular intensity for non-metals on a linear scale of [0.0, 1.0] defaults to 0.5 which is mapped to 4% reflectance in the shader

normal_map_texture: Option<Handle<Image>>occlusion_texture: Option<Handle<Image>>double_sided: boolunlit: boolalpha_mode: AlphaMode

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

Performs the conversion.

Performs the conversion.

The representation of the the asset in the “render world”.

The GPU-representation of the the asset.

Specifies all ECS data required by RenderAsset::prepare_asset. For convenience use the lifetimeless SystemParams. Read more

Converts the asset into a RenderAsset::ExtractedAsset.

Prepares the extracted asset for the GPU by transforming it into a RenderAsset::PreparedAsset. Therefore ECS data may be accessed via the param. Read more

The key used to specialize this material’s RenderPipelineDescriptor.

Extract the SpecializedMaterial::Key for the “prepared” version of this material. This key will be passed in to the SpecializedMaterial::specialize function when compiling the RenderPipeline for a given entity’s material. Read more

Specializes the given descriptor according to the given key.

Returns this material’s fragment shader. If None is returned, the default mesh fragment shader will be used. Defaults to None. Read more

Returns this material’s BindGroup. This should match the layout returned by SpecializedMaterial::bind_group_layout.

Returns this material’s BindGroupLayout. This should match the BindGroup returned by SpecializedMaterial::bind_group.

Returns this material’s AlphaMode. Defaults to AlphaMode::Opaque.

Returns this material’s vertex shader. If None is returned, the default mesh vertex shader will be used. Defaults to None. Read more

The dynamic uniform indices to set for the given material’s BindGroup. Defaults to an empty array / no dynamic uniform indices. 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

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Performs the conversion.

Creates Self using data from the given World

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more