Applying Custom Normals to Avatars

Control the lighting of your avatar's face the quick and lazy way.

Introduction

If you've ever disliked the way your cartoon or anime-styled avatar looks under certain lighting conditions then you may be dealing with the dreaded blob face! Cartoon and anime faces were never meant to be lit the way they're shaped, so ugly shadows from the nose, lips and recesses of the eyes give away the fact that you're looking at a 3D model and not an illustration.

A model's lighting conditions are calculated using its vertex normals, which is the outward-facing direction of a vertex. But we can manipulate these vertex normals to change the way the model is shaded however we want! Many Booth models are already using this technique, but for those that aren't or for models sourced outside of Booth that do not have the technique applied, this guide is a crash course on the quickest and laziest way to apply "good enough" custom normals to a model.

This guide assumes you already have and know how to use Blender, though not to a great extent. This isn't something you can do directly in Unity yet (as far as I know).


"Torahime", Custom Normals

Getting Prepared

This will only work in versions of Blender from 2.8+. The add-on we're going to use, Abnormal, doesn't support 2.79. If you're still hanging on to Blender 2.79, give Blender 3.0 a try! It's greatly improved and the learning curve shouldn't be any steeper than before.

github.com/bnpr/Abnormal

addon ui.png

This is the official normal-editing Blender add-on of the Blender NPR (non-photorealistic rendering) community. It has a slightly unusual interface, but we'll only need a few buttons. Download a .zip file from the releases page. Note that as of the time I wrote this tutorial, I was using Abnormal 1.1. The interface has completely changed since then. I don't yet have time to update this tutorial for the new interface.

github.com/bnpr/Abnormal/releases

Navigate to Edit -> Preferences, then to the Add-ons tab.

preferences.png

Click the Install button, then navigate to the .zip file you downloaded and select it. Install the add-on and it should appear automatically. Check the box for Abnormal.

install.png

enable abnormal.png

If Abnormal is correctly installed, it will appear in the right-side panel (open with the arrow or by pressing N).

access abnormal.png

Now you just need a model to work with. If you're lucky, the model you're using may come with a .blend file that is easy to open. If you're using a Booth model or other model that isn't in .blend format, import it! It'll usually be in .fbx format, and Blender can import those just fine.

import.png

Crash course Vertex Group painting

We need to tell Abnormal which vertices to influence and which ones not to. Abnormal uses vertex groups for this. Vertex groups are normally used for rigging and skinning models, in a process called "weight painting", but they can be used for anything else and in this case we won't be needing them for anything too complicated.

If your model is already separated into parts, hide the parts that obscure the head and face to make it easier to work with. In Edit Mode, select the head mesh using Select Linked either by selecting a single vertex and navigating to Select -> Select Linked -> Linked or by hovering over part of the model and pressing L.

Invert your selection with Ctrl+I or by navigating to Select -> Invert. Parts of the model that we don't want to apply custom normals to -- eyelashes, pupils, eyebrows etc -- should now be selected, but if not, refine your selection by selecting more linked parts with L or deselecting parts you don't want to hide with Shift+L. In the video I also hide the connected inside part of the mouth.

Hide these selected parts with H (or Mesh -> Hide).

Now switch to Weight Painting mode. Create a new Vertex Group and call it "Custom Normals". Make sure X-mirror is on but "Mirror Vertex Groups" is not -- this means we'll only have to do half of the work. Make sure "Auto-Normalize" is off.

x mirror.png

auto normalize.png

Enable the "Paint Mask" checkbox next to the mode selector. Everything you hid in Edit Mode should now be hidden. Press A to select everything that is visible.

Paint the front of the face and be careful not to paint other parts of the head. If your model has concave eyes, which anime models usually do, you can also paint the sclera, as we want the sclera to be lit the same way as the face to give a two-dimensional appearance.

Use the blur tool to smooth the edges of what you've just painted. For working with vertex groups and for weight painting, the blur tool is your best friend. Once you're done, it should look something like this:

painted.png

Custom Normals 1: "Flat" Face

The simplest way to apply custom normals to a face is to flatten them, giving the face the appearance that it is a flat surface that is uniformly lit.

Select your head/face mesh and open the right-side panel (press N). Under the Abnormal tab, there is a drop down selector that should show a list of your mesh's vertex groups. Select the "Custom Normals" vertex group we created earlier.

Start Abnormal with the "Start Normal Editor" button. Every vertex should already be selected, and you'll see long pink lines in every direction representing the directions of the normals.

Under "Align to Axis", press the -Y button. This aligns the normals of the face to negative on the Y axis (forward) in just one click. The shading of your face should now appear completely flat. This already looks pretty good in most cases, but we can do more.

Custom Normals 2: "Cylinder" Face

Shading the face cylindrically is slightly more advanced but still a simple and lazy process.

Select your head/face mesh and open the right-side panel (press N). Under the Abnormal tab, there is a drop down selector that should show a list of your mesh's vertex groups. Select the "Custom Normals" vertex group we created earlier.

Start Abnormal with the "Start Normal Editor" button. Every vertex should already be selected, and you'll see long pink lines in every direction representing the directions of the normals.

Select "Sphereize Normals" and then "Confirm Sphereize" to apply. The normals of the face will appear spherical. Under "Flatten Normals on Axis", press just the Z button. "Confirm Changes" under the "Finish Modal" panel. The shading of the face now already appears cylindrical, but we should refine it further.

Select the "Custom Normals" vertex group you created and make a copy of it. In Weight Painting mode, enable "Paint Mask" and select everything again. Use the Weights -> Levels tool with a gain value of 0.5 to halve the influence of the copied vertex group.

Back in Object Mode, open the Abnormal panel again and use the drop down to select your copied Custom Normals group. Enter Abnormal and under "Flatten Normals on Axis", press the X button. With our copied vertex group, this only half-influences the selected normals, flattening them out on the X axis only a little bit.

The shading of the face now has the appearance of a larger cylinder with a larger surface.

Custom Normals 3: "Two Halves" Face

Select your head/face mesh and open the right-side panel (press N). Under the Abnormal tab, there is a drop down selector that should show a list of your mesh's vertex groups. Select the "Custom Normals" vertex group we created earlier.

Start Abnormal with the "Start Normal Editor" button. Every vertex should already be selected, and you'll see long pink lines in every direction representing the directions of the normals. It's kind of hard to see what we're doing, so this time let's reduce the Normals Length (right-side panel) down to a reasonable size, like 0.03-0.04.

Under "Align to Axis", press the -Y button. The shading of your face should now appear completely flat. We're going to select one half of the face, but to do that we need a good view of it. Force an orthographic front view by clicking the corresponding axis in the top-right corner (-Y). Now deselect everything (Alt+A) and then Box Select (B) one half of the face. Don't select the center column of vertices. Enable Mirror Axis on the X axis. With one half of the face is selected, use the gizmo to rotate that side of the face away on the Z axis (blue).

The face should now have two flat shaded halves. Disable Mirror Axis. The crease in the middle is a little sharp, but we can simply select everything (A) and apply Smooth Selected Normals with a desired Smooth Strength and Smooth Iterations. A strength of 1.0 with the default 5 iterations is usually enough.