materialRoughness
Provides the material's final roughness value, with built-in logic to multiply the `.roughness` property by the `.roughnessMap` texture's green 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 roughness control.
Common Uses
As a core input for PBR lighting models to control the blurriness of highlights and reflections.
As a mix factor to blend between different material qualities (e.g., dry/wet).
As a data bridge to trigger different sound effects based on surface roughness.
Directly outputting its value as grayscale to debug the final roughness distribution on a model.
How to adjust
Configure by modifying material properties in JavaScript. `material.roughness` (0-1) sets the base value. If `material.roughnessMap` is provided, the final roughness is `base_value * map_green_channel_value`, enabling localized roughness variations.
Code Examples
1// In a physical lighting model, materialRoughness is a core input for lighting calculations
2const lighting = PBR( {
3 roughness: materialRoughness, // <-- Used here
4 // ... other PBR inputs
5} );