[][src]Struct duku::Material

pub struct Material {
    pub a: Vec4,
    pub b: Vec4,
    pub c: Vec4,
    pub d: Vec4,
    pub e: Vec4,
    pub f: Vec4,
    pub g: Vec4,
    pub h: Vec4,
    pub textures: Vec<Handle<Texture>>,
    // some fields omitted
}

Material parameters to use in a shader.

Examples

let material = duku.create_material_pbr().unwrap();
material.write().roughness(0.5);

// when drawing
t.material(&material);
t.cube([1.0, 1.0, 1.0]);

Fields

a: Vec4

parameter A

b: Vec4

parameter B

c: Vec4

parameter C

d: Vec4

parameter D

e: Vec4

parameter E

f: Vec4

parameter F

g: Vec4

parameter G

h: Vec4

parameter H

textures: Vec<Handle<Texture>>

texture storage for that are used in the material

Implementations

impl Material[src]

pub fn albedo_color(&mut self, color: impl Into<Rgbf>)[src]

Set albedo color for the PBR and other various shaders

pub fn albedo_texture(&mut self, texture: Handle<Texture>)[src]

Set albedo texture for the PBR and other various shaders

pub fn albedo_canvas(&mut self, f: &Handle<Canvas>)[src]

Set albedo canvas for the PBR and other various shaders

pub fn metalness(&mut self, value: f32)[src]

Set metalness factor for the PBR shader

pub fn roughness(&mut self, value: f32)[src]

Set roughness factor for the PBR shader

pub fn emissive(&mut self, color: impl Into<Rgbf>)[src]

Set emissive color for the PBR shader

pub fn metalness_roughness_texture(&mut self, texture: Handle<Texture>)[src]

Set metalness-roughness texture for the PBR shader

pub fn ambient_occlusion_texture(&mut self, texture: Handle<Texture>)[src]

Set ambient occlusion texture for the PBR shader

pub fn normal_texture(&mut self, texture: Handle<Texture>)[src]

Set normal texture for the PBR shader

pub fn emissive_texture(&mut self, texture: Handle<Texture>)[src]

Set emissive texture for the PBR shader

Trait Implementations

impl PartialEq<Material> for Material[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.