Creating outlines for actor without using Custom Depth

Is there a way to create an outline or silhouette effect in Unreal Engine. We can’t separate the effect enough with just Custom Depth as we need it for different effects.

We tried creating a separate material for the outline like it works in Unity: http://wiki.unity3d.com/index.php/Silhouette-Outlined_Diffuse so we could just toggle the different effects per object (we would like to use custom depth for certain objects like cards, but we don’t want any of the outline or silhouette effects for them).

If I read the unity shader correctly it creates extra vertices to draw, but this doesn’t seem to possible in the material editor and the shader documentation isn’t very extensive yet.

You could re-use Temaran’s work on a custom G-Buffer:

A technique similar to that unity link was actually used in Gears of War 3 in a slightly different way.

Firstly, this technique has big limitations. It relies on doing a “Push” of the base verts to fatten the mesh. This only works when the entire model has soft edged smoothing groups. Hard edges will simply get exploded apart.

To set it up is really easy actually. Make a simple material. Make it unlit and translucent. Make a VectorParameter for the emissivecolor. Under opacity put the “DepthFade” node and put a scalarparameter for fade distance set it to something larger than your outline width (theres better ways of doing this with an offset too).

Then place a “VertexNormalWS” node and multiply it by another scalar parameter called “Push”. Plug this into WorldPositionOffset. This value is your outline thickness.

Now take any mesh you want outlined and duplicate the mesh and apply this material. It should just work if your ‘depthfade’ distance is high enough.

If you want to completely remove the fade between the outline and the mesh you need to do "(pixeldepth - offsetscalarparameter - scenedepth) / some value. Cl

Thank you, that would certainly work very well, but unfortunately it’s a bit of hassle for our production setup and too risky for our tight schedule. I did comment the thread and would certainly like to see a custom G-Buffer make it to the official builds as we feel very limited by the current custom depth approach.

Thank you Ryan. We will see if we can fit a test for our schedule before the Nordic Game Conference (we’ll be demoing our game there). It might work, but off course Temaran’s custom G-Buffer approach would be ever more helpfull in general for us.