This is a fairly simple extension of my ramp shader. It uses an early pass to inflate the vertices via the vertex normal and color them. This produces an outline that is rendered in world space and fades appropriately in the distance.  Potentially you could model your own outline mesh and get similar results but this is somewhat impractical for building a whole game, so its worth knowing how to do.
You can also shift the outline according to the light direction, giving you thicker outlines in the shadows.
I plan to explore a other methods to generate other lines, as this is only really useful for thin contour lines. Frensel lines should be able to enhance these, bridging gaps and thickening them up.

Maya CGFX File:

outline.cgfx
File Size: 8 kb
File Type: cgfx

Download File


Unity SHADER File:

outline.shader
File Size: 12 kb
File Type: shader

Download File


Leave a Reply

Your email address will not be published. Required fields are marked *