Outline Configuration Guide¶
This section covers NiloToon's various outline features, including Screen Space Outline, Classic Outline, fixed outline width, Z-Fighting solutions, and more.
Enabling Screen Space Outline¶
Screen Space Outline is a screen-space-based outline that can be applied to both character and environment materials.
Setup Steps¶
-
In your active NiloToonAllInOne Renderer Feature, enable AllowRenderScreenSpaceOutline.

-
In your character material, enable the Screen Space Outline section. For environment materials, you can skip this step.

-
Add NiloToonScreenSpaceOutlineControlVolume to a Volume Component in your scene, enable Intensity, and set it to 1.

-
You should now see Screen Space Outline applied to NiloToon's character and environment materials in the Game View window.
Flickering in Scene View¶
Screen Space Outline flickering in the Scene window is a known bug. It occurs because GUI updates are triggered when you move the mouse. You can resolve this by disabling the following setting:
Disable Allow Render Screen Space Outline in Scene View.

Game Window Size and RenderScale Impact¶
Screen Space Outline being affected by Game Window size or RenderScale is a known limitation of the screen space outline method.
Classic Outline¶
Outline and Surface Type¶
For Opaque materials, set the Surface Type to Opaque/Outline or Opaque(Alpha)/Outline.

For Transparent materials, set the Surface Type to Transparent(ZWrite)/Outline.

With these settings, Opaque and Transparent Outlines will work together.

Outline Regeneration (On Reimport / Platform Switch)¶
If outlines have disappeared, you can click on the character's NiloToonPerCharacterRenderController script to trigger a rebake.

Alternatively, click Window > NiloToonURP > Model label > Re-fix whole project! to rebake all character prefabs in the project (this is very slow). If you are using a build machine that has never played the game, clicking this button before building may solve the "outline disappeared in build" problem.

Debug UV8 (Smoothed Normal)¶
When you open NiloToon's Debug Window and debug UV8 as color, if all the character's rendering becomes light blue and purple (colors resembling a Normal Map, not red, yellow, and green like UV), then the .fbx's smoothed normal has been correctly generated and stored in the mesh's UV8. HQ Continuous Outline in the character material's Classic Outline group will work correctly.



Outline Width Fixed in World Space¶


To make the outline never change width in world space, use NiloToonCharRenderingControlVolume in Volume and change Char Outline Width Auto Adjust To Camera Distance And FOV from 1 to 0.
You can also control this via the Auto Width setting in the material. Set it to 0 to make the outline fixed in world space.

Outline Z-Fighting (Mobile Build)¶
If you encounter Outline Z-Fighting issues on mobile/WebGL, especially in OpenGLES environments, try the following.
Solution
- Lower the camera's Far Plane as much as possible (e.g., 1000 to 100)
- Increase the camera's Near Plane as much as possible (e.g., 0.03 to 1)
This may solve the Outline Z-Fighting problem.
Improving Face Outline¶
When you enable Is Face? in the face material, a stronger default Outline ZOffset _OutlineZOffsetForFaceArea (0.02) is applied. This removes most of the ugly outline around the eyes and mouth, but it may also remove the face shape outline.

Solution A¶
Lowering _OutlineZOffsetForFaceArea may cause ugly outlines around the eyes and mouth to reappear, so you will need to fix them using an OutlineWidth Map or Vertex Color.

Solution B¶
Keep _OutlineZOffsetForFaceArea high enough, enable _UseOutlineZOffsetTex, and draw _OutlineZOffsetMask so that _OutlineZOffsetForFaceArea only applies to the ugly outline areas (eyes/mouth), not the face shape area.

MagicaCloth and Outline Issues¶
If outlines are broken when using MagicaCloth/MagicaCloth2, you need to enable Update Normal And Tangent Per Frame.
The default Normal And Tangent Update Mode in MagicaCloth is Update Normal Per Frame, where tangent is not updated. However, NiloToon uses tangent data for outline calculation in the shader, so you need to change the setting to Update Normal And Tangent Per Frame.
Incorrect Settings

Correct Settings

For MagicaCloth2, the settings are located here:

Cause
The problem occurs because the tangent is not cloned to the mesh for cloth simulation. NiloToon's Classic Outline requires tangent data. For SkinnedMesh with MagicaCloth and NiloToon, Update Normal And Tangent Per Frame is always required.