materialClearcoatRoughness
Provides the roughness for the clear coat layer, used to independently control the sharpness or blurriness of its highlight, with built-in logic for blending with a `clearcoatRoughnessMap`.
Core Advantages
Completely decouples the roughness of the clear coat and base layers and automates the common logic of 'multiplying a global roughness factor by a map value,' greatly simplifying the creation of layered materials with localized details like fingerprints or smudges.
Common Uses
Simulating fingerprints or smudges on a glossy surface using a texture map.
Showing a loss of gloss on a clear coat due to wear and aging.
Creating a uniform matte or frosted finish on a clear coat.
Simulating varying degrees of dryness on a wet surface.
How to adjust
Adjust by modifying material properties in JavaScript. `material.clearcoatRoughness` (0-1) acts as a global factor. If `material.clearcoatRoughnessMap` is provided, the final roughness is `factor * map_value`. This allows you to use a map to create local variations between 0 and the factor's value.
Code Examples
1// In a physical lighting model, materialClearcoatRoughness provides the final clear coat roughness.
2// Its value is determined by material.clearcoatRoughness and material.clearcoatRoughnessMap.
3// (Typically used internally by materialPhysical, no direct user connection needed)
4
5// Example: Procedurally creating smudges
6const smudgeMap = noise( uv().mul( 5 ) );
7material.clearcoatRoughness = 0.8;
8material.clearcoatRoughnessNode = smudgeMap; // Use noise as the map