Website powered by

Black and White Toon Shader

A grungy black and white shader I made in Unreal 4 - Inspired by games like Return of the Obra Din (2018) and Mad World (2009). It works using scene depth, scene normals and postprocessinput0.
I wanted to make a shader that had black outlines over white, and white outlines over dark - meaning, I wanted the outlines to be black if they were lit, and white in they were shaded.
Also, if an object's edge is covered by a black or white texture, the color of the outline in that area will be flipped, preserving the continuous outline.

Here's a video of the shader in action. Added a little light animation to show how it reacts to movement.

First part of the shader detects outside edges using scene depth.

First part of the shader detects outside edges using scene depth.

Second part of the shader detects inside edges using scene normals.

Second part of the shader detects inside edges using scene normals.

Both inside and outside lines are added up with a a max and clamp node. The black and white is done by using the postprocessinput0 + cheap contrast and using that as a mask with a lerp node (with some panning textures for additional effect.)

Both inside and outside lines are added up with a a max and clamp node. The black and white is done by using the postprocessinput0 + cheap contrast and using that as a mask with a lerp node (with some panning textures for additional effect.)