materialMetalness
Provides the material's final metalness value, with built-in logic to multiply the `.metalness` property by the `.metalnessMap` texture's blue channel.
Core Advantages
Its core advantage is automatic combination: it fully encapsulates the common PBR workflow pattern of 'multiplying a base value by a map' and seamlessly integrates with standard material properties, greatly simplifying metalness control.
Common Uses
As a core input for PBR lighting models to distinguish between metals and non-metals.
As a mix factor or mask to isolate metallic and non-metallic parts for different effects.
Directly outputting its value as grayscale to debug the metalness distribution on a model.
As a condition for conditional logic, to add special effects to metallic surfaces.
How to adjust
Configure by modifying material properties in JavaScript. `material.metalness` (0-1) sets the base value. If `material.metalnessMap` is provided, the final metalness is `base_value * map_blue_channel_value`, enabling localized metalness variations.
Code Examples
1// Use materialMetalness as a mask to add emissive glow to non-metallic parts
2const finalColor = mix( emissiveColor, pbrColor, materialMetalness );