---
title: clearcoatRoughness
framework: realitykit
role: symbol
role_heading: Instance Property
path: realitykit/physicallybasedmaterial/clearcoatroughness-swift.property
---

# clearcoatRoughness

The degree to which an entity’s clear, shiny coating scatters light to create soft highlights.

## Declaration

```swift
var clearcoatRoughness: PhysicallyBasedMaterial.ClearcoatRoughness { get set }
```

## Discussion

Discussion When you enable clearcoat rendering for a material, RealityKit renders the clearcoat as a separate layer just above the surface of the entity. You can specify a clearcoat roughness value for the clearcoat to indicate how much the clearcoat scatters light that bounces off of it, which softens and spreads out the highlights. You can specify a single value that applies to the entire material, or you can supply a UV-mapped image texture containing different roughness values for different parts of the entity. The following example sets the clearcoatRoughness using a single value: material.clearcoatRoughness = .init(floatLiteral: 0.5) This example shows how to set the clearcoatRoughness using a UV-mapped image: if let clearcoatRoughnessResource = try? TextureResource.load(named: "entity_cc_roughness") {     let ccRoughnessMap = MaterialParameters.Texture(clearcoatRoughnessResource)     material.clearcoat = .init(texture: ccRoughnessMap) }

## See Also

### Setting the core properties

- [baseColor](realitykit/physicallybasedmaterial/basecolor-swift.property.md)
- [roughness](realitykit/physicallybasedmaterial/roughness-swift.property.md)
- [metallic](realitykit/physicallybasedmaterial/metallic-swift.property.md)
- [normal](realitykit/physicallybasedmaterial/normal-swift.property.md)
- [ambientOcclusion](realitykit/physicallybasedmaterial/ambientocclusion-swift.property.md)
- [specular](realitykit/physicallybasedmaterial/specular-swift.property.md)
- [clearcoat](realitykit/physicallybasedmaterial/clearcoat-swift.property.md)
- [clearcoatNormal](realitykit/physicallybasedmaterial/clearcoatnormal-swift.property.md)
