[][src]Struct rin::gl::pbr_material::PbrMaterial

pub struct PbrMaterial<Program = Program, Texture = Texture> { /* fields omitted */ }

A physically based rendering material

Based on several PBR references and papers including the GLTF reference implementation + Filament

With support for:

Standard material

Anistropic material

supports all the features from the standard material and:

Clearcoat

supports all the features from the standard material and:

Subsurface

supports all the features from the standard material and:

Cloth

The filament material guide is a really good reference to understand most of the parameters of this material

Methods

impl PbrMaterial
[src]

New default PBR material with no maps and gray 0.8 color, 0.2 roughness and 0. metallic

New default PBR material with a base color texture and gray 0.8 color, 0.2 roughness and 0. metallic

impl<P: Borrow<Program>, T: Borrow<Texture>> PbrMaterial<P, T>
[src]

Type of the material (standard, anisotropic, clearcoat or cloth)

Base color texture

Normal map

Base color

Emissive color

Plain color that the material emits, not affected by light or shadows

Subsurface color, only for subsurface and cloth materials

Non physically based color of the subsurface scattering in cloths and subsurface materials

Modify specular reflectance in cloth materials

Level of metallic of this material

Pure metallic materials don't have diffuse reflection, only specular non metallic have white specular and a diffuse reflection of the base color

This values should usually be 0 or 1, intermediate values are usually used when using a metallic map to transition from metallic to non metallic areas

Controls the roughness of the material or how blurry their specular reflection is.

A non metallic material with roughness 1 will appear almost completely diffuse while rouchness 0 will produce a sharp specular reflection

Defines the amount of anistropic in anisotropic materials

Defines the direction of the anisotropy

Clearcoat materials (like car paint) have a second translucent layer on top of the main material

This value controls if a material has clearcoat or not and should usually be set as 0 or 1

The roughness of the clearcoat translucent layer

When a material is set as double sided it's back face will be seen as well even when culling is enabled

Controls the specular reflectance for non metallics which usually is 0.04

This value should be between 0..1

Actually sets the roughness based on legacy shininess model

Useful when porting from phong materials

Only for subsurface materials

Defines how thick is the material

Tint of the diffuse, base color to the specular reflectance

To use when we are going to set a clip plane to cut the render at a certain plane

Useful for mirrors, water...

A reference to this material but double sided

Occlusion map

Scales normals

usually used to make the normal map effect more or less pronounced

Alpha type used for this material

See AlphaType

If the model has precalculated tangents otherwise calculated in shader which could be slower

If the alpha will be set on a separate uniform

Useful for materials that change translucency to not reset the whole ubo

Reference to this material with lights and potentially shadows

The resulting material will apply the lights and shadows to any model drawn with it

A pbr material will look completely black unless drawn with lights so calling this method with at least one light is always necesary

Pass a ubo with the properties of the lights to set the lighting faster

The ubo can be created from the light data but the material also needs the original lights the ubo was created from in order to completely setup the shader

Reference to this material using a ubo to setup properties

Reference to this material but using the camera uniforms from an ubo

Trait Implementations

impl<P: Borrow<Program>, T: Borrow<Texture>> Material for PbrMaterial<P, T>
[src]

impl<Program: Debug, Texture: Debug> Debug for PbrMaterial<Program, Texture>
[src]

Auto Trait Implementations

impl<Program, Texture> Send for PbrMaterial<Program, Texture> where
    Program: Send,
    Texture: Send

impl<Program = Program, Texture = Texture> !Sync for PbrMaterial<Program, Texture>

Blanket Implementations

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

impl<T> From for T
[src]

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

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

The type returned in the event of a conversion error.

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

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

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

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

The type returned in the event of a conversion error.

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

impl<T> Any for T where
    T: Any
[src]

impl<T> SetParameter for T
[src]

Sets value as a parameter of self.

impl<V> IntoVec for V
[src]

impl<V> IntoPnt for V
[src]

impl<T> Same for T
[src]

Should always be Self

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>, 
[src]