pub trait Material: Debug {
Show 14 methods
// Required methods
fn get_ambient(&self) -> Option<&MaterialComponent>;
fn get_diffuse(&self) -> Option<&MaterialComponent>;
fn get_specular(&self) -> Option<&MaterialComponent>;
fn get_specular_power(&self) -> Option<&MaterialComponent>;
fn get_albedo(&self) -> Option<&MaterialComponent>;
fn get_ao(&self) -> Option<&MaterialComponent>;
fn get_displacement(&self) -> Option<&MaterialComponent>;
fn get_roughness(&self) -> Option<&MaterialComponent>;
fn get_metalness(&self) -> Option<&MaterialComponent>;
fn get_normal(&self) -> Option<&MaterialComponent>;
fn get_emissive(&self) -> Option<&MaterialComponent>;
fn get_names(&self) -> BTreeSet<String>;
fn get_by_name(&self, name: &str) -> Option<&MaterialComponent>;
fn set_by_name(&mut self, name: &str, texture: MaterialComponent);
}
Expand description
The Material
trait helps the MaterialLegacy
struct or the MaterialPbr
struct to be able to turn into an object
Required Methods§
Sourcefn get_ambient(&self) -> Option<&MaterialComponent>
fn get_ambient(&self) -> Option<&MaterialComponent>
Get the ambient color
Sourcefn get_diffuse(&self) -> Option<&MaterialComponent>
fn get_diffuse(&self) -> Option<&MaterialComponent>
Get the diffuse color
Sourcefn get_specular(&self) -> Option<&MaterialComponent>
fn get_specular(&self) -> Option<&MaterialComponent>
Get the specular color
Sourcefn get_specular_power(&self) -> Option<&MaterialComponent>
fn get_specular_power(&self) -> Option<&MaterialComponent>
Get the specular power
Sourcefn get_albedo(&self) -> Option<&MaterialComponent>
fn get_albedo(&self) -> Option<&MaterialComponent>
Get the base color (PBR)
Sourcefn get_ao(&self) -> Option<&MaterialComponent>
fn get_ao(&self) -> Option<&MaterialComponent>
Get the ambient occlusion (PBR)
Sourcefn get_displacement(&self) -> Option<&MaterialComponent>
fn get_displacement(&self) -> Option<&MaterialComponent>
Get the displacement map (A.k.a. height map) (PBR)
Sourcefn get_roughness(&self) -> Option<&MaterialComponent>
fn get_roughness(&self) -> Option<&MaterialComponent>
Get the roughness map (PBR)
Sourcefn get_metalness(&self) -> Option<&MaterialComponent>
fn get_metalness(&self) -> Option<&MaterialComponent>
Get the metalness map (PBR)
Sourcefn get_normal(&self) -> Option<&MaterialComponent>
fn get_normal(&self) -> Option<&MaterialComponent>
Get the normal map
Sourcefn get_emissive(&self) -> Option<&MaterialComponent>
fn get_emissive(&self) -> Option<&MaterialComponent>
Get the emissive color
Sourcefn get_by_name(&self, name: &str) -> Option<&MaterialComponent>
fn get_by_name(&self, name: &str) -> Option<&MaterialComponent>
Get a component by the name of the component
Sourcefn set_by_name(&mut self, name: &str, texture: MaterialComponent)
fn set_by_name(&mut self, name: &str, texture: MaterialComponent)
Set a componnet by the name of the component