Other JMO assets for Unity:
Cartoon FX 1 Cartoon FX 2 Cartoon FX 3 Cartoon FX 4 Shape FX War FX MatCap Shaders (Free)
Note: this is the old documentation of Toony Colors Pro 2. Please go here for the new one:
https://www.jeanmoreno.com/unity/toonycolorspro/doc/

Toony Colors Pro+Mobile 2

Documentation

Thank you for your interest in Toony Colors Pro+Mobile 2!
This document will explain and provide examples for each feature of Toony Colors Pro 2.

Note that topics of this documentation can be accessed directly from Unity by clicking on the   icons.



About

Toony Colors Pro 2 (abbreviated TCP2) is a set of shaders and scripts used to help you give a stylized look to your Unity game or application.

As of version 2.2, there are two main workflows to choose from:

  • Physically-Based Shaders based on Unity's Standard shader
  • "Legacy" Shaders based on the shaders before Unity 5 (using Lambert diffuse and Blinn-Phong specular models)

The shaders come with two main features:

  • a set of shaders with a Unified Material Inspector: you only select the base Shader in Unity and TCP2 handles selecting the correct one depending on the options you toggle
  • the Shader Generator allowing you to generate your own Unity shader, with even more features available than in the unified shader

Here are some examples on a basic sphere:

Unity Diffuse Shader
Toony Colors Pro 2
TCP2 with no Ramp Smoothing
TCP2 with Texture Ramp
Sketch Overlay and Outline
Texture Ramp and Textured Threshold
Detail texture and Halftone Sketch
Rim Reflection and black Outline
Bump, Rim, Outline and Colored Shadows
Legacy or Physically-Based?

Choosing between the two workflows might not be as easy as it seems: because TCP2 is used to get stylized visuals, there may be some cases where you want to avoid replicating the physical reality of light interaction.
In such cases, using PBS shaders should be avoided in favor of the Legacy ones.

Here is a pros/cons list that can help choosing between either workflow:

Standard PBS Legacy Shaders
PROS CONS PROS CONS
Easier material setup similar to Unity's Standard shader, with additional stylization options Less stylization options: features like sketch or textured threshold are not supported in the PBS shaders More control: you can precisely tweak all values to get the exact look wanted Longer material setup: more control means more settings to adjust!
Works in all lighting settings: no need to do further tweaks to materials once they're properly configured Limited value ranges: you can't go too much outside the "physical" values and get extreme results (that's actually the whole point of PBS!) More Stylization: e.g. comic-book like visuals using features like halftone or sketch features Less consistency: you may have to readjust material settings so that they fit in each environment
Automatic mobile version: the correct shader is loaded internally depending on the target platform Higher Cost: the Standard shader generally requires more GPU power than the Legacy ones (even though there's also a mobile version) Better Performance: e.g. unlike Standard where everything has specular and reflections, you can entirely disable these features in Legacy thus resulting in a faster shader
Stylization in 1 click: the shader will get settings defined for a material using the default Standard shader Shader Generator: more features to choose from, and get the ultimate stripped-down shader with just the code you need
Getting Started

Physically Based Workflow

Assign the following shaders depending on the wanted workflow:

  • Toony Colors Pro 2 > Standard PBS for the Metallic workflow
  • Toony Colors Pro 2 > Standard PBS (Specular) for the Specular workflow

From there, similarly to Unity's Standard shader, the correct subshader will be used based on the texture maps and features used, as well as the target platform (meaning that the mobile version of the shaders will automatically be loaded when targeting mobile devices).
TCP2 will additionally load the relevant Outline shader if that feature is enabled.

Legacy Workflow

Assign one of the Unified Shader to your material(s) depending on the device you target:

  • Toony Colors Pro 2 > Desktop
  • Toony Colors Pro 2 > Mobile
You can then select the options you want for your material (bump, specular, rim lighting, outlines...) and it will automatically choose the correct shader, making sure you don't have any unused feature loaded.

Internally the shader selection works in two steps:
- it chooses the correct high-level .shader file depending on the selected features (outlines for example)
- Unity then loads an internal shader variation based on the settings chosen, just as it regularly does to turn lightmaps on or off for example (using multi_compile directive)

Each .shader file has up to 928 internal variations, which is why the compilation may take a little longer for some of the shaders!
The compilation only happens once when first importing the pack.
At Build Time, the compilation can take a lot of time depending on how many shaders are used. This is because Unity will fully compile each variation in each shader file.
These compiled shaders are then cached, so this will only happen during the first build of your application, as long as you don't modify the shaders afterwards.
PBS Material Inspector / Standard PBS Shader

The Standard PBS Material Inspector is based on Unity's Standard material interface, with additional stylization options.

The Standard Properties are the same that you will find on the Standard shader:

  • Rendering Mode (opaque, transparent, cutout)
  • Albedo Map & Color
  • Metallic/Specular Maps (depending on workflow)
  • Smoothness
  • Specular
  • Reflection (using Reflection Probes)
  • Normal Map (enables Bump Mapping)
  • Height Map (enables Parallax mapping)
  • Occlusion Map
  • Emission Map & Color
  • Secondary Maps (Albedo + Normal)

Please refer to the Unity manual for more information about the Standard Properties.


The Toony Colors Pro 2 properties control the following features:


 

Main and Additional Lights Ramp Control

When not using a ramp texture, you have an additional setting to define a separate smoothing for the main directional light and additional lights.

  • Threshold: defines the separation between shadows and highlights
  • Main Light Smoothing: smoothing of the separation between shadows and highlights for the main directional light
  • Other Lights Smoothing: smoothing of the separation between shadows and highlights for additional lights
Main Light = 0.1
Additional Lights = 0.1
Main Light = 1.0
Additional Lights = 0.1
Main Light = 0.1
Additional Lights = 1.0
 

Stylized Specular

Will add a smoothing value allowing to get a crisper specular term. You can also blend between the regular and the stylized specular to get an hybrid look.

  • Specular Smoothing: defines how crisp the specular highlights should look
  • Specular Blend: blending value between the Standard and Stylized specular visuals
Stylized Specular disabled
Stylized Specular enabled
Stylized Specular with 0.5 blending
 

Stylized Fresnel

Will add an enhanced Fresnel effect linked to lights around the model.

  • Fresnel Strength: defines how visible is the enhanced Fresnel effect (note that the strength is also dependent on the Smoothness of the material)
  • Fresnel Min/Max: defines the threshold values for the Fresnel effect (similar to the Rim effect)
Stylized Fresnel enabled
Stylized Fresnel disabled
Unified Material Inspector / Unified Shader

The Unified Material Inspector allows you to toggle features on and off and let Unity pick and compile the right shader for you. This will ensure that only the features you care about are included in the compiled shader, so that it runs as fast as possible.

There are two versions of the Unified Shader included with Toony Colors Pro 2:

  • Toony Colors Pro 2 > Desktop with all features in their high quality version
  • Toony Colors Pro 2 > Mobile with all features optimized to be as fast as possible
Note that the desktop version can work smoothly on some high-end mobile devices, so it can make sense to use it for mobile on your main character for example.
Toony Colors Pro 2
Unified Material Inspector

FEATURES

Base Properties

There are 3 colors in the base properties:

  • Color is the regular tint Color multiplied with the whole model
  • Highlight Color is the a tint Color only applied to the lit parts of the model
  • Shadow Color is the a tint Color only applied to the unlit parts of the model

Examples:

Default Colors
Green Color
Green Highlight Color
Green Shadow Color

The Base texture is the main one. Its alpha channel can be used as a gloss map when Specular is enabled.

Wrapped Lighting with one point light
Wrapped Lighting disabled
  • Disable Wrapped Lighting will change how diffuse lights cover the models, meaning lighting will appear more focused.
    It can also help when real-time shadow artifacts become too apparent on the model.
 

Ramp Style

The slider ramp style allows you to define the lit/unlit threshold value, as well as its smoothness (hard or soft line separating shadows from highlights).

The texture ramp style allows you to use a 1D texture (horizontal texture with 1 pixel height) defining the shading from lit to unlit.

Slider Ramp Examples:

Threshold = 0.5
Smoothness = 0.2
Threshold = 0.3
Smoothness = 0.5
Threshold = 0.75
Smoothness = 0.01

Texture Ramp Examples:

Unity toon ramp
Old school ramp
4-levels ramp
 

Normal/Bump Map

Enables normal map support.

Stars normal map
Ramp Smoothing = 0.1
Granular normal map
Ramp Smoothing = 0.4
 

Specular

Enables Blinn-Phong specular.

  • Regular: default Blinn-Phong specular
  • Cartoon: allows you to define the smoothness of the specular highlight
Regular Specular
Shininess = 0.1
Cartoon Specular
Smoothness = 0.1
 

Reflection (Desktop)

Enables cubemap-based reflections.

  • Global: applies the reflection on the whole model
  • Masked: uses the main texture's alpha channel to mask parts of the reflection
  • Reflection Color (RGB): tint color applied to the reflection
  • Reflection Color (Alpha): defines the reflection intensity
  • Use Reflection Probes: will take reflection data from Reflection Probes
Global Reflection
Masked Reflection
 

MatCap (Mobile)

Enables texture-based fixed reflections, using a simple square texture. See my free MatCap Shader Pack for more examples!

  • Global: applies the reflection on the whole model
  • Masked: uses the main texture's alpha channel to mask parts of the reflection
  • Reflection Color (RGB): tint color applied to the reflection
  • Reflection Color (Alpha): defines the reflection intensity
Additive MatCap
MatCap texture used
Multiplicative MatCap
MatCap texture used
 

Rim Effects

Enables rim effects, where intensity depends on the view direction and the face normal.

  • Lighting: adds a color based on the rim factor (a.k.a. rim lighting)
  • Outline: multiplies a color based on the rim factor
  • Rim Color (RGB): defines the rim color
  • Rim Color (Alpha): defines the rim intensity
  • Rim Min/Max: define the thresholds based on the rim value
  • Directional Rim (XY): allows control of the rim direction (e.g. only coming from top)
Red rim lighting
Min = 0.3, Max = 1
Red rim lighting
Min = 0.6, Max = 0
Directional rim lighting
Direction Y = 0.5
Black rim outline
Min = 0.2, Max = 0.8
Red rim outline
Min = 0.5, Max = 0.55
 

Outline

Adds a mesh-based outline to the model. Note that this will add 1 draw call.

The outline works as follow:
- an extruded version of the mesh (based on its normals) is rendered with a full unlit color, and with its faces flipped
- the regular model is rendered on top of it, creating the illusion of outlines

The outline may show incorrectly for meshes with hard edges. In this case you can use TCP2's Smoothed Normals Utility to correct the artifacts.
Regular hard edge normals
Smoothed normals stored in UV2
(hard edge shading is preserved)
  • Opaque: solid color outlines
  • Blended: allows you to set a blending mode to the outlines, to make them transparent for example
  • Outline Color: alpha can control opacity depending on the blending mode selected with Blended Outlines
  • Outline Width: defines how much to extrude the mesh from the vertex normals to draw the outline
  • Outline Color From Texture (Desktop only): takes the outline color from the main texture (averaged and multiplied with the outline color)
    • Texture Outline LOD: defines the mip map level from which to sample the texture color (higher = more blurring)
  • Constant Size Outline: outline size will stay the same relatively to the screen
  • Correct Z Artifacts: allows you to tweak the outline extrusion to correct artifacts from complex models
  • Outline Normals
  • Regular: use the regular vertex normals
  • Vertex Colors: use the vertex colors as normals
  • Tangents: use the vertex tangents as normals (will prevent bump maps and anisotropic specular from working)
  • UV2: use the vertex second texture coordinates as normals
Change this setting when you use TCP2's Smoothed Normals Utility to correct hard-edged models.
    Outline Blending
  • Source Factor: hardware blending source factor
  • Destination Factor: hardware blending destination factor
Blending modes examples:
SrcAlpha / OneMinusSrcAlpha: alpha transparency
DstColor / Zero: multiplicative
One / One: additive
OneMinusDstColor / One: soft additive
Black opaque outlines
Width = 1.5
Outline color from texture
Additive blended outline
Shader Generator options
  • Outline behind model: will make the outline appear behind the model (sorting may not work correctly with other objects)
    Depth Buffer and Stencil Buffer are two different techniques to achieve the effect - you may want to try one or another depending on the artifacts you get.
    With Stencil Buffer, you can choose stencil groups for your objects to determine where the outline should appear between them (using the Stencil Outline Group value):
    Same Stencil Group
    Different Stencil Group
 
Shader Generator
The Shader Generator 2 beta is currently available as of version 2.4.0.
It is a much more flexible system that remains as simple as it was to enable features, but allows further customization of various properties of the resulting shader.
For example, you can change options for any texture used (enable/disable tiling/offset, use scrolling UVs, use screen-space UVs...), or use another data source (e.g. vertex colors), or define your own custom mask for about any property in the shader.
It will eventually replace the current Shader Generator, and is currently the only option for URP support.
You can read its documentation here.

The Shader Generator allows you to generate your own shader files with even more features than in the Unified Material Inspector. Indeed each on/off feature in the Unified Shader doubles the number of internal variants, which quickly adds up to lots of internal shader programs. Moreover, Unity's shader_feature directive has its limits.

Thus generating your own shader files with no variants and exactly the features you need allows for faster compilation and iteration.

USAGE

  • Open the Shader Generator via the menu: Tools > Toony Colors Pro 2 > Shader Generator
  • Select a previously generated shader you want to modify, or New Shader if you want to create one
  • (New Shader) Choose the name of your shader. The forward slashes will indicate the folders in Unity's shaders drop-down list.
  • (Optional) Choose the shader filename if the 'Automatic Names' option is disabled
  • Select the features you want on the shader
  • Click on 'Generate Shader' (or 'Update Shader' if you are modifying an existing one)

There are a lot of additional features available, however if you select too many at the same times the shader might not be able to compile. This is generally due to the limitations of vertex interpolators in Shader Model 3.

You can open a generated shader for modification directly in the Shader Generator by clicking on the   icon in the Material Inspector!
The Shader Generator relies on the ShaderImporter.userData string to store information about the features so that they show correctly in the Inspector. Be careful if you also use it in your scripts.

TEMPLATES

You can load other templates to generate different types of shaders.
List of included templates:

  • Default: Extend the base desktop/mobile shader
  • Surface Standard PBS: Extend the PBS shader (based on Unity's Standard shader)
  • Terrain: Generate Unity-terrain compatible shaders (experimental)
  • Water: Generate water shaders (or other liquids such as lava or poison)
  • Curved World/Default & Curved World/Water: Templates with support for Curved World system (requires Curved World from the Unity Asset Store)
  • Legacy/Standard PBS: Old PBS shader template that uses vertex/fragment shaders (the new one uses surface shaders and has more options)

By default the template files are in the JMO Assets/Toony Colors Pro/Editor/Shader Templates/ folder.


ADDITIONAL FEATURES (only available with the Shader Generator)

This list is not exhaustive, feel free to try the options you see in the Shader Generator and see what they do!
You can also leave the mouse cursor on most of the labels to show a help tooltip!

Ramp Style

Defines how to apply ramp shading based on the diffuse term.

  • Slider Ramp: Define the lit/unlit threshold value, as well as its smoothness (hard or soft line separating shadows from highlights)
  • RGB Slider Ramp: Same as Slider Ramp, but uses a color for the threshold, thus separating it for the three RGB channels.
  • Texture Ramp: Use a 1D texture (horizontal texture with 1 pixel height) defining the shading from lit to unlit

Slider Ramp Examples:

Threshold = 0.5
Smoothing = 0.2
Threshold = 0.3
Smoothing = 0.5
Threshold = 0.75
Smoothing = 0.01

RGB Slider Ramp Examples:

Threshold (128,100,80)
Smoothing = 0.15
Threshold (128,100,80)
Smoothing = 0.6
Threshold (80,90,120)
Smoothing = 0.3

Texture Ramp Examples:

Unity toon ramp
Old school ramp
4-levels ramp
 

Ramp Control

Defines how many ramp control you get in the material.

  • Global: Unique ramp control for all lights
  • Main + Other Lights: One ramp control for the main directional light, and one for all other lights regardless of their type
  • Main + Light Type: One ramp control for the main directional light, and one per light type (directional, point, spot) for all other lights

In the example below, the sphere is lit by one main directional light, one blue point light, and one yellow spot light.

Global
Smoothing = 0.2
Main + Other
2 different smoothings
Main + Light Type
3 different smoothings
 

Wrapped Lighting

Wrap the diffuse term around the mesh, providing a softer light.

  • Off: No wrapped lighting
  • Half: Wrap lighting by half
  • Custom: Wrap lighting by a custom factor

Ramp smoothing is 0.5 in the following examples:

Off
Half
Custom (1.5)
 

Specular (Shader Generator)

Enables specular highlights.

Options (Shader Generator)
  • Regular: default Blinn-Phong specular
  • Anisotropic: Ward anisotropic specular
  • Specular Mask: uses a mask for specular (aka gloss map)
  • Shininess Mask: uses a mask for shininess (allows variable shininess on the same material)
  • Cartoon Specular: allows you to define the smoothness of the specular highlight
Regular Specular
Shininess = 0.1
Cartoon Specular
Smoothness = 0.1
Anisotropic Specular
Aniso. Spread = 0.65
 

Reflection (Shader Generator)

Enables cubemap-based reflections.

Options (Shader Generator)
  • Reflection Mask: uses a mask for reflection
  • Reflection Color: tints the reflection color (RGB) and sets its strength (Alpha)
  • Reflection Roughness: defines the MipMap level at which to sample the texture, to simulate blurry reflections
  • Rim Reflection/Fresnel: the reflection will only appear according to the rim settings (i.e. at grazing angles on the model)
MipMaps need to be enabled on the Cubemap texture for Roughness to work!

Global Reflection
Masked Reflection
Blurry Reflection
Roughness = 6
Rim/Fresnel Reflection
 

Rim Effects (Shader Generator)

Enables rim effects, where intensity depends on the view direction and the face normal.

Properties
  • Rim Color (RGB): defines the rim color
  • Rim Color (Alpha): defines the rim intensity
  • Rim Min/Max: define the thresholds based on the rim value
  • Rim Direction (XY): allows control of the rim direction (e.g. only coming from top)
Options (Shader Generator)
  • Rim Lighting: adds a color based on the rim factor (a.k.a. rim lighting)
  • Rim Outline: multiplies a color based on the rim factor
  • Vertex Rim: calculates the rim term per-vertex rather than per-pixel (less accurate but much faster)
  • Directional Rim: enables the Rim Direction property
  • Rim Mask: uses a mask for the rim effect
  • Light-based Mask: masks the rim effect based on nearby lights
Red rim lighting
Min = 0.3, Max = 1
Red rim lighting
Min = 0.6, Max = 0
Directional rim lighting
Direction Y = 0.5
Black rim outline
Min = 0.2, Max = 0.8
Red rim outline
Min = 0.5, Max = 0.55
 

MatCap (Shader Generator)

Enables texture-based fixed reflections, using a simple square texture. See my free MatCap Shader Pack for more examples!

Properties
  • MatCap Texture (RGB): the MatCap texture
  • MatCap Color (RGB): tints the MatCap
  • MatCap Color (Alpha): sets the strength of the MatCap
Options (Shader Generator)
  • MatCap Add: MatCap will be added
  • MatCap Multiply: MatCap will be multiplied
  • MatCap Mask: uses a mask for the MatCap effect
  • Pixel MatCap: compute MatCap effect per-pixel, useful if you are using normal maps
  • MatCap Color: enable the MatCap Color property
Additive MatCap
MatCap texture used
Multiplicative MatCap
MatCap texture used
 

Cubemap Ambient

Enables cubemap-based ambient lighting. Think of it as directional ambient colors (for example, ambient light from the top will be blue like the sky, ambient light coming from the bottom will be brown like the ground).
The effect is very subtle but really helps to anchor your dynamic objects in your scene.

Properties
  • Ambient Cubemap: the cubemap from which to sample colors
It is recommended to use a blurred version of the skybox cubemap as your Ambient Cubemap!

Default
Cubemap Ambient
 

Directional Ambient

Enables directional ambient lighting, using 6 user-defined colors. This is cheaper than Cubemap Ambient and colors can be easily interpolated to simulate dynamic ambient lighting for example.
The effect can be very subtle but really helps to anchor your dynamic objects in your scene.

Properties
  • Right, Left, Top, Bottom, Front, Back: the 6 colors corresponding to the 6 world axis (positive and negative XYZ)

Default
Directional Ambient
with strong colors
 

Normal/Bump Map (Shader Generator)

Enables normal map support.

Properties
  • Normal Map (RGB): normal map texture
  • Heightmap (Alpha): heightmap controlling the parallax effect (alpha channel only, can be the same texture defined in the normal map)
  • Height: strength of the height parallax effect
Options (Shader Generator)
  • Bump Scale: adds a float value to control the bump strength, like Unity's Standard shader
  • Parallax/Height Map: enables the Parallax/Height map support
Stars normal map
Ramp Smoothing = 0.1
Granular normal map
Ramp Smoothing = 0.4
 

Tessellation

Enables GPU tessellation on the shader (requires Shader Model 4.6+).
You can choose between these techniques:

  • Phong: smooths the mesh based on its normals
  • Fixed: tessellate according to a displacement map and a fixed value
  • Distance Based: tessellate according to a displacement map and the distance between the mesh and the camera
  • Edge Length Based: tessellate according to a displacement map and the screen-space length of the mesh's edges

For more information and examples, please look at Unity's Documentation about Tessellation in Surface shaders.

Tessellation is incompatible with using a custom vertex function. The shader may not compile properly depending on the used features (this is unfortunately a Unity limitation).
 

Detail Texture

Adds another texture on top of the main one, with its own tiling and offset values.

Properties
  • Detail (RGB): the detail texture
Options (Shader Generator)
  • Use UV2 coordinates: use second UV coordinates for the detail texture

Example:

Rock detail texture over main checker texture
 

Color Mask

Enables main color masking. Can be useful if you want to create a customizable color based on the main texture's alpha channel, for example.

 

Vertex Colors

Tints the whole model according to its vertex colors.
Can be used to simulate ambient occlusion, vertex-based lightmap, or regular tinting to add color variations on the same texture while keeping dynamic batching.

Example:

Simple vertex-based color tinting
 

Texture Blending

Blends up to 5 textures based on vertex colors or a texture map, linearly or alpha-based (height blending).
By default the textures are mapped like this:

Black:Main Texture
Red:Texture 1
Green:Texture 2
Blue:Texture 3
Alpha:Texture 4
Options
  • Texture Blending: defines the mapping source, where each color corresponds to a texture (Vertex Colors or Texture Map)
  • Blend Method: how to visually blend the textures
    • Linear: smooth linear transition based on the source colors
    • Linear (Additive): smooth linear transition, but each texture is added rather than linearly blended
    • Height (Texture Alpha): texture alpha-based blending, to simulate a more natural blending
  • Enhance Blend Contrast: add a Vector4 property to the material to allow fine-tuning the contrast of each color of the source map
  • Texture # / Color Channel: set the number of textures, and define the color channel they will map to from the source
  • Normal Map Blending: add a normal map slot for each additional texture (will enable the Normal/Bump Map feature)

Examples:

Source Texture Map
(white represents alpha)

Linear Blending
Height Blending
 

Triplanar Mapping

Use multiple textures and generate world-based texture UVs according to the orientation of the faces.
Triplanar is an efficient way of texturing a terrain mesh.

Options
  • Surface Texture: How many textures to use for the horizontal surfaces
  • Ceiling Mode: Defines how to map the second surface texture
    • Y Normal Direction: map according to the direction of the surface (ground faces up, ceiling faces down)
    • Min Max Threshold: choose texture based on a defined area (based on the Y position in world space)
  • Sides Texture: How many textures to use for the vertical surfaces
  • Height Blending (Alpha): Non-linear blending based on alpha channel of surface of side texture(s) (as in Texture Blending)

The following mesh doesn't have any UVs:

Basic Triplanar Mapping
Triplanar with 'ceiling' Min Max Threshold
 

Subsurface Scattering

Enables subsurface scattering, i.e. light that scatters inside the model.

Options (Shader Generator)
  • Subsurface Lights: defines which lights will affect subsurface scattering
  • Subsurface Mask: mask for the subsurface effect (typically a thickness map)
  • Subsurface Color: colors the subsurface effect (back lighting only)
  • Subsurface Ambient Color: adds an ambient subsurface color, affecting both back and front lighting
  • Multiplicative: makes the subsurface effect multiplied with the diffuse color, instead of added to it
Here's an easy way to generate an approximative thickness map in most 3D modeling software:
  • Flip your model's normals (i.e. flip faces)
  • Bake the ambient occlusion map
  • Invert the colors on the resulting texture
  • Use it as a mask for subsurface scattering

Point light is behind the sphere, with orange subsurface color
 

Emission (Self-Illumination)

Adds emission based on a mask, a color, or both.

Properties
  • Emission Color: tint color for the emission light (RGB) and emission strength (Alpha)
Options (Shader Generator)
  • Emission Map: uses a mask for emission
  • Emission Color: enables the Emission Color property
  • HDR Color: makes the Emission Color an HDR color that can go outside the [0:1] range (useful for effects like bloom)

Example:

Simple emission
Color tinted emission
 

Textured Threshold

This is a powerful feature to achieve a hand-painted look directly on the shading.

The regular shading is defined on a continuous line, more or less smooth depending on the Ramp Smoothing (or Ramp Texture if using one).
Textured Threshold allows you to add a texture pattern along this line.

Properties
  • Threshold Texture (Alpha): offset the lit/unlit threshold based on the alpha channel
Only the Alpha channel is used: values > 128 will add to the threshold, values < 128 will subtract from it (a value of 128 has no effect)

Examples:

Using a texture ramp (no threshold texture)
Achieving a hand-painted look
Texture used for the hand-painted look
Using a noise-based threshold texture
Noise texture used for the previous look
 

Diffuse Tint

Adds a smooth tint to the model, based on the non-ramped diffuse term.
Can be used to add subtle color fringing in the transition between highlights and shadows for example.

Properties
  • Diffuse Tint: the tint color

Examples:

Regular look
With a blue diffuse tint
 

Sketch

Adds a screen-space overlay texture on the shadowed areas. Allows a hand-painted stroke effect for example.

Properties
  • Sketch (Alpha): the overlay texture
  • Sketch Anim Speed: animation speed when enabled
To easily create an alpha-only texture in Unity, in the Texture Import Settings, set:
'Texture Type' to 'Single Channel'
'Alpha Source' to 'Alpha from Grayscale'
By default the screen-space texture is offset by the object's position, to remove the 'shower door' artifact (seeing that the texture is an overlay on the whole screen)

This effect doesn't work correctly in the Scene View: the vertical offset is inverted there.
Options (Shader Generator)
  • Sketch Overlay: adds a screen-space overlay texture on the shadowed areas
  • Sketch Gradient: binary overlay texture based on min/max values (allows half-tone effects)
  • Sketch Blending: defines how to blend the sketch texture with the model's color
  • Animated Sketch: animates the texture coordinates
  • Vertex Coords: calculate screen-space coordinates per-vertex rather than per-pixel (less accurate but faster)
  • Disable Obj-Space Offset: disables offsetting the texture from the object's position (the texture will stay fixed relative to the screen, i.e. each pixel on the screen will always map to the same texture color)
Sketch Overlay with strokes texture
Sketch Gradient with strokes texture
Sketch Gradient with halftone texture
Textured Sphere with regular Sketch Overlay
Textured Sphere with
Color Burn blending
 

Alpha Blending (Transparency)

Enables blending on the model. Allows soft transparency but may cause sorting issues with other semi-transparent objects.

Alpha Blending will be enabled by default, but you can change the source and destination blend factors to create other effects such as additive blending. See Unity's manual about blending for more information.

Properties
  • Source Factor: source blending factor
  • Destination Factor: destination blending factor
Alpha blending over blue background

You can define other blending modes than regular alpha-based transparency.
The following examples are in the form Source Factor / Destination Factor > Result

  • Src Alpha / One Minus Src Alpha > Alpha Blending (regular transparency)
  • One / One > Additive Blending
  • One Minus Dst Color / One > Soft Additive Blending
  • Dst Color / Zero > Multiplicative Blending
 

Alpha Testing (Cutout)

Enables alpha testing on the model. Allows binary transparency with proper depth sorting.

See Unity's manual about alpha testing for more information.

Properties
  • Alpha cutoff: threshold at which alpha value becomes transparent
Alpha testing over blue background
 

Shader Target

Defines the shader target level to compile for.

Shader Model 3.0 is the default value and should work for most GPUs (desktop and mobile).
Shader Model 2.5 is recommended to maximize mobile device compatibility.
Shader Model 2.0 can be used to target very old devices but will limit the complexity of the generated shader.

See Unity's manual about shader compilation target levels for more information.

 

Double-Sided

To get double-sided rendering, use these options:

  • Set Culling to Off (double-sided) so that backfaces are rendered.
  • (optional) Enable Backface lighting to get accurate lighting calculation for backfaces (Shader Target 3.0+)

See Unity's manual about shader compilation target levels for more information.

Shader Generator : Masks

Some features can be masked using vertex colors or a texture.

Usage is pretty simple:

  • Select to use vertex colors or a texture as a mask (either the Main Texture or a new texture slot - up to 3 separate masks textures)
  • If you selected a mask different from the Main Texture, select the color channel that will be used for masking
  • If you selected a texture mask, select the UV settings that will be used for masking:
    • Main Tex UV: will use the texture coordinates of the main texture
    • Independent UV0: will use independent scale/offsets settings with UVs from the mesh
    • Independent UV1: will use independent scale/offsets settings with the secondary UVs from the mesh

The mask UV settings are the same for each mask, so if you change it for Mask 1 anywhere it will be reflected everywhere Mask 1 is used.

For example, if you want to use the main texture's alpha channel as a gloss map, in the Specular Mask feature choose Main Texture and Alpha.

Smoothed Normals Utility

The Smoothed Normals Utility allows you to solve this situation:

Regular hard edge normals
Smoothed normals stored in UV2
(hard edge shading is preserved)

HOW IT WORKS

The outlining technique is based on the mesh normals. When a vertex has multiple normals (aka hard edge shading), it can break the outline as shown above.
The Smoothed Normals Utility will calculate the average normals for each vertex of your mesh, and assign them to an unused part of your mesh data (vertex colors, tangents, or second UV coordinates)

By enabling the corresponding option in the Outline properties, the shader will take this data as the new normals to draw the outline.
This way you get a correctly outlined mesh with hard-edge shading preserved.

USAGE

Open the utility via the menu: Tools > Toony Colors Pro 2 > Smoothed Normals Utility

In Unity, select one or multiple:

  • meshes or models assets from the Project view
  • GameObjects with a MeshFilter or SkinnedMeshRenderer attached
The list of meshes ready to be processed should then appear in the Smoothed Normals Utility.

Select the vertex data target to stored the smoothed normals:
  • Vertex Colors
  • Tangents
  • UV1-UV4
If using UV data, you can select how to store the smoothed normals:
  • Full XYZ: will store the data as-is
  • Compressed XY: will store the data compressed into the XY channels
  • Compressed ZW: will store the data compressed into the ZW channels

Using compressed types loses precision, but it can be handy to optimize storage.
For example, you could keep the regular texture coordinates in UV1.xy, and store smoothed normals in UV1.zw, and thus not need any extra TEXCOORD in the vertex data (or keep them free for other usages).

Click on "Generate Smoothed Mesh" to generate a copy of the mesh with smoothed normals in the selected mesh data.
The new mesh will automatically be assigned if you had MeshFilters or SkinnedMeshRenderers selected.

You will then have to select the correct option in the Material Inspector so that the shader knows where and how to interpret the outline normal data.

Smoothed Normals will only be stored in Tangents for skinned meshes.
This is because normals need to be affected by bones, and in the 3 options available only tangents are affected by bones (vertex colors and UV data are not). Thus smoothed normals can only work stored in tangents for skinned meshes.
This means that smoothed normals can't work with normal/bump maps, anisotropic specular or any other feature needing actual tangents on skinned meshes.
UV1, UV3, UV4 targets, and Full XYZ and Compressed ZW UV data types are only supported in shaders made with the Shader Generator 2.
Ramp Generator

The Ramp Generator allows you to create a ramp texture (to be used with the texture ramp feature) very easily from a gradient.
Simply edit the gradient and set a texture width size. The texture height will always be 4 pixels tall.

Ramp Generator

The Ramp Generator can also edit back ramps generated with it, allowing you to edit the gradient and see the results in real-time on your models/materials.

You can edit a gradient ramp either by:

  • loading a texture with the Ramp Generator
  • or clicking on Edit Gradient in a TCP2 material that uses ramp textures
Ramp Editor
Unpack Shaders

To avoid very long loading times when Toony Colors Pro 2 is imported in Unity, some of its shaders are packed in an archive.
You can unpack these shaders by category (reflection, rim effects...) if you ever need them.
Depending on your machine, the importing process can be more or less long.

You can unpack shaders via the menu: Tools > Toony Colors Pro 2 > Unpack Shaders > ...

Using Curved World
You can use the Curved World system by Davit Naskidashvili with Toony Colors Pro 2 as of version 2.12.
This feature requires the Curved World package from the Asset Store.

Open the Shader Generator, and load the Curved World template file (default or water) with the "Load..." button.
The generated shaders will now be compatible with Curved World and react to its settings.

For the Shader Generator 2, you need to enable Curved World Support in the Third Party Plugins section.
Using VertExmotion
You can use the VertExmotion system by Kalagaan with Toony Colors Pro 2 as of version 2.4.0.
This feature requires the VertExmotion or VertExmotion Pro package from the Asset Store.

Open the Shader Generator (or the Shader Generator 2), and under the Third Party Plugins section enable VertExmotion Support.
Using the Universal Render Pipeline (URP)

Universal Render Pipeline (formerly Lightweight Render Pipeline) support is available using the corresponding template in the Shader Generator 2, which is currently in beta as of version 2.4.0
The URP template has been developed using Unity 2019.3.6 and URP 7.3.1.

Please refer to the Shader Generator 2 documentation for more information!

About Deferred Shading

Toony Colors Pro 2 only supports Forward rendering currently.
It will work if your player settings are set to Deferred Shading, although materials using TCP2 will be rendered in Forward on top of the Deferred scene.

October 2019:
After some research, Deferred support development has been dropped due to the lack of requests and the technical challenge involved.
I might revisit it later when the Deferred rendering path is released for the Universal Render Pipeline.

Further Help
If you have questions, bug reports or suggestions please contact me by email: jean.moreno.public+unity@gmail.com



Other JMO assets for Unity:
Cartoon FX 1 Cartoon FX 2 Cartoon FX 3 Cartoon FX 4 Shape FX War FX MatCap Shaders (Free)