Shadow Settings¶
A comprehensive guide to shadow rendering in NiloToon. NiloToon provides several shadow techniques, each suited to different use cases.
Shadow Overview¶
NiloToon offers multiple ways to control character shadows:
| Shadow Type | Description |
|---|---|
| Shadow 2D on Face | Casts 2D-style shadows on the face. Uses Depth Offset to generate shadows in the face area. |
| NiloToon Self Shadow | A NiloToon-specific Self Shadow Map that renders high-quality self shadows for characters. |
| URP Shadow Map | Unity URP's standard Shadow Map for receiving shadows from other objects. |
Shadow 2D on Face¶
A NiloToon-specific feature that casts 2D-style shadows on the face. This feature uses Depth Offset relative to the Depth Texture to generate shadows in the face area.
Rendering Path Support¶
| Rendering Path | Supported? |
|---|---|
| Forward (Depth Priming = Off) | Supported |
| Forward+ (Depth Priming = Off) | Supported |
| Forward (Depth Priming = On) | Not supported by NiloToon yet |
| Forward+ (Depth Priming = On) | Not supported by NiloToon yet |
| Deferred / Deferred+ | Supported |
Caution
When Depth Priming = On, ZTest is forced to Equal after Depth Priming, preventing this feature from working. If you need to render Shadow 2D on face in Forward/Forward+, disable Depth Priming.
2D Shadow from Eyeglasses¶
By default, NiloToon casts a 2D Shadow on the face from eyeglasses. In most cases, this shadow may produce undesired results.
To remove the 2D Shadow from eyeglasses, apply the following settings in the eyeglasses material:
- Enable Is Face?
- Set Is Face? > Face Normal fix to 0
For details, see Eyeglasses Settings.
NiloToon Self Shadow¶
NiloToon Self Shadow is a character-specific Shadow Map that renders high-quality self shadows for characters.
Render Face and Self Shadow¶
When rendering the NiloToon Self Shadow Map, the default is Back Face Only to reduce Shadow Acne. This assumes the mesh is an enclosed 3D mesh.
For single-face meshes (e.g., skirts, cloth) where the Self Shadow Map looks broken or incomplete:
- Change the Render Face preset to Both
- This renders a complete shadow, resolving most issues
For details, see Render Face(Cull) Settings.
Receive URP Shadow¶
To have NiloToon characters receive shadow map shadows from other shaders, enable Should Receive URP Shadows in NiloToon's Renderer Feature.
Note
By default, Should Receive URP Shadows is disabled because NiloToonSelfShadow is enabled.
Remove Self Shadow, Receive Only Distant Object Shadows¶
To remove the character's URP self shadow while receiving shadows only from distant objects (e.g., buildings, trees):
| Setting | Value | Description |
|---|---|---|
| Depth Bias | 2 | 2m Depth Bias, sufficient to remove all character self shadow |
| Normal Bias | 0 | Disables Normal Bias. Prevents shadow holes |
For details, see Renderer Feature - Receive URP Shadow.
Shadow Control Volume¶
Add NiloToonShadowControlVolume to a Volume to control shadow visuals globally.
Primary Usage¶
- Control a global Shadow Tint Color
- Combining a deeper Shadow Tint Color for Non Skin/Face with a lighter Shadow Tint Color for Skin/Face produces better visual results
URP Shadow Map Control¶
If the character receives URP's Shadow Map:
- Receive URP's Shadow Map > As DirectLight Multiplier: Controls how much of the main light is blocked by the URP Shadow Map
For details, see NiloToon Volumes - Shadow Control.
Shadow Color (Material)¶
You can directly control shadow color in the material's Shadow Color group.
Non-Skin/Non-Face Areas¶
- Controlled by Tint Color, HSV Strength, H, S, V parameters
Skin/Face Areas¶
- Controlled by Color Preset, Brightness (Skin Override), Brightness (Face Override)
Tip
- We recommend using the character's 2D art as a color reference for selecting skin shadow colors
- The typical range for Brightness is 0.8-1
For details, see Material - Shadow Color.
Neck Shadow Split Issue¶
A common issue where the face material (Is Face enabled) and body material (Is Face disabled) split around the neck, causing a visible shadow line.
Solutions¶
| Method | Description |
|---|---|
| Standard Solution | Use an Is Face Mask Map to exclude the bottom of the head from Is Face |
| Occlusion Map | Add a soft-gradient Occlusion Map to force the neck area into shadow |
| Easy Solution | Make the entire neck Is Face, and hide the shadow split line under cloth or accessories |
For details, see Surface Type - Neck Shadow Split.