⭕ Outlines

Outlines are a great way to add polish and style to a variety of games! They fit many art styles, from toony to those mimicking traditional art. They’re also great to add emphasis to specific objects in your world, or delineate separate teams.

I’ve covered two strategies to render outlines so far: hull and edge detection.


Hull Outlines

Link

Hull outlines work by rendering a mesh twice. The second time the mesh is turned inside out, enlarged, and painted black, creating a border around the original mesh. If you only outline a few objects at once, it’s very efficient. These outlines change with perspective, which might be a good or bad thing. However, hull outlines do not work as well with complex or multi-part meshes. In addition, if your mesh has sharp edges, you will need to add an extra script to provide “smoothed” normals for the outline system. The script in this tutorial is quite basic, and needs to be extended to support skinned meshes.


Edge Detection Outlines

Link

Edge detection outlines work by reading a variety of textures holding data about the objects on screen and finding edges, or large differences, in that data. They can be applied to the entire screen at once, making them efficient if you outline your whole scene. Each texture, either color, depth, or depth-normals, require an extra pass of the renderer, making this system have an inherant overhead cost. They also require a lot of fiddling with settings, and often will not work perfectly from all camera angles and distances.