Cartoon FX 1 | Cartoon FX 2 | Cartoon FX 3 | Cartoon FX 4 | Shape FX | War FX | MatCap Shaders (Free) |
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.
General
- About
- Legacy or PBS?
- Getting Started
- PBS Material Inspector
- Unified Material Inspector
- Unpack Shaders
- Further Help
Unified Material Features
- Base Properties
- Ramp Style
- Normal/Bump Map
- Specular
- Reflection (Desktop)
- MatCap (Mobile)
- Rim Effects
- Outline
Shader Generator Features
- Ramp Style
- Ramp Control
- Wrapped Lighting
- Specular
- Reflection
- Rim Effects
- MatCap
- Cubemap Ambient
- Directional Ambient
- Normal/Bump Map
- Tessellation
- Detail Texture
- Color Mask
- Vertex Colors
- Texture Blending
- Triplanar Mapping
- Subsurface Scattering
- Emission (Self-Illumination)
- Textured Threshold
- Diffuse Tint
- Sketch Overlay
- Alpha Blending (Transparency)
- Alpha Testing (Cutout)
- Shader Target
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:
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 |
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
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. |
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:
- Same as Legacy
- Additional 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
Additional Lights = 0.1
Additional Lights = 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 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)
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.
|
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:
The Base texture is the main one. Its alpha channel can be used as a gloss map when Specular is enabled.
- 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:
Smoothness = 0.2
Smoothness = 0.5
Smoothness = 0.01
Texture Ramp Examples:
Normal/Bump Map
Enables normal map support.
Ramp Smoothing = 0.1
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
Shininess = 0.1
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
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
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)
Min = 0.3, Max = 1
Min = 0.6, Max = 0
Direction Y = 0.5
Min = 0.2, Max = 0.8
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.
|
(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.
|
- Source Factor: hardware blending source factor
- Destination Factor: hardware blending destination factor
Outline Blending
Blending modes examples: SrcAlpha / OneMinusSrcAlpha: alpha transparency DstColor / Zero: multiplicative One / One: additive OneMinusDstColor / One: soft additive |
Width = 1.5
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 GroupDifferent Stencil Group
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:
Smoothing = 0.2
Smoothing = 0.5
Smoothing = 0.01
RGB Slider Ramp Examples:
Smoothing = 0.15
Smoothing = 0.6
Smoothing = 0.3
Texture Ramp Examples:
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.
Smoothing = 0.2
2 different smoothings
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:
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
Shininess = 0.1
Smoothness = 0.1
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!
|
Roughness = 6
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
Min = 0.3, Max = 1
Min = 0.6, Max = 0
Direction Y = 0.5
Min = 0.2, Max = 0.8
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
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!
|
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)
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)
Ramp Smoothing = 0.1
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)
Example:
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:
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
Examples:
(white represents alpha)
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
The following mesh doesn't have any UVs:
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:
|
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)
Example:
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:
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:
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)
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
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
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.
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.
The Smoothed Normals Utility allows you to solve this situation:
(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
Select the vertex data target to stored the smoothed normals:
- Vertex Colors
- Tangents
- UV1-UV4
- 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.
|
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.
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
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 > ...
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.
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.
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!
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.
Cartoon FX 1 | Cartoon FX 2 | Cartoon FX 3 | Cartoon FX 4 | Shape FX | War FX | MatCap Shaders (Free) |