Struct truck_rendimpl::Material
source · [−]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: Vector4albedo, 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: f64roughness of the surface: [0, 1]. Default is 0.5.
reflectance: f64ratio of specular: [0, 1]. Default is 0.25.
ambient_ratio: f64ratio of ambient: [0, 1]. Default is 0.02.
background_ratio: f64ratio of blending background color: [0, 1]. Default is 0.0.
alpha_blend: boolalpha blend flag
Implementations
sourceimpl Material
impl Material
sourcepub fn buffer(&self, device: &Device) -> BufferHandler
pub fn buffer(&self, device: &Device) -> BufferHandler
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
impl Copy for Material
Auto Trait Implementations
impl RefUnwindSafe for Material
impl Send for Material
impl Sync for Material
impl Unpin for Material
impl UnwindSafe for Material
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<R, P> ReadPrimitive<R> for P where
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for P where
R: Read + ReadEndian<P>,
P: Default,
sourcefn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
sourcefn read_from_big_endian(read: &mut R) -> Result<Self, Error>
fn read_from_big_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
sourcefn read_from_native_endian(read: &mut R) -> Result<Self, Error>
fn read_from_native_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more