Skip to content

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

  1. In your active NiloToonAllInOne Renderer Feature, enable AllowRenderScreenSpaceOutline.

    Allow Screen Space Outline in Renderer Feature

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

    Enable Screen Space Outline in Material

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

    Screen Space Outline Control Volume settings

  4. 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.

Disable Scene View Outline setting

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.

Opaque Outline setting

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

Transparent Outline setting

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

Combined Outline result

Outline Regeneration (On Reimport / Platform Switch)

If outlines have disappeared, you can click on the character's NiloToonPerCharacterRenderController script to trigger a rebake.

Trigger Outline 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.

Rebake entire project

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.

UV8 debug result 1

UV8 debug result 2

UV8 debug result 3 - correct Normal Map colors


Outline Width Fixed in World Space

Outline width comparison 1

Outline width comparison 2

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.

Material Auto Width setting


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.

Face Outline ZOffset applied result

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 A result

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.

Solution B result


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

Incorrect MagicaCloth setting 1 Incorrect MagicaCloth setting 2 - broken outline

Correct Settings

Correct MagicaCloth setting 1 Correct MagicaCloth setting 2 - proper outline

For MagicaCloth2, the settings are located here:

MagicaCloth2 settings location

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.