#[repr(C)]pub struct Material { /* private fields */ }
Expand description
A Material provides a container into which multiple “render targets” can add data that defines a “shading material” for a renderer. Typically this consists of one or more UsdRelationship properties that target other prims of type Shader - though a target/client is free to add any data that is suitable. We strongly advise that all targets adopt the convention that all properties be prefixed with a namespace that identifies the target, e.g. “rel ri:surface = </Shaders/mySurf>”.
Implementations§
source§impl Material
impl Material
pub fn new(prim: &Prim) -> Material
sourcepub fn get_surface_attribute(&self) -> Attribute
pub fn get_surface_attribute(&self) -> Attribute
Represents the universal “surface” output terminal of a material.
Declaration | token outputs:surface |
C++ Type | TfToken |
sourcepub fn compute_surface_source(&self) -> Shader
pub fn compute_surface_source(&self) -> Shader
Computes the resolved “surface” output source for the given contextVector. Using the earliest renderContext in the contextVector that produces a valid Shader object.
If a “surface” output corresponding to each of the renderContexts
does not exist or is not connected to a valid source, then this
checks the universal
surface output.
Returns an empty Shader object if there is no valid surface
output source for any of the renderContexts in the contextVector.
The python version of this method returns a tuple containing three
elements (the source surface shader, sourceName, sourceType).