Skip to content

Set Up a New Character (Auto)

This section covers the typical steps to set up a new character with NiloToon. A new character usually means a Prefab generated from .fbx or .vrm files.


0. Extract Materials

Important Step

Select your character's fbx/vrm file in the Project window and ensure that all of the character's Materials are extracted and editable.

In the Inspector for the .fbx / .vrm / .blend / .maya file, you should have already clicked Extract Materials so that the Materials are not sub-assets of the model file, but actual editable Materials in the Project window.

Extract Materials

Note

For VRM 0.x, there is no option to extract Materials -- it is done automatically.


1. Set Up Character Prefab

Important Step

This is the key step for setting up a character Prefab. Choose one of the following methods to set up your character Prefab.

Before you begin, make sure there are no Missing Scripts inside the Prefab, as Unity cannot save a Prefab with missing scripts.

There are a total of 3 methods to set up a character, recommended in the order 1A > 1B > 1C. In most cases, only 1A is needed:

Method Description Recommended
1A) Non-Destructive Auto Setup Available in NiloToon 0.16.22+ Recommended
1B) Destructive Auto Setup Overwrites existing Prefab/Materials Optional
1C) Manual Setup Manually add scripts Not recommended

1A. Non-Destructive Auto Setup

[Available in NiloToon 0.16.22+]

Choose this method if:

  • You do not want NiloToon to overwrite or edit any existing Prefab or Materials
  • You want to keep the original Materials as a reference when setting up new NiloToon Materials
  • You want to convert a VRM 0.x character Prefab to NiloToon

After selecting your character's Prefab in the Project window, click:

Window > NiloToonURP > [Prefab] Create Nilo Prefab Variant and Materials

Create Nilo Prefab Variant from menu

Or right-click the Prefab in the Project window and click:

NiloToonURP > [Prefab] Create Nilo Prefab Variant and Materials

Create from right-click menu

This will not edit any of your character's existing Prefab or Materials. It only generates one new Prefab Variant and Material clones. After this setup, all items will appear as "Added files" in your version control. This means the original character Prefab and Materials remain unmodified, and a new character Prefab Variant using a new set of NiloToon Materials is created.

This setup allows you to continue updating the original character file (e.g., .vrm / .fbx files) in the future while keeping the original Prefab/Materials unmodified.

Note

After clicking, 2 pop-up windows will appear. Always click Yes & Proceed to convert the new Material clones to NiloToon.

Pop-up window 1 Pop-up window 2

If you have completed 1A, skip 1B and 1C and proceed to the 2 - Convert Materials to NiloToon section.

1B. Destructive Auto Setup

Tip

If you have already completed 1A or 1C, skip this step.

Choose this method if your original Material settings are no longer needed and you want NiloToon to overwrite the existing character Prefab/Materials.

In the Hierarchy window, select the root GameObject of the character Prefab/GameObject (a GameObject that includes all Renderers and Bones of the character, usually where the character Animator component is generated).

Select root GameObject

Click:

Window > NiloToonURP > Convert selected GameObjects to NiloToon

Convert menu

This will directly edit the character Prefab and Materials. After this setup, all items will appear as "Modified files" in your version control. The original character Shader/Material settings will be lost since NiloToon overwrites them with NiloToon Shader.

Note

After clicking, a pop-up window will appear. Always click Yes to convert the Materials to NiloToon.

1C. Manual Setup

Tip

If you have already completed 1A or 1B, skip this step. In most cases, you should use 1A/1B and can safely skip this step.

  1. Select the character's root GameObject/Prefab, then manually add the NiloToonPerCharacterRenderController script (type nilo per to find the script).

Add script 1 Add script 2

  1. Click the Auto setup this character button.

Auto Setup button

Note

After clicking, a pop-up window will appear. Always click Yes to convert the Materials to NiloToon.


2. Convert Materials to NiloToon

After performing 1A / 1B / 1C above, when the "Auto setup this character" pop-up window appears, click Yes.

Auto Setup pop-up

This will automatically handle Material and Shader conversion to NiloToon's Shader. The following Shaders are supported in the conversion:

  • URP Lit / Unlit / Complex Lit / Simple Lit to NiloToon
  • VRM Materials (VRM's MToon) to NiloToon
  • lilToon to NiloToon

3. Enable Alpha Clipping

(In most cases, you can skip this step if Alpha Clipping is already working correctly)

If the BaseMap textures have an alpha channel for Alpha Clipping but NiloToon did not enable Alpha Clipping:

Alpha Clipping issue

Click the Select all Nilo materials of this character button.

Material selection button

This will select all Materials for the character, then convert the Surface Type to a type with (Cutout) (e.g., Opaque/Outline to Opaque/Outline (Cutout)). After conversion, NiloToon character Materials will use the alpha channel of the BaseMap for Alpha Clipping.

Surface Type change

Alternatively, you can directly enable the Alpha Clipping group.

Enable Alpha Clipping group


4. Per Character Script Settings

NiloToonPerCharacterRenderController uses the character's bone structure to automatically set some fields of the script. If successful, you will see Status: All setup correct as shown in the image below.

Setup complete status

Head & Hip Bone Setup

In rare cases where the model does not have a Hip bone or Head bone, you will need to manually assign them in NiloToonPerCharacterRenderController:

  • Head & Face > Head (Transform): Assign the Head Bone.

Note

If the Prefab is not a character, you can ignore this setting.

Head Bone assignment

  • Bounding Sphere > Bound Pos (Transform): Assign the Hip Bone.

Note

If the Prefab is not a character, you can assign any Transform near the center of the Prefab as the Hip Bone.

Hip Bone assignment

Head Direction Setup

Select the character and edit Face Forward and Face Up until:

  • The 3D blue arrow follows the character face's forward direction
  • The 3D green arrow points upward

(You need to enable Gizmo in the Scene window to see the blue and green arrows)

Head Direction setup

Tip

In most cases, Auto setup handles this automatically if your character Prefab's default Transform is standard on the ground.

Direction setup example

(The above image is an example; not every character model uses the same direction setting)

Additional direction example

Bounding Sphere Setup

Edit the Bound Radius until the red Gizmo sphere tightly contains the character.

  • The smaller the Bounding Sphere, the higher the NiloToon Self Shadowmap quality
  • If the Bounding Sphere is too small to contain the whole character, areas outside the Bounding Sphere will receive incorrect NiloToon Self Shadow Map

Tip

In most cases, the default radius of 1.25M is sufficient for a normal-sized human character.

Bounding Sphere setup 1 Bounding Sphere setup 2

Face Normal Fix

NiloToonPerCharacterRenderController flattens the face's lighting normal by default (Face Normal fix = 1 by default). If your model has special normals for lighting and you do not prefer NiloToon's flattened face normal, you can set Face Normal fix = 0.

When Face Normal fix = 0, the NiloToon Shader uses the face model's original vertex normals directly for lighting without modification.

Face Normal settings

To debug face normals, use Window > NiloToonURP > DebugWindow.

Debug Window

Turn on Enable Shading Debug and check NormalWS or NormalVS.

Shading Debug settings

Face Normal comparison - fix=1 Face Normal comparison - fix=0

(Left: Face Normal fix = 1 | Right: Face Normal fix = 0)

To control Face Normal fix per material, use Is Face? > Face Normal fix.

Per-material Face Normal settings

Texture Compression Setup

Set the Base Map texture's Compression to High Quality. This step is required for the Shadow Color saturation boost feature to function correctly.

Texture Compression settings


Setup Complete

After completing all the steps above, your basic model setup is done.

Basic setup complete result

The auto-setup Materials may not be perfect. To improve the results, see the Improve Character Materials documentation.


VRoid Exported VRM

NiloToon's auto setup works correctly with .vrm files exported from VRoid Studio. The images below show the expected result:

Step 1) Export the .vrm file from VRoid Studio

VRoid Studio export

Step 2) Apply NiloToon auto setup using the steps above