Toon shading model

This is great news arnage! Thank you :cool:

I’ve been keeping an eye on your thread since your shading model would solve many issues I’ve been having making this type of effect through post-process in the last month… like being stuck with affecting the scene globally and not being able to have control over specific objects much(I’m already using too much custom depth).

I can’t wait to play around with it.


Really glad you made this(would’ve bought if you were able to sell it, will gladly give attribution if ever release anything). I’ll finally be able to focus more on modeling and particles. These last months have been an arduous journey of just trying to get a specific visual style that is actually usable…

It’s submitted, please try it out and post pretty pictures and/or feedback. You can find the Pull Request here:
Make sure you are logged into github with the account linked to your unreal engine account or you will get a 404 error!

Note: to allow for various half toony styles, materials with this shading model will default to having regular indirect lighting and reflections. To create a completely flat material, make the material AO black and add your flat shadow color to the emissive channel.

Note number two: For some reason material AO does not block screen space reflections. As a result you might get inappropriate reflections when using the previous technique. Simply raise the base roughness to get rid of them or turn off SSR altogether if you don’t need it anyway. I did not change this behaviour as all shading models handle SSR this way. If anyone from Epic reads this: I’d like to know why you chose this over blocking SSR with material AO, which seems more logical to me.

Awesome! Will do.

Hehe doubt I’ll sleep much tonight :stuck_out_tongue_winking_eye:

This shader is amazing. Thank you so much.

The shading model is phenomenal.

Only been testing for about an hour and it does everything I need :smiley:

Going to post stuff as soon as I have good examples to show. Hehe this is going to be a great week.

This is seriously awesome and generous.
Your work is really impressive.
Thanks Arnage.

Thank you arnage!!

could someone please tell me what i have to do to set this up correctly? i am not a coder and have absolutely no clue :frowning:

Thank you so much for this, after hours and hours of searching, the best I could find were some post-processing filters that wouldn’t of worked how I needed. I was planning on reworking or scrapping the project I’m working on if I was still unable to find anything today, so this has come as a massive relief to me!

  • Unfortunately when I click the Github link all I’m getting is a 404 error, so I’ve not yet been able to work with this shader model yet, hopefully this can be fixed soon :frowning:

This aside I have two questions/possible requests/feedback for future implementation that would complete the tools I’d need to take my project to completion:

  1. In my 3DApp I’m currently using vertex color as an AO-like input to create user-defined areas of shadow on the model that are constantly dark, these then blend together with the regular shading, appearing as one.
    This effect is really helpful for making the model look more 2D along with the extra control and detail it provides.


  1. I’ve not yet gotten this far in my personal project, however one of the next things I was planning on doing is using a texture map to define the colour of the shadowed areas, sort of similar to subsurface colour.
    This would be really helpful for visually communicating what kind of surface something is, EG: Lighter shadows could give the impression of something being thin and light (for example hair), redder, more saturated shadows more fleshy and soft, darker shadows, harder and heavier like metal or stone.

Other than those two features, this shader model appears to be absolutely perfect for my project, I can’t thank you enough for your generosity!

You either have to learn how to compile the engine or you have to wait and hope Epic integrates the PR. If I remember correctly the EULA forbids redistributing the editor itself and even if it didn’t I don’t have the space to host such a big download. So I don’t think there are many other options.

On the positive side: compiling the editor is actually not that hard and quite well documented.

This simply means you are not logged in to github. The engine source is in a private repo, so you have to be logged in to reach it. For some reason github just gives you a really unhelpful 404 instead of a informative “please log in” error.

This is possible with the current implementation. Remember that it’s a shading model, not a single material, so you can use the material editor to achieve this effect.

This is also possible. To add color to the shadowed area you simply place something in the emissive slot. There is no need for this to simply be a float, add whatever you like.

Awesome! thank you for the quick reply - I wasn’t sure how easy these effects would be to pull off since I’m still fairly unfamiliar with Unreal 4, I’ll get there :slight_smile:

Also, having never used GitHub before, simply getting a 404 was more confusing than anything else, and a google search to check if it was my fault or not just told me that it was an error on the site’s end
thank you for clearing it up!

EDIT- I’ve created a Github account, however I’m still getting the same 404 error. I tried a different browser client in case chrome was causing the issue, no luck still.

EDIT 2- Fixed now, it was just issues with the Unreal/Github account linking and my own stupidity.

Did you link your unreal engine account to your github account? If so, are you able to access the regular unreal engine repo?

What’s about cell shadding or the same, anime shadding style?

This is awesome Arnage!! I’ll post a screenshot of one of my models here with the shader once I get it up and running:)

Thanks again!

Commenting to say I hope it gets integrated. Really great work.

Nice work.

This looks incredible. Hoping it gets publicly usable (integrated or available in marketplace)

Hey Arnage, nice work! I was hunting around trying to find a good toon shader for UE4 and came across this. Just got it built earlier tonight and have been messing around. I was wondering if you could post the settings you used for your teapots and your windwaker shots. I’m still trying to sort out how to relate this to what I traditionally think of with Cel Shading, as having x number of bands, each a specific amount of lighting. (So say, 2 bands, one where the normal is aligned with the light source 100% to 40% is one brightness and 40% to 0% is another).

Unreal uses 0 to 1 ranges for all parameters so a number of steps/bands would not have been very consistent. Instead I went with step size, which you can see as 1/number of steps. So if you want two bands you set step size to 0.5. The intensity is done automatically, so with two steps the first cell has 100% light intensity, while the second has 50%, manual control over this would have been hard to implement logically within the material editor and would have cost more instructions, so I opted not to add that.

Awesome, thanks for the info. Just spent a while with it tonight and got some pretty cool effects going. Combined the shader w/ some toon style outlines/strokes. I used wind waker Link as a starting point, but then started to apply some of the styles we’re looking at using. Overall it worked very well.
The outlines are are darker versions of the colors of the actual model. There’s a little bit of funkiness we’ll aim to work out, but it’s looking pretty nice. One thing I came across is that the shading tends to look better if the model is set to not cast shadows. Or at least to ‘Cast self shadows only’. The self shadows only is what I have on in this shot, but you can see where the head makes a shadow on the arm, and the hair on the face that it’s diffused. If I turn off shadows it looks more like your shots, but then I have no shadow on the ground. Any ideas there?

(Also I toss a +1 at your PR, if there’s anything else that can be done to promote the branch let me know, I’d love to see it merged.)

Lights have a shadow filter sharpen option. Raising this should give you shadows that look a lot better when used with toon shading.

I plan to make a content examples style scene to explain these kinds of tricks, but I got a big new rush assignment at work today, so I’m not making the mistake again of making promises when that will be done…