The Decal component projects textures onto model's opaque or transparent surfaces. They inherit and modify the PBR properties of the surface they're projected on.

They are a great way for adding detail to your scene's static geometry or adding dynamic effects at runtime such as blood splatters, bullet holes, explosion scorches.

A few decal variations in an example scene.Decals are culled per screen space tile and drawn when models are drawn, so they incur no additional draw calls resulting in a very insignificant effect on performance.

There is no hard limit to how many decals you can have in a scene or overlapping on an object.

How to create

Decals can be created in editor through Add Component → Rendering → Decal.
They are projected forward along +X (the direction of the arrow gizmo).

They can also be created programatically at runtime in C#:

// Creates a decal of a Steam avatar and renders it over everything.
var decal = go.AddComponent<Decal>();
decal.ColorTexture = Texture.LoadAvatar( 76561197996859119 );
decal.SortLayer = 255;

Properties

Property Description
Color Texture The color map to use for the decal including transparency which masks the decal.
This must be set for other textures to use the decal mask.
Normal Texture The normal texture map to use for the decal.
RMO Texture The Roughness/Metal/Ambient Occlusion texture map to use for the decal.
Red = Roughness, Green = Metal, Blue = Ambient Occlusion
Color Tint Tints the color of the decal's albedo and overall opacity of the decal.
Attenuation Angle How much should the decal fade away from the flat surface.0 is no fade, 1 is max fade.
Size Sets the local size in units for the decal's projection.This is multiplied by the GameObject's world transform to get the final size.
Sort Layer Determines the order the decal gets rendered in, the higher the layer the more priority it has. Decals on the same layer get automatically sorted by their GameObject ID.

Attenuation Angle from 0.0 - 1.0

Sort layers can make sure certain effects always appear on top.

Limitations

  • There is no way to create a custom decal shader that works with these as they are drawn as part of the models themselves. You could however draw a traditional depth projected decal which comes with it's own limitations.