Trait Material

Source
pub trait Material: Debug {
    // Required method
    fn base_data(&self) -> &MaterialBaseData;

    // Provided method
    fn texture(&self, _aspect: MaterialAspect) -> ShortIndex { ... }
}
Expand description

A Material provides means to access the data for a material, be it simple of full PBR. A fragment shader may require some aspects of a material to be provided to it for rendering, and this API allows that information to be gathered from any kind of material

Required Methods§

Source

fn base_data(&self) -> &MaterialBaseData

Borrow the basic data of a material - color and base metallic/roughness, for example

Provided Methods§

Source

fn texture(&self, _aspect: MaterialAspect) -> ShortIndex

Get the index into the Textures array for a specific aspect

Implementors§