pub struct Material {Show 19 fields
pub asset_id: AssetId,
pub albedo: Option<TextureHandle>,
pub normal_map: Option<TextureHandle>,
pub emissive_map: Option<TextureHandle>,
pub orm_map: Option<TextureHandle>,
pub roughness: f32,
pub metallic: f32,
pub tint: [f32; 3],
pub emissive_factor: [f32; 3],
pub macro_variation: f32,
pub terrain_blend: f32,
pub albedo_secondary: Option<TextureHandle>,
pub normal_secondary: Option<TextureHandle>,
pub secondary_blend_sharpness: f32,
pub alpha_cutoff: f32,
pub opacity: f32,
pub transparent: bool,
pub see_through: bool,
pub shader: Option<ShaderHandle>,
}Expand description
Fields§
§asset_id: AssetIdAsset identity; injected via inject_name. Not part of args.
albedo: Option<TextureHandle>The Texture asset used as the base colour (albedo) map.
normal_map: Option<TextureHandle>The Texture asset used as a tangent-space normal map.
emissive_map: Option<TextureHandle>The Texture asset used as an emissive map. Multiplied by
emissive_factor to drive the glow; when omitted, only the scalar
emissive_factor is used. Pair a textured emissive with an
emissive_factor above 1 to make the bright parts bloom.
orm_map: Option<TextureHandle>The Texture asset used as a packed surface map: green =
roughness, blue = metalness. When present it overrides the scalar
roughness and metallic per-texel; when omitted those scalars are
used. The red channel is reserved and not read as ambient occlusion:
packed maps in the wild (glTF metallic-roughness, FBX specular maps)
leave red empty, so treating it as occlusion would darken indirect
light to black. Ambient occlusion comes from the screen-space pass.
roughness: f32Perceptual roughness in [0, 1]. 0 = mirror, 1 = fully diffuse. Controls the width of the specular highlight.
metallic: f32Metallic factor in [0, 1]. 0 = dielectric (plastic/stone), 1 = metal. Metallic surfaces tint their reflections with the albedo colour and show almost no diffuse; dielectrics keep a neutral, dim reflection.
tint: [f32; 3]Linear-space RGB multiplier applied to the albedo sample. Useful for tinting a shared texture without a separate asset (e.g. coloured brick).
emissive_factor: [f32; 3]Additive emission colour in linear space. Non-zero values make the surface appear to glow independently of the scene lighting.
macro_variation: f32Macro-variation strength in [0, 1]. When non-zero, a large-scale, world-space noise modulates the albedo so a tiled texture on a big surface (terrain, floors) stops reading as an obvious repeating grid. 0 disables it.
terrain_blend: f32Terrain-shading blend in [0, 1]. When non-zero, the albedo and normal are sampled by a world-space projection blended from the three world axes (instead of a single UV lookup), and the surface shifts toward a darker rocky tint on steep slopes. This removes the obvious UV-stretch banding that heightfield ground shows when stretched across a big mesh, and gives “grass on top, rock on the cliffs” variation for free. 0 disables it.
albedo_secondary: Option<TextureHandle>Optional second albedo Texture for the slope-based terrain
blend. When present, the steep / cliff regions sample this texture and
blend with the primary albedo over the flat regions, using the
surface’s up-facing component (softened by a per-pixel noise so the
transition doesn’t read as a clean line). Without it, a rocky-tint
multiplier is applied to the primary texture instead. Only used when
terrain_blend > 0.
normal_secondary: Option<TextureHandle>Tangent-space normal map paired with albedo_secondary. Only used when
both that field and terrain_blend are set.
secondary_blend_sharpness: f32Sharpness of the slope-based blend in [0, 1]. 0 = wide soft
gradient between the two layers; 1 = nearly hard cliff edge.
Default 0.5 matches the “smooth but visible” transition AAA
terrain materials typically tune to.
alpha_cutoff: f32Alpha-cutout threshold in [0, 1]. When non-zero, a texel whose albedo
alpha falls below it is discarded outright, punching a hole in the
surface: this is how foliage, chain-link, and decal cards are drawn as
one opaque quad. 0 (the default) disables the test and keeps every texel.
Cutout is not glass: the surface still renders in the opaque pass, so
leave transparent and see_through off.
opacity: f32Surface opacity in [0, 1]. 1 = fully opaque (the default). Only
meaningful when transparent is set: it drives how much of the scene
behind the surface shows through the glass.
transparent: boolWhen true, the surface is a translucent dielectric (glass): it renders in the engine’s transparent pass instead of the opaque pass, refracting and reflecting the scene rather than writing solid colour + depth. The importer sets this for materials it detects as glass; authored materials can opt in directly. Defaults to false (opaque).
see_through: boolWhen true, the glass is rendered as genuinely see-through: the scene
behind it shows through with a sharp per-pixel reflection (requires a
ray-tracing-capable GPU). When false (the default), a transparent
surface still renders as low-roughness reflective glass that hides
whatever is behind it. See-through only looks right when the space behind
the glass is actually modelled, so it is opt-in per material. Setting it
implies transparent.
shader: Option<ShaderHandle>The Shader asset that shades surfaces using this material. When omitted, the world’s default shader is used. Referencing a shader from a material ties that shader’s lifetime to the material’s: a shader referenced only by scene-exclusive materials loads and unloads with the scene.