Getting started with Unity Toon Shader
The Unity Toon Shader(UTS) provides tons of properties for professional cel-shading, though. In this page, you'll learn what are keys for basic cel-shading step by step.
What you have to do for simple cel-shading are:
- Make sure at least one directional light is in the scene.
- Create materials for cel-shading and set appropriate shader path.
- Set up three basic colors.
- Determine touch of the character.
- Set Outline.
After mastering above you might want to check:
Put a directional light in the scene
To make cel-shading work. You need to place at least one directional light in the scene.
Creating a new material and applying Unity Toon Shader
Start from creating a material.
Set a new material to the character |
---|
Selecting appropriate shader for the material.
Because the Unity Toon Shader(UTS) includes shaders for all the render pipelines, the Built-in Render Pipeline, URP, and HDRP, you need to choose appropriate shader for the render pipeline set to your project.
Render pipeline | Shader path | Tesselation Shader path |
---|---|---|
The Built-in Render Pipeline | Toon (Built-in) | ToonTessellation (Built-in) |
URP | Universal Render Pipeline/Toon | N.A. |
HDRP | HDRP/Toon | HDRP/ToonTessellation |
Applied Universal Render Pipeline/Toon |
---|
You see the directional light isn't affecting like usual shading. This is because UTS controls the response of the lighting according to the artist's intentions. UTS allows detailed control whether the directional light color effects on materials. Please refer to Scene Light Effectiveness Settings. But, while learning this section, setting the light color to white is recommendable.
Setting up three basic colors
The most basic function of the UTS is to render the mesh in three regions. Base Map for regions with no shadows, 1st shading map for regions with shaded lighter , and 2nd shading map for regions with shaded darker. Three Color Map and Control Map Settings provide the properties to control this fundamental settings. For basic cel-shading, two maps, Base Map and 1st Shading Map work fine.
Applied Base Map and 1st Shading map to the material |
---|
The difference between the two texture is the color tone. In this sample, applied two different textures. But, applying one texture and differ colors to apply is also possible.
A: Base Map | B: 1st Shading Map |
---|---|
<img src="images/utc_all2_light.png" width=256> | <img src="images/utc_all2_dark.png" width=256> |
Adjusting edge of three basic color region
Touch of the image is one of the most important factors that determine the style of the work. Shading Steps and Feather Settings provides ways to adjust the position of the border between the regions and whether they're clearly separated or blended. First, you should adjust Base Color Step to make 1st Shading Map, darker texture above, displayed.
Adjusted Base Color Step |
---|
In the above, the boundary of Base Map and 1st Shading Map is cleary separated. Try adjusting Base Shading Feather to see how to control the boundary clearness. Sometimes, blended borders are favorable.
Adjusted Base Shading Feather |
---|
Set outline
The Outline is another important factor that determines the animation touch. The color of the border should be close to the background or clearly distinguishable, and its thickness affects the style of the animation. Outline Settings provides the properties to control them.
Thin outlines in a light color |
---|
Bold outlines in a dark color |
---|
Advanced techniques
Now, you learned basic cel-sheding. But, professional cel-shading often requires more treatments. You will learn a couple of techniques in this section.
Eliminating outlines around eyes
Look at the character's face above again. You will notice outlines around characters' eyes spoiling the images. UTS provides Outline Width Map to solve this. By applying that map, you can control the thickness of outlines around every part of the meshes to your satisfaction.
Applied Outline Width Map |
---|
Adding luster to hair
You might still see the image appear flat and lacking in three-dimensionality. Highlight on hair is common expression in anime production. Angel Ring and Material Capture(MatCap) are more specialized for hair luster. This time, apply MatCap on the hair. Create another material, then set MatCap map in it.
Applied MatCap Map to Hair |
---|
More options for stunning professional cel-shading
The following factors are also essential in nowadays animation/game production when using cel-shading. Please try these out after mastering this page.