Skip to content

Improving Character Materials

After NiloToon's auto material conversion, the result may not always be perfect. This page explains how to improve character materials by manually editing key properties.

For basic Material UI options, see Material UI Options. For Surface Type settings, see Surface Type.


Render Face(Cull)

Render Face setting

Same as the Render Face of URP's Lit shader, the NiloToon_Character shader has a Render Face setting. The default preset is Front, so only the front face of the material is included in the Color Buffer rendering, and only the back face is included in the NiloToon Self Shadow Map rendering.

For materials on single-face meshes that need double-side rendering (e.g., a single-face skirt or cloth that should render on both sides), change the Render Face preset to Both.

Caution

If your skirt or cloth material's NiloToon Self Shadow Map looks broken or incomplete (large holes in the shadow area, or shadow is completely invisible), try setting Render Face = Both. This renders a complete shadow, solving most NiloToon Self Shadow Map issues. This occurs because the NiloToon Self Shadow Map renders Back face only by default to reduce Shadow Acne, assuming the mesh is an enclosed 3D mesh. Single-face meshes like skirts require manually setting RenderFace to Both.

Before fix: RenderFace Preset = Front (skirt shadow and back face not rendering correctly)

Before fix - Front setting

After fix: RenderFace Preset = Both (skirt shadow and back face now rendering correctly)

After fix - Both setting


Classic Outline

This is an important option. At minimum, set the Width!

Width

If you cannot see the outline, make sure Width(extra) is large enough in all your material's Classic Outline section. Width (_OutlineWidth) preserves values saved in the material by previous shaders, so the preserved Width value may not be directly usable when switching from another toon shader (e.g., RealToon/Poiyomi) to NiloToon.

Outline Width setting

You can also control width with a texture.

Controlling Outline Width with texture

It is important to hide or reduce outlines for certain areas:

Area Recommended Width
Eyes 0% - never show any outline for the eyes!
Mouth and teeth 0-20%
Hair outline artifacts 0% (highly dependent on how the 3D modeler built the hair)
Fingers 50%
Front hair 50%
Small accessories Smaller width

ZOffset

If you want to hide ugly outline artifacts, you can try increasing Classic Outline's Maskable ZOffset. Use a mask map to control where the ZOffset is applied.

ZOffset setting

If you see strange rim light lines on your material:

Rim light artifact example Rim light artifact example 2

You can enable Rim Light fix dotted line artifacts. This is slower to render but can solve the problem.

Rim Light fix option

Continuous Outline

If you still have outline problems, you can try disabling High Quality Continuous Outline (_OutlineUseBakedSmoothNormal).

Continuous Outline setting

Turning this option off ensures the outline always renders correctly, but ugly breaking outlines may appear at polygon corners (e.g., when turned off, the result looks like cube2).

Continuous Outline comparison

GuiltyGear CEDEC2024 Note

CEDEC 2024 featured a talk about improving outlines, which can be useful when setting up outline materials. NiloToon supports all features from this talk in the Classic Outline group of the material.

In summary:

  1. NiloToon_Character shader automatically adjusts outline width based on distance to camera (clamped at a certain distance to prevent overly thick outlines)
  2. NiloToon_Character shader automatically adjusts outline width based on FOV
  3. You can adjust material outline width using a 0-1 value from vertex color or texture (great for hiding eye/teeth/small object outlines)
  4. You can adjust material outline ZOffset using a 0-1 value from vertex color or texture (great for hiding bad outlines on hair, mouth, arm/leg skin, and dynamically animated cloth)

Note

The "closing outline" method at the end of the slides refers to manually reducing outline width on specific vertices to "close" the outline, preventing floating outlines. This is time-consuming and requires skill, but produces the best Classic Outline results. In practice, very few people do this because it is not easy, but if you aim for the best quality outlines, you can apply this technique to visible floating outlines.


Eyeglasses

Eyeglasses materials in NiloToon require special care because the default shadow rendering is not ideal for eyeglasses.

2D Shadow

For eyeglasses, NiloToon casts a 2D Shadow on the face by default.

Eyeglasses 2D Shadow default state

In most cases, you do not want this 2D Shadow from the eyeglasses rendered on the face. Viewers are very sensitive to any unusual shadow on the face when compared to Live2D images.

To reduce or remove the 2D Shadow cast by eyeglasses, apply the following settings in the eyeglasses material (not the face material):

  1. Enable Is Face?
  2. Set Is Face? > Face Normal fix to 0

Eyeglasses material settings

The 2D Shadow cast by the eyeglasses should then be removed or greatly reduced.

Eyeglasses 2D Shadow removed

Note

The above eyeglasses material setting treats the eyeglasses as part of the face, but since Is Face? > Face Normal fix is 0, NiloToon does not edit the eyeglasses' lighting normal. The eyeglasses will therefore cast less or no 2D Shadow while still rendering shading normally without any normal fix.

Classic Outline (Eyeglasses)

If the eyeglasses material has Classic Outline enabled, since it is now considered IsFace, the Classic Outline default ZOffset becomes larger, making some outlines invisible.

Eyeglasses outline issue

In this case, edit the eyeglasses material's Classic Outline > Maskable Z Offset > Z Offset (Face) from 0.02 to 0.0001 to make the eyeglasses outline visible again.

Eyeglasses outline ZOffset setting Eyeglasses outline fix result

Practical Tip

In practice, you will likely want to disable the Classic Outline for eyeglasses materials, or use a very small and conservative Outline Width. Viewers are very sensitive to unusual outlines on the face when compared to Live2D images.

Setting Result
Outline Width 0.1 (potentially risky) Width 0.1
Outline Width 0.05 (safer) Width 0.05
No Outline (100% safe) No outline

RimLight+Shadow 2D

For objects like hands, fingers, gloves, and small accessories, 2D rim light may not be suitable.

Rim light default issue

For materials where a thinner, non-uniform width rim light is preferred -- particularly for hands, fingers, and gloves -- we strongly recommend enabling 3D Rim masks:

  • RimLight+shadow2D > Rim Light 2D > Setting > Advanced > Rim Light 3D Rim mask

3D Rim mask setting

This produces a more natural rim light in most cases. We typically enable it at least for hands, fingers, and gloves.

3D Rim mask result 1 3D Rim mask result 2 3D Rim mask result 3


Alpha Clipping

If the BaseMap contains alpha data for alpha clipping, you can enable the Alpha Clipping toggle.

Alpha Clipping toggle

Alternatively, you can select a new Surface Type with the (Cutout) suffix.

Cutout Surface Type selection


Z Offset (Eyebrow)

Note

This step is optional and depends on the desired art style.

If the material is an eyebrow material, dragging ZOffset to approximately -0.03 or more will make the eyebrow render over the hair.

Eyebrow ZOffset setting


Shadow Color

This is an important setting!

If you are not satisfied with the default shadow color, you can control it in the Shadow Color group.

For non-skin and non-face areas:

Parameter Description
Tint Color Shadow tint color
HSV Strength HSV adjustment strength
H Hue
S Saturation
V Value (brightness)

For skin and face areas (settings highlighted in red):

Parameter Description
Color Preset Color preset
Brightness (Skin Override) Skin brightness override
Brightness (Face Override) Face brightness override

Note

  • We strongly recommend using the character's 2D art as a color reference to pick a suitable skin shadow color
  • The settings highlighted in red are only for overriding skin and face shadow color
  • The typical range for Brightness is 0.8-1

Shadow Color full settings

Usually paired with Lighting Style. See also Skin Rendering Examples and Shadow Control Volume.


Lighting Style

This is an important setting!

If you are not satisfied with the default cel style shadow, you can control the shadow style/softness in the Lighting Style group. Pick a preset to control shadow softness (e.g., for softer shadows with more gradients, pick a preset with higher softness).

Lighting Style is an important feature for achieving a softer look on materials (e.g., softer hair / skin / fur / cloth).

Default Lighting Style (Cel shade):

Cel shade style Cel shade result

Slightly softer Lighting Style (Softness-4):

Softness-4 setting Softness-4 result

Very soft Lighting Style (Softness-9):

Softness-9 setting Softness-9 result

Note

Softer shadow presets in Lighting Style are also important for producing more realistic materials.

Usually paired with Shadow Color. See also Skin Rendering Examples.


Skin Rendering Examples

Below are different combinations of Lighting Style and Shadow Color that affect skin rendering.

Caution

Be very careful when using a soft skin Lighting Style with a dark skin Shadow Color together! This combination produces results that are very "3D" and sometimes "dirty in color." This usually does not work well with kawaii / idol / anime style characters.

Skin Visual Result Visually Safe? Description
Bright Shadow Color + Cel Lighting Style Very safe. This is the default NiloToon setting and works very well for kawaii / idol / anime style female skin. For males, a darker and lower saturation Shadow Color is usually preferred. [Reference examples available]
Bright Shadow Color + Soft Lighting Style Safe but less common. Suitable for situations where a slightly sexy appeal with a non-cel style is needed. Be careful when using the Shadow Control Volume's Shadow Tint Color. [Reference examples available]
Dark Shadow Color + Cel Lighting Style Very safe. Very common for MVs and concerts in dark environments, especially useful for cool themes or higher contrast. Usually achieved by using NiloToonShadowControlVolume's Shadow Tint Color to fit the character into different environments. [Reference examples available]
Dark Shadow Color + Soft Lighting Style Danger! Avoid if you are not sure. Usually produces poor results if not controlled carefully. Generally produces bad results

Terminology Reference:

  • Bright Shadow Color = skin shadow tint color's HSV Value (V) is 0.8-1, very bright. Usually Hue (H) is near red (0), and Saturation (S) is 10-25
  • Dark Shadow Color = skin shadow tint color's HSV V is less than 0.8, or tinted by another NiloToonShadowControlVolume's dark Shadow Tint Color
  • Cel Lighting Style = Softness preset 0-4
  • Soft Lighting Style = Softness preset 5-9

2-Pass Transparent

When a single material contains both opaque and alpha blending parts (e.g., cloth, eyeglasses, hair):

Opaque and transparent mixed material

Drawing this material correctly can be difficult without special handling, since the result depends on triangle order and can vary randomly depending on the camera viewing angle.

To produce a result similar to lilToon's 2-pass transparent, you can use NiloToonRendererRedrawer or manual material appending.

Solution

  1. In the original material, set:

    • SurfaceType = Opaque(Alpha)/Outline or Transparent(ZWrite)/Outline
  2. Create a new Material Variant of the (step 1) material, and set:

    • SurfaceType = Opaque/Outline (Cutout)
    • Alpha Clipping threshold = 0.99-1
    • Edit Render Queue to be earlier (smaller/lower) than the original material from step 1
  3. Choose one of these methods:

    • Attach NiloToonRendererRedrawer to the renderer to redraw the step 2 Material Variant
    • Or manually add the step 2 Material Variant to the renderer's material list
  4. Done! The result should be similar to lilToon's 2-pass transparent.

How It Works

[First, draw the opaque parts only] The step 2 Material Variant draws only pixels with alpha ~= 1 first; any pixels with alpha < 1 are removed by Alpha Cutout.

[Then draw the remaining alpha blend parts] The step 1 original material draws as usual. Since the Depth Buffer is already filled by the step 2 Material Variant, the original material has a much higher chance of correct alpha blend drawing.

Result Has Holes

If the rendering result has holes, it is likely due to an incorrect ZTest result similar to ZFighting.

To solve this, enable ZOffset in the step 2 Material Variant to push it slightly away from the camera. This prevents most incorrect ZTest issues when the mesh is animated by tools like Magica Cloth.

Manual Material Append

If using NiloToonRendererRedrawer causes problems or is not available, you can manually append additional materials to a renderer if the target material is the last item in the material list.


Fixing Rendering Errors

If after the auto material conversion, one of the following occurs:

  • 2D Rim Light looks completely wrong (all character pixels render 2D Rim Light without occlusion)
  • URP Shadow Caster pass is missing (e.g., character cannot cast shadow on the ground)

The material may have automatically disabled some shader passes through the Unity FBX Importer or a previous shader:

  • DepthOnly pass
  • ShadowCaster pass

Enter the Debug Mode Inspector and reset the Disabled Shader Passes.

Check Disabled Shader Passes in Debug Mode Reset Disabled Shader Passes

Note

The Unity FBX Importer may disable shader passes if it considers the material to be transparent, but you may actually be using it as Opaque or Opaque(Cutout), causing 2D Rim Light issues. In this case, the material will have Disabled Shader Passes that need to be reset manually in the Debug Mode Inspector.