Made a Cel Shader in Flax Engine

Hello!

I’ve been curious on how powerful the Flax Engine material system is lately. So, I decided to make a cel shader.

So I had to do a bit of research on how they work, and then I followed this tutorial on how to write a cel shader in Unreal Engine. With some tweaking and fiddling, I got a similar result in Flax Engine. Note that this is done as a post processing step. Here is the finished material:

Before making this material, switch the Domain to Post Process and, at the bottom, switch Post FX Location to Before Post Process Step. Then you can make the material like above. Adjust the gradient to have more control over the cel shader’s look. Here is the final result:


As far as I can tell, this material works great with PBR materials, including normal maps and such. (Although metallic materials seem to be a bit broken)

One thing to keep in mind is that this is applied to every object inside the PostFX Volume you put this cel shader material in. I haven’t found a way to use a custom depth pass like in UE4 to only use the cel shader on certain objects.

2 Likes

Did some more work on the Cel Shader to get a different look. I find playing with the gradient node and the desaturation nodes can wildly change the look of the Cel Shader.



1 Like

Here’s another variation:


In this one the edges are slightly sharper and respond to light better.

1 Like