https://github.com/miltoncandelero/ue5-toon-shader-plugin
Christopher Sims' shader as a ready to use plugin
https://github.com/miltoncandelero/ue5-toon-shader-plugin
Last synced: 2 months ago
JSON representation
Christopher Sims' shader as a ready to use plugin
- Host: GitHub
- URL: https://github.com/miltoncandelero/ue5-toon-shader-plugin
- Owner: miltoncandelero
- Created: 2023-03-18T01:48:54.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-03-18T02:29:04.000Z (about 2 years ago)
- Last Synced: 2025-01-19T07:14:06.900Z (4 months ago)
- Size: 14.6 MB
- Stars: 17
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Unreal Engine 5 Toon Shader
## [by Christopher Sims](https://twitter.com/csims314/status/1412863101196713993)### 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.
https://user-images.githubusercontent.com/15253010/226077619-33c4f627-3954-4262-99fd-311043e39a8f.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...

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

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

---
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

---
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

---
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

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

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

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

---
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

---
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

---
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

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