Today's Learning Unreal post is also the first part of a mini sub-series about creating shaders in Unreal Engine. The first type of shader being covered is a Cel Shader. As always, if you want to follow along with the same tutorial that I'm using, you can find it here.
Above is the default version of our viking character without Cel Shading applied to him. Below are a handful of examples of the viking with slightly different Cel Shaders applied.
This Cel Shader is implemented as a Post Process Material. The general process involves calculating the Lighting Buffer using desaturated versions of the Post Process Input and Diffuse Color buffers. The lighting values then get clamped and applied to a threshold which determines which shading band each pixel belongs to. You also have to make sure that the whole process takes before Unreal performs its Tonemapping process.
To actually use the Post Process Material, a Post Process Volume needed to be added to the scene itself that applies the Cel Shader.
To get the Cel Shading to apply only to the viking and not the background involves calculations using the Scene Depth and Custom Depth buffers.
The different Cel Shader variations above was possible through the use of Lookup Tables, such as the one below.
It's nice finally getting to work with Shaders again.
Comments