- Home /
Unity 5: can you make a toon shader using the Standard Shader?
According to the docs, with the standard shader "you no longer need to decide from a long list of shader types that support various combinations of features (reflective, bump, transparent, etc)".
I'm on a project that is using toon shading and we're looking at having to buy toon shaders from the asset store for exactly this reason (based on testing in Unity 4). The Standard Shader seems geared toward realistic lighting however. Is it possible to get toon effects/outlines with it?
Answer by Max_Bol · Aug 03, 2016 at 11:57 PM
The short answer is : Yes. The long answer : Depending on what you wish to have, as a result, it's either easy or complicated.
First, it depends on what kind of rendering you want to use.
The default available shaders with the effects package are as follow :
Toon Basic & Toon Basic Outline :
If you want a Cel Shading effect that is light, requires not much work and gives you a nice result like Wind Waker, the default Shader "Toon/Basic" and "Toon/Basic Outline" will give you the effect. The downside of that shader is that you got no normal or relief effect and must simulate them directly on the Base(RGB) textures. In other words, Toon Basic and Toon Basic Outline are easy to setup, but requires more artistic work in the textures. Those shaders (in their native form) doesn't really use lightning values and mostly display "darker" parts based on the camera's rotation and past the value based on a cubemap based value
Natively, this shader doesn't consider normal map either nor metallic or opacity.
Toon Lit & Toon Lit Ouline :
Those ones offer a much more darker atmosphere as they get the general lightning values and change those value based on an image you use. (The way shadows and lightning works is that they are valued from 0 to 1 with 0.5 is half shadowed, half lighted. When a pixel is lighted, its 0-1 shadow value is replaced by the image pixel value on x axis. (so, for example, if the lightning is 0.25, then it will take the pixel value of the image at 1/4 of the "line" and apply it instead).
Natively, this shader doesn't consider normal map either nor metallic or opacity.
If you really just want some outline, have metallic and opacity effect, you can use the Standard shader (or Standard Specular), make uses of a Emission map with Global Illumination set to "none" and add the Edge Detection Image Effect script to the camera. This requires a lot of try & error, but can give a really good result. It's also similar to the Toon Basic as you need to "paint" the effect yourself.
This method allow you to use anything from the Standard shader, but requires a lot of controls and artistic skills.
If you agree to the downside of using Deferred Rendering, there's a really good example of how you can modify the Standard Shader for a more toon-like shader :
Link to the author's post with fixes for Unity 5.3
The only issue with this method is the fact that you're pretty much stuck with Deferred Rendering. What's the limitation of Deferred Rendering? • No opacity on any model. (Only Cut-Out and Opaque mode works) There are workaround to add opacity (like how it's done in Unreal 4) through additional rendering passes, but they requires extensive understanding of the shaders. • Many Image Effects available won't work as they requires to work through the mask & opacity buffer which is absent in Deferred Rendering. (So you will have to build your own.) • Unity Worldspace (based on a camera) UI really doesn't like this. You might have issues where the UI doesn't appears at all. (Deferred Rendering render only what's on screen as a per-pixel method while Forward rendering render all visible object in their integrity and with their own full lightning maps.)
Those are the current well known possibility for a toon-like result.
Answer by devilqube · May 02, 2015 at 03:11 PM
hi,
Some Toon shaders are included as part to the effects package of the Standard Assets.
(https://www.assetstore.unity3d.com/en/#!/content/32351)
C
Your answer
Follow this Question
Related Questions
How to make toon (cel) shader with 3 colors so that I can change each of the three colors? 0 Answers
Unity3d In Linux (Ubuntu) Question.. 1 Answer
Network Lobby Unity Asset 1 Answer
Unity3D 5 First Person Controller Standard Asset doesn't work correctly 2 Answers
[HELP]Project screen is blank 2 Answers