Struct truck_rendimpl::Material[][src]

pub struct Material {
    pub albedo: Vector4,
    pub roughness: f64,
    pub reflectance: f64,
    pub ambient_ratio: f64,
    pub background_ratio: f64,
    pub alpha_blend: bool,
}
Expand description

Material information.

Each instance is rendered based on the microfacet theory.

Fields

albedo: Vector4

albedo, base color, [0, 1]-normalized rgba. Default is Vector4::new(1.0, 1.0, 1.0, 1.0).
Transparent by alpha is not yet supported in the current standard shader.

roughness: f64

roughness of the surface: [0, 1]. Default is 0.5.

reflectance: f64

ratio of specular: [0, 1]. Default is 0.25.

ambient_ratio: f64

ratio of ambient: [0, 1]. Default is 0.02.

background_ratio: f64

ratio of blending background color: [0, 1]. Default is 0.0.

alpha_blend: bool

alpha blend flag

Implementations

Creates a UNIFORM buffer of material.

The bind group provided by the instances holds this uniform buffer.

Shader Examples
layout(set = 1, binding = 1) uniform Material {
    vec4 albedo;
    float roughness;
    float reflectance;
    float ambient_ratio;
};

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

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

Performs the conversion.

Performs the conversion.

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

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.