More than 2 years ago I wrote an article explaining the different methods available at the time to implement a Cel Shading art style in Unity 5. Since then, new Unity updates have made obsolete the use of the Custom Deferred Lighting method, and a new implementation is required to achieve the same results.
Until Unity makes available the new Scriptable RenderLoop feature, our best chance to get a PBR friendly Cel Shading art style is creating a new Deferred shader and a custom BRDF function.
Working on a new update for Aragami, I finally decide to upgrade to Unity 5.6 and work on the new implementation. I hold developer time in high regard, so here’s the steps to get Deferred Cel Shading to work in Unity 5.6. All code is available here.
And voilà, now your whole project uses a Cel Shading style, which you can turn off anytime by just going back to the built-in Deferred shader in Project Settings. Bonus points as it works perfectly with Global Illumination, Lightmapping and the new Unity 5.6 Mixed Mode.
To summarize what we did, we just copied BRDF2_Unity_PBS, one of Unity's built-in Physically Based Lighting calculation methods, and modified it slightly to change how the light affects a 3D object. Then we created our custom Deferred shader and told it to use our modified PBS function instead of the original one. That's all.
Hope you liked this quick tutorial, and remember to contact me at firstname.lastname@example.org or write a comment if you have any questions regarding this article.