Add outline to your project and enable it in your map
Last updated
Last updated
After you enabled post process in your project and map as shown below, you need to add a component tag 'outline' to your meshes in your interactable actor. More info in How to make any actor interactable. For foliage you can simply enable and adjust the outline effect directly in the dat table DT_InteractableFoliage.
In your project settings search for ‘custom depth’ and set Custom Depth-Stencil Pass to Enabled with Stencil:
Check if you have a post process volume in your map. If not, add a new one to your map:
Either if you had already one or just added it, make sure in its details it is set to infinite:
Then select the post process volume and in the details tab search for "materials" and add M_OutlineNiceInteractionSystem_01 like here:
To test if it works, you can drag for example a cube in your level and search for ‘custom depth’ in its details. Then you can set RenderCustomDepth to true and adjust the CustomDepthStencil values to choose the outline presets that are provided by the Nice Interaction System. If you set up an interactable you might notice an integer variable Outline ID which is basically the stencil value.
How to edit the outline presets and add more:
It is no problem to edit the presets - you only need photo editing software. You can export this texture and later reimport your edited texture:
This texture contains the outline color, thickness, opacity and whether it is filled or not.
Let’s look at an example and take Outline ID = 1 for it:
(as photo editing software Gimp is used here)
If the Outline ID would be 0, the outline would be white. If the Outline ID is 1 as here selected on the image the outline would be red. The color of the pixel below defines the outline thickness. White would be the most thick outline while a dark gray is a thin outline. If you make this pixel black it means that the effect is filled, so just tinting the object (which is the case for Outline ID 5 & 6). If you go another pixel below that here it is white. This is the opacity while white is an opacity of 100% and black an opacity of 0%. Since the texture is 16x16 pixels you can add 16 different Outline IDs. However if you need more you can make the texture 32x32 but then you also need to do a few small adjustments in M_OutlineNiceInteractionSystem_01.
In NiceInteractionSystem -> Outline open M_OutlineNiceInteractionSystem_01.
Here adjust the material as follows (add what is in the comment box):
You can make a simple adjustment to the outline material to get an outline result like this: