-
Notifications
You must be signed in to change notification settings - Fork 411
Toon Outline
This demo showcases how renderer features can be used to easily apply outlines and cel-shading to a game. Ususally this would requre objects to have special "toon" materials on them, but with renderer features the materials can be general and applied centralised as a feature.
The demo contains two different approaches to outlining which each depend on a different renderer feature:
The first example uses the Render Objects
feature to render a hull version of each mesh after the opaque version. The shader for this method is unlit and pushes the vertices of the mesh outwards along their normal and only renders the backfaces applying a color. This method is easy to implement and layer masks can be used to determine which objects will have the outline.
The second example uses the Blit
renderer feature to apply an outline effect after the image has finished rendering. This effect uses the opaque texture which should be enabled in the renderer. The material overridden by the blit renderer feature determines the outline based on a debth texture and blends it with the opaque texture which is the _MainTex
of the shader.
Both of these methods are independent of the materials they effect as method 1 renders all outlined objects an additional time with an entirely different material and method 2 operates as a post processing effect.
Each method is set up as a renderer and can therefore easily be switched out in the render pipeline asset.