Struct gltf::Material [−][src]
pub struct Material<'a> { /* fields omitted */ }
The material appearance of a primitive.
Methods
impl<'a> Material<'a>
[src]
impl<'a> Material<'a>
pub fn index(&self) -> Option<usize>
[src]
pub fn index(&self) -> Option<usize>
Returns the internal JSON index if this Material
was explicity defined.
This function returns None
if the Material
is the default material.
pub fn alpha_cutoff(&self) -> f32
[src]
pub fn alpha_cutoff(&self) -> f32
The alpha cutoff value of the material.
pub fn alpha_mode(&self) -> AlphaMode
[src]
pub fn alpha_mode(&self) -> AlphaMode
The alpha rendering mode of the material. The material's alpha rendering mode enumeration specifying the interpretation of the alpha value of the main factor and texture.
- In
Opaque
mode (default) the alpha value is ignored and the rendered output is fully opaque. - In
Mask
mode, the rendered output is either fully opaque or fully transparent depending on the alpha value and the specified alpha cutoff value. - In
Blend
mode, the alpha value is used to composite the source and destination areas and the rendered output is combined with the background using the normal painting operation (i.e. the Porter and Duff over operator).
pub fn double_sided(&self) -> bool
[src]
pub fn double_sided(&self) -> bool
Specifies whether the material is double-sided.
- When this value is false, back-face culling is enabled.
- When this value is true, back-face culling is disabled and double sided lighting is enabled. The back-face must have its normals reversed before the lighting equation is evaluated.
pub fn name(&self) -> Option<&str>
[src]
pub fn name(&self) -> Option<&str>
Optional user-defined name for this object.
pub fn pbr_metallic_roughness(&self) -> PbrMetallicRoughness<'a>
[src]
pub fn pbr_metallic_roughness(&self) -> PbrMetallicRoughness<'a>
Parameter values that define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology.
pub fn normal_texture(&self) -> Option<NormalTexture<'a>>
[src]
pub fn normal_texture(&self) -> Option<NormalTexture<'a>>
A tangent space normal map.
The texture contains RGB components in linear space. Each texel represents the XYZ components of a normal vector in tangent space.
- Red [0 to 255] maps to X [-1 to 1].
- Green [0 to 255] maps to Y [-1 to 1].
- Blue [128 to 255] maps to Z [1/255 to 1].
The normal vectors use OpenGL conventions where +X is right, +Y is up, and +Z points toward the viewer.
pub fn occlusion_texture(&self) -> Option<OcclusionTexture<'a>>
[src]
pub fn occlusion_texture(&self) -> Option<OcclusionTexture<'a>>
The occlusion map texture.
The occlusion values are sampled from the R channel. Higher values indicate areas that should receive full indirect lighting and lower values indicate no indirect lighting. These values are linear.
If other channels are present (GBA), they are ignored for occlusion calculations.
pub fn emissive_texture(&self) -> Option<Info<'a>>
[src]
pub fn emissive_texture(&self) -> Option<Info<'a>>
The emissive map texture.
The emissive map controls the color and intensity of the light being emitted by the material.
This texture contains RGB components in sRGB color space. If a fourth component (A) is present, it is ignored.
pub fn emissive_factor(&self) -> [f32; 3]
[src]
pub fn emissive_factor(&self) -> [f32; 3]
The emissive color of the material.
The default value is [0.0, 0.0, 0.0]
.
pub fn extras(&self) -> &Extras
[src]
pub fn extras(&self) -> &Extras
Optional application specific data.