Hello everyone
I’ve been working on a celshade/toon shade( is there a difference? ), and just wanted to share it with you.
I’m not really a shader programmer, I just compiled together what I found on the internet, customized some bits, etc.
So, if you like it, take it
I’m sure it could be more optimal, if you know any better method, or ways to improve, please do tell!
With small gradient on edges
With hard edges
Outline test
Usage:
There is a MaterialInstance, where you can set these values:
LightingPower: Scales the light calculated from the scene. Useful on darker levels, because lighting difference would be so small, that the whole character would be on the same light level. Default is 1
Min-MaxDistanceAlpha: Fades out the outline based on min-max distance
Min-MaxDistanceSize: Modifies the size of the outline based on the mix-max distance, between OutlineSize and 1
OutlineSize: Width of the outline. Set it carefully, sadly if set to a too high value, it gets distorted. 5 was the max I could get, 1 is the minimum.
And you need a texture, I used a 1x256 sized one, decides what light level the current pixel should have. 128,128,128 is the base value, anything brighter color will brighten up your scene.
Only works on models with RenderCustomBuffer
If you download the zip, put the Shaders folder inside your content folder, restart the editor, and it should appear.
Download it here