Trying to make Toon Shader Material on UE4

Hey Headstub!

I really like the way you put the CelShader together, but, as you mentioned, the borders of the brightness scale made some difficulties.
But I might have figure something out that could help you. It definitely isn’t the best solution, but it works, at least for me.


As you can see you got the CelShading even at black and white, although the outer Stones aren’t completely the colour they are supposed to be.
You can improve this a little bit if you like to, by changing your cel texture to a light grey and a complete white.


But I guess you want to see how I solve your real Problem, so let’s start:


By adding this Max node, you solve your problem with the black colour. The reason for that is that no matter whether the CelShader decided that the colour is going to be the right or the left one of your texture, it always will be multiplied by 0. Therefore the result is also always 0. So by adding a border, so that any value beyond 0.03 becomes 0.03, you do not multiply by 0.
You can also change the value to something smaller, so the black gets darker, but in opinion you shouldn’t get beyond 0.02, because then the same Problem will appear again or you just at least can’t keep the dark colours apart :wink:


Solving the problem for the white colour took me much longer. I tried several different ways, but none of them seems to work.
But somehow I could solve it anyway by happenstance. I noticed that the colours were kind of noisy, as if the antialiasing was broken. Therefore I changed the Post Process Material to ‘Before Tonemapping’, because that is what you do in such case. Yeah and somehow it also fix the problem with the bright colours.

Yeah and that is all. Nothing more behind it :wink:
I hope I could help you, because I read this thread for a while now, but I could never add something that advances this.

  • Merlin

PS: Just so you can see that I actually used your CelShader with my tweaks :wink: