How to create outline effect for only one side of an object?

Hey everyone,

I’m trying to create an outline effect that only applies to the upper or lower portion of an object, similar to the roofs in the screenshot below. Any ideas on how to achieve this? I’m thinking that either a 2-pass shader or using ddy to scale the mesh may be necessary.
171737-capture.png

The two most common techniques for making outlines are the postprocessing method and the geometry method.

The Postprocessing method involves rendering the alpha of the object to a temporary texture, blurring that texture, and then turning the blurred pixels into the outline. Here’s an example project of that technique in action. This technique has the benefit of having a fixed width in screenspace. It is the technique the unity editor uses to highlight objects selected in the viewport.

The Geometry method is what most likely what Oskar Stalberg is using in that Badnorth screenshot. You duplicate the mesh, flip the mesh normals to be inside-out, and then increase the size of the mesh along the vertex normals to create the illusion of an outline. This sort of outlines scales with distance.
You can achieve this effect by manually creating two meshes, or through a shader with two passes.