Trait mod3d_base::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

Invoked when an 3D model object is made renderable 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§