roughness
Provides the material's roughness, a 0-1 float value that defines the microscopic smoothness of a surface in the PBR workflow, determining how sharp or blurry its reflections are.
Core Advantages
Standardizes one of the most critical PBR parameters and seamlessly links it to the `material.roughness` property in JavaScript, greatly simplifying the creation and control of physical materials without manual Uniform management.
Common Uses
Defining surfaces with a uniform gloss or matte finish.
Achieving varied surface roughness by connecting a roughness map.
Serving as the output target for procedural effects (like noise or wear) to dynamically calculate roughness.
How to adjust
Modify the `material.roughness` property (0-1) in JavaScript. A low value (e.g., 0.05) creates sharp, mirror-like reflections. A mid-range value (e.g., 0.5) results in semi-gloss, blurry reflections. A high value (e.g., 0.95) produces a matte, diffuse-like appearance. A texture node can also be connected to `roughnessNode` for localized variations.
Code Examples
1// Multiply the material's base roughness with a texture value for the final result.
2// This allows adjusting the overall roughness while preserving texture detail.
3const finalRoughness = roughness.mul( texture( roughnessMap, uv() ).g );