getRoughness
Calculates the final, effective roughness used for lighting and reflection. It combines the base material roughness, the model's geometric details (via `getGeometryRoughness`), and a minimum roughness value to prevent specular aliasing.
Core Advantages
Encapsulates the 'best practices' for handling roughness in PBR. It automatically manages specular anti-aliasing and the fusion of geometric details, allowing developers to focus on the material itself while easily achieving higher quality, more stable rendering results.
Common Uses
Calculating final roughness in standard PBR materials
Selecting the appropriate Mipmap level for environment map reflections
Providing anti-aliasing for models with complex geometric details
Combining roughness maps with geometric details
How to adjust
This node has no direct parameters. You control it by setting its input `roughness` node, typically by setting the material's `roughness` property (a constant value) or `roughnessMap` property (a texture). Its output is also indirectly affected by the model's geometry and normal map.
Code Examples
1// Conceptual logic:
2// 1. Ensure base roughness is not below the anti-aliasing limit
3const baseRoughness = max( materialRoughness, 0.0525 );
4// 2. Add roughness from geometric details
5const finalRoughness = baseRoughness + getGeometryRoughness();