tiramisu/material
Material attributes shared by Tiramisu mesh and primitive nodes.
Material attributes are implemented as a cross-cutting attribute extension,
so the same API works for both tiramisu.primitive and tiramisu.mesh.
tiramisu.primitive(
"cube",
[
primitive.box(vec3.Vec3(1.0, 1.0, 1.0)),
material.color(0xff8844),
material.metalness(0.7),
material.roughness(0.25),
],
[],
)
Types
Values
pub fn alpha_test(value: Float) -> attribute.Attribute(msg)
Set alpha test threshold.
pub fn ambient_occlusion_map(
url: String,
) -> attribute.Attribute(msg)
Set the ambient occlusion map texture.
pub fn displacement_bias(bias: Float) -> attribute.Attribute(msg)
Set displacement bias.
pub fn displacement_map(url: String) -> attribute.Attribute(msg)
Set the displacement map texture.
pub fn displacement_scale(
scale: Float,
) -> attribute.Attribute(msg)
Set displacement scale.
pub fn emissive_intensity(
intensity: Float,
) -> attribute.Attribute(msg)
Set emissive intensity.
pub fn ext() -> extension.Extension
Build the internal extension used to apply material attributes.
Most applications should not call this directly; use
tiramisu.builtin_extensions() instead.
pub fn metalness_map(url: String) -> attribute.Attribute(msg)
Set the metalness map texture.
pub fn normal_map(url: String) -> attribute.Attribute(msg)
Set the normal map texture.
pub fn roughness_map(url: String) -> attribute.Attribute(msg)
Set the roughness map texture.
pub fn side(s: Side) -> attribute.Attribute(msg)
Select which side of the geometry should render.
pub fn standard() -> attribute.Attribute(msg)
Use a standard physically based material.extension
pub fn transparent(bool: Bool) -> attribute.Attribute(msg)
Enable or disable material transparency.
pub fn wireframe(bool: Bool) -> attribute.Attribute(msg)
Enable or disable wireframe rendering.