Contents

clearcoatNormal

Waviness and imperfections for the top clearcoat.

Declaration

var clearcoatNormal: PhysicallyBasedMaterial.ClearcoatNormal { get set }

Discussion

An entity in RealityKit can display a clearcoat, which is a separate layer of transparent specular highlights used to simulate a clear coating, like on a car or the surface of lacquered objects. This property allows you to specify a clearcoat normal and add waviness and imperfections to the top clearcoat.

To use clearcoat rendering, set clearcoat to a value greater than 0.0.

This example shows how to set the clearcoatNormal using a UV-mapped image:

if let clearcoatNormalTextureResource = try?
TextureResource.load(named: "entity_cc_normalMap") {
    let ccNormalMap = MaterialParameters.Texture(clearcoatNormalTextureResource)
    material.clearcoatNormal = .init(texture: ccNormalMap)
}

See Also

Setting the core properties