pub struct UnityPbrMetallicRoughness {Show 15 fields
pub name: String,
pub base_color_texture: Option<u32>,
pub metallic_roughness_texture: Option<u32>,
pub normal_texture: Option<u32>,
pub occlusion_texture: Option<u32>,
pub emissive_texture: Option<u32>,
pub base_color_factor: [f32; 4],
pub metallic_factor: f32,
pub roughness_factor: f32,
pub normal_scale: f32,
pub occlusion_strength: f32,
pub emissive_factor: [f32; 3],
pub alpha_cutoff: f32,
pub alpha_mode: u32,
pub double_sided: bool,
}Expand description
A glTF 2.0 PBR metallic-roughness material in Unity-ready form.
All texture slots hold an image index (into the parent document’s image map), already resolved through the glTF texture → image indirection.
Scalar values are stored in glTF convention and must be mapped to the target shader’s property names by the importer (BiRP and URP use different names).
Fields§
§name: StringThe material name. Falls back to the material index as a string if unnamed.
base_color_texture: Option<u32>Base color (albedo) texture image index.
metallic_roughness_texture: Option<u32>Metallic-roughness texture image index. glTF packing: G channel = roughness, B channel = metallic.
normal_texture: Option<u32>Tangent-space normal map image index.
occlusion_texture: Option<u32>Ambient occlusion texture image index. Stored in the R channel.
emissive_texture: Option<u32>Emissive texture image index.
base_color_factor: [f32; 4]RGBA base color factor. Default [1, 1, 1, 1].
metallic_factor: f32Metallic factor in [0, 1]. Default 1.
roughness_factor: f32Perceptual roughness factor in [0, 1]. Default 1.
This is glTF roughness, not Unity smoothness — importer must invert for shaders
that expect smoothness (smoothness = 1 - roughness_factor).
normal_scale: f32Normal map scale multiplier. Default 1.
occlusion_strength: f32Occlusion strength in [0, 1]. Default 1.
emissive_factor: [f32; 3]RGB emissive factor. Default [0, 0, 0].
alpha_cutoff: f32Alpha cutoff threshold for ALPHA_MODE_MASK. Default 0.5.
alpha_mode: u32Alpha rendering mode: 0 = ALPHA_MODE_OPAQUE, 1 = ALPHA_MODE_MASK,
2 = ALPHA_MODE_BLEND.
double_sided: boolfalse → CullMode.Back (2, single-sided); true → CullMode.Off (0, double-sided).