pub struct SurfaceMaterial {Show 28 fields
pub base_color: [f32; 3],
pub base_color_texture: Option<TextureHandle>,
pub metalness: f32,
pub roughness: f32,
pub orm_texture: Option<TextureHandle>,
pub normal_texture: Option<TextureHandle>,
pub normal_scale: f32,
pub specular_ior: f32,
pub specular_tint: [f32; 3],
pub emission_color: [f32; 3],
pub emission_scale: f32,
pub emission_texture: Option<TextureHandle>,
pub coat_weight: f32,
pub coat_roughness: f32,
pub coat_ior: f32,
pub coat_normal_texture: Option<TextureHandle>,
pub sheen_weight: f32,
pub sheen_color: [f32; 3],
pub sheen_roughness: f32,
pub subsurface_weight: f32,
pub subsurface_color: [f32; 3],
pub subsurface_radius: [f32; 3],
pub opacity: f32,
pub opacity_texture: Option<TextureHandle>,
pub alpha_mode: AlphaMode,
pub alpha_cutoff: f32,
pub uv_scale: [f32; 2],
pub uv_offset: [f32; 2],
}Expand description
Metallic/roughness PBR material for scene geometry.
OA evaluates GGX specular and Lambertian diffuse using base color, metalness, perceptual roughness, and dielectric index of refraction. Direct light, flat ambient, and emission form the current renderer subset. Base/ORM/normal descriptors are connected, but their sampling variants are not enabled by the current shader build. Texture sampling, coat, sheen, subsurface, separate emission/opacity maps, and interchange adapters remain Planned.
Texture channel packing (ORM convention):
orm_textureR = ambient occlusion, G = roughness, B = metalness.normal_texturestores tangent-space XY as BC5 SNORM; Z is reconstructed assqrt(saturate(1 - dot(n.xy, n.xy))).
All color values are linear at this API boundary.
Fields§
§base_color: [f32; 3]Linear RGB base color. Default [0.8, 0.8, 0.8].
base_color_texture: Option<TextureHandle>Optional base-color texture. Format admission belongs to the renderer.
metalness: f32Metalness in [0, 1]. Default 0.0 (dielectric).
roughness: f32Perceptual roughness in [0, 1]. Default 0.5. Squared to α in the
shader for the GGX distribution.
orm_texture: Option<TextureHandle>Optional ORM texture (R=occlusion, G=roughness, B=metalness).
normal_texture: Option<TextureHandle>Optional tangent-space normal texture (BC5 SNORM XY).
normal_scale: f32Normal map strength multiplier. Default 1.0.
specular_ior: f32Index of refraction for dielectric F0 derivation. Default 1.5
(glass/plastic → F0 ≈ 0.04).
specular_tint: [f32; 3]Linear RGB tint applied to the specular F0. Default [1, 1, 1].
emission_color: [f32; 3]Linear RGB emissive color. Default [0, 0, 0].
emission_scale: f32HDR intensity multiplier for emission. Default 0.0.
emission_texture: Option<TextureHandle>Optional emissive texture (BC6H UFLOAT or RGBA16F).
coat_weight: f32Clear coat weight in [0, 1]. Default 0.0. Rendering is Planned.
coat_roughness: f32Clear coat perceptual roughness in [0, 1]. Default 0.03.
coat_ior: f32Clear coat IOR. Default 1.5.
coat_normal_texture: Option<TextureHandle>Optional separate tangent-space normal for the coat layer.
sheen_weight: f32Sheen weight in [0, 1]. Default 0.0. Rendering is Planned.
sheen_color: [f32; 3]Linear RGB sheen color. Default [1, 1, 1].
sheen_roughness: f32Sheen perceptual roughness in [0, 1]. Default 0.3.
subsurface_weight: f32Subsurface weight in [0, 1]. Default 0.0. Rendering is Planned.
subsurface_color: [f32; 3]Linear RGB subsurface color. Default [1, 1, 1].
subsurface_radius: [f32; 3]Per-channel scattering distance in world units (RGB). Default [1, 1, 1].
opacity: f32Global opacity multiplier in [0, 1]. Default 1.0.
opacity_texture: Option<TextureHandle>Optional single-channel (R) opacity texture.
alpha_mode: AlphaModeAlpha mode for this surface.
alpha_cutoff: f32Alpha cutoff threshold for AlphaMode::AlphaTest. Default 0.5.
uv_scale: [f32; 2]UV scale applied before sampling all maps. Default [1, 1].
uv_offset: [f32; 2]UV offset applied after scaling. Default [0, 0].