Decals

Overview

Placing decals in a level is a simple way to break up uninteresting textures, as well as bring together various level elements like brushes and terrain.

CryENGINE 3 supports Deferred Decal rendering, information on setting this up can be found here: Deferred Decal Setup.

Initial Setup

Selecting the Decal Entity

To place a decal in the level, you should first activate Follow Terrain. This ensures that the decal will be visible on the terrain.

Now go to the Misc Object Type library located in the RollupBar and select Decal.

Placing a Decal in the Level

Select the decal by dragging the Decal into the level. The Follow Terrain tool that was previously selected will snap the new object to the terrain as you move it around.

Click to place the decal in its current position. You can then Move/Rotate/Scale the decal by using the Editing Mode commands located in the Edit menu or on the EditingMode ToolBar.

Setting Up the Decal Material

A decal material has to be marked with the Decal flag in the Shader Generation Parameters in the material options, as shown below.

All materials located in the Materials/decals folder are correctly set up for use as decals.

With the decal selected in the Perspective view, select a material in the Material Editor and click the Assign Material to Selection button.

Decal Projection Types

Decals have 4 different projection types, numbered 0 to 3. To change a decal's projection, select the decal and change the value in the Projection type line, shown below.

Planar

The decal will be displayed in the exact same position in space as where you placed the center of the object.

It is advised to only use this project type on flat surfaces, otherwise you may find the decal "floating" in the air.

Planar projection offers the cheapest performance.

ProjectOnStaticObjects

The decal will be projected onto the geometry of an object in the level. It will be projected along the opposite direction of the blue Z axis.

This method is automatically done as a deferred pass.

ProjectOnTerrain

The decal will be projected directly on to the terrain of your level, ignoring any assets that might otherwise receive the projection.

ProjectOnTerrainAndStaticObjects

This projection type is a combination of type 2 and 3, and will be displayed on both the terrain and objects.

This method is automatically performed as a deferred pass.

Manual Placement of Decals on Objects or Terrain

Select the decal entity, activate Reorientate and use mouse shortcuts to place the decal:

ControlAction
CTRL+ClickMove the decal to the desired position
ALT+clickScale the decal along the local x/y-axis
CTRL+ALT+clickRotate the decal around the local z-axis

This speeds up placement enormously.

Fixing Flickering Decals

If a placed decal is flickering, follow these steps to ensure that it has been properly set up.

  • Check that all sub materials have the "Decal" flag checked in the Material Editor.
  • If it still flickers, check for overlapping layers that have the "Decal" flag enabled. Use the SortPriority param to specify which decal will appear on top of the other.
  • Other than for decals (which are flagged correctly) the mesh shouldn't have any overlapping triangles. Also do not try offsetting them by a few units along the surface normal, it can still break in some situations and will introduce parallax effects, e.g. floating over the surface.
    Depending on the view distance and the resulting precision of the depth buffer, it might work on some hardware but fail on others.

Result

Good placement of decals can bring your level to life. They can also be used to create seamless transitions between many different objects.