/ue5-toon-shader-plugin

Christopher Sims' shader as a ready to use plugin

Unreal Engine 5 Toon Shader

The following is lifted from Christopher's twitter.

UE5 Lumen and Nanite compatible toon shader. 3 methods for cel shading, 7 methods for outlines, and a custom function example.

Rzmo1ftl9fbqQ9VE.mp4

This is an unlit surface shader. The diffuse and specular colors are based on the main directional light in the scene. Very consistent results, but we can do more...

E5t7J9wWUAQhqmo


Desaturate the final render, mask out the shadow and change it’s color to match the cel shading bands

E5t7TFnWUAEu1mO


Desaturate the entire scene and posterize the result. You get really noisy edges because Lumen is raytracing, but it’s still a neat style.

E5t7bH1X0AQtnzK


As of UE 4.2 you can do a separate render pass for just the transparent objects in your scene. Then apply any edge detection algorithm you’d like. Looks awesome with animated fractures

E5t7kw_XIAsLhrb


If you turn indirect lighting intensity all the way down, Lumen shadows become crisp enough to do a nice comic style outline around the shadows

E5t7xDHXoAECrir


For Depth based edges, the edges fade fhe further away from the camera and rather than use a hard threshold, a multiplier and bias is used

E5t73BrXIAg5O6p


Normals edge detection is a great complement to depth edges because you can catch edges within each object like on the cube

E5t79HfXIAUULqh


This is a nice method when you want edges everywhere and you don’t want to fiddle with sensitivity settings

E5t8CroX0A0JwrZ


Stick a texture into the specular channel of the surface shader, then sample it in post and overlay the edges on the final render

E5t8ILyXwAAjsaW


During modeling, or using the UE Modeling plugin, assign a random value to the red channel of each faces vertex color, and again feed it into the specular channel for edge detection

E5t8Ra5XIAgR_ht


A pseudo random number based on each object’s WS position, and again use that value in the specular channel. It’s much faster than manually coloring vertices

E5t8cl5WEAUn603


Nanite does not support a custom depth buffer yet so use a specular value of 0 to disable normal based outlines in post, and a range of .1 - .5 for everything else, in particular object position color. Low specular values are imperceptible

E5t8jzXXEAIK1nZ


The custom function material node allows you to do loops so you can achieve Voronoi patterns, among others.

E5t8pEFXEAIH-To