Clear-coat shading

Clear-coat shading uses physically-based rendering to simulate vehicle paint.

Real vehicles typically have three layers of paint applied to the body, as in the diagram below:

Diagram

To keep the shading simple, Xenko only simulates the base coat (including optional metal flakes) and clear coat layers. Xenko blends the layers depending on how far the camera is from the material. This reduces visual artifacts caused by the metal flake normal map (which becomes more visible as the camera moves away from the material).

Clear-coat shading has several advantages over creating the effect manually with :

  • layers are blended based on distance
  • increased performance
  • improved visualization

Xenko includes a clear-coat material template. To add it, in the Asset View, click Add asset and select Material > PBR material: clear coat.

  • Select the material you want to use clear-coat shading.

  • In the Property Grid, under the Misc properties, next to Clear coat, click Blue arrow button (Replace) and choose Clear coat.

Note

For clear-coat shading to work correctly, make sure you enable Diffuse, Specular and Specular model under the material Shading properties.

Shading options

You can access the clear-coat shader properties under Misc > Clear coat. They're split into three parts: the base paint and optional metal flake properties simulate the base coat, and the clear coat properties simulate the clear coat.

The metal flake properties simulate a metallic paint effect. To disable the effect, remove the metal flake normal map.

Binary operator

Values over might produce tiling artifacts, as in the image below (note the grid pattern):

The metal flakes in the metal flake normal map included in the Xenko assets package (XenkoClearCoatMetalFlakesNM) are quite large. For this reason, we recommend you:

  • use a high UV scale factor which tiles the texture (thereby shrinking the flakes)

Use random texture coordinates

Note

The Use random texture coordinates option is costly, so we don't recommend you use it for mobile platforms.