Realm

oa::SurfaceMaterial

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_texture R = ambient occlusion, G = roughness, B = metalness. normal_texture stores tangent-space XY as BC5 SNORM; Z is reconstructed as sqrt(saturate(1 - dot(n.xy, n.xy))). All color values are linear at this API boundary.

StRust public API

Declaration

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], }
Public Rust declaration.

Public Methods

pub fn validate(&self) -> Result<()>
fn clone(&self) -> SurfaceMaterial
fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn eq(&self, other: &SurfaceMaterial) -> bool

Associated Functions

fn default() -> Self

Public Data Members

base_color[f32; 3]field
base_color_textureOption<TextureHandle>field
metalnessf32field
roughnessf32field
orm_textureOption<TextureHandle>field
normal_textureOption<TextureHandle>field
normal_scalef32field
specular_iorf32field
specular_tint[f32; 3]field
emission_color[f32; 3]field
emission_scalef32field
emission_textureOption<TextureHandle>field
coat_weightf32field
coat_roughnessf32field
coat_iorf32field
coat_normal_textureOption<TextureHandle>field
sheen_weightf32field
sheen_color[f32; 3]field
sheen_roughnessf32field
subsurface_weightf32field
subsurface_color[f32; 3]field
subsurface_radius[f32; 3]field
opacityf32field
opacity_textureOption<TextureHandle>field
alpha_modeAlphaModefield
alpha_cutofff32field
uv_scale[f32; 2]field
uv_offset[f32; 2]field

Public Method Documentation

pub fn validate(&self) -> Result<()>
No public source comment is attached to this declaration.
fn clone( &self ) -> SurfaceMaterial
No public source comment is attached to this declaration.
fn fmt( &self, f: &mut Formatter<'_> ) -> Result
No public source comment is attached to this declaration.
fn eq( &self, other: &SurfaceMaterial ) -> bool
No public source comment is attached to this declaration.
fn default() -> Self
No public source comment is attached to this declaration.