← Pt 1: Normals + Lines

This is documentation of my process, insights, and findings in exploring an anime look in Blender. Though not a tutorial in itself, I link to every resource and guide I found useful.


Final lighting result

Contents + Links
  1. Goals
  2. Understanding distance fields and making the texture
  3. Creating a node setup and expanding shading
  4. Conclusions

1. Goals

My goal this round is understanding what SDF/Distance Fields are and to explore how this can work for anime shading. I got this idea from this twitter thread by madumpa which tech artist Joyrok had showed me.


2. Understanding Distance Fields

Theory: Distance Fields (Part 1) by PrismaticaDev
Theory: Glyphs, shapes, fonts, signed distance fields by Martin Donald
Theory: What are SDFs Anyway? by Joyrok

This video by Prismaticadev helped me understand a distance field creates a gradient, which has values of black to white determined by its proximity to another object. This information can be used as a mask for other effects. So the closer your DF is to another mesh, the more white it is.

This video by Martin Donald and article by Joyrok helped me understand how these distance fields work on a 2D textures using "Signed" Distance Fields (SDFs). You can adjust a threshold to create a clear black and white on the texture. You can also use R G and B layers for different images.

I created a simple distance field texture to prove this out in Blender with a ColorRamp on constant to clamp the values

A zig-zag distance field on a simple ball mesh

Moving onto a mesh (another Overwatch mesh), I painted several textures at different lighting angles using Blender's Texture Paint interface.

Painting a rough idea of lighting

Results of painting 3 angles of lighting

These are combined into a single gradated texture at 33% each, and put back on the mesh. You could likely blur these together for a smoother transition but I like the control of the snapping shadows.

Making the material and testing these three textures

Creating both a texture for vertical lighting, and combining them

It is now I realize how much I didn't understand how I wanted the anime lighting to look. This method requires you to really know what you want to paint.


3. Creating a node setup and expanding shading

To create something more realized, I collected several references to figure out how I wanted to approach these shapes. There's some obvious rescency bias in the screenshots. Going into the texture paint and carving out these shapes proved to be more difficult than I expected

Top: The final painted textures on the model. Bottom: My lighting references

The hardest one to figure out was the half-way lighting for a profile view. So often in anime, profile views have a rim lighting along the face.

Instead of bringing all my individual textures out of Blender to compile into a gradated texture, I created a node system that would layer each texture on top of one another using a cascade of mixRGB nodes. This meant every time I painted a texture, I could see how it'd look in-context moving through the gradated texture. IT also means, if I want to include an extra texture at the end or in-between certain textures, I could do it live and all within Blender.

Node setup for in-Blender preview

In this final result, you can see there are harsh breaks in the transitions that are caused by subtle differences in the textures. For example, the shadow on her chin builds very jaggedy because every texture I painted that that area painted in on a slightly different spot.

Final result


4. Conclusions & Takeaways

A summary of achieving the cel-shaded look with distance fields in comparison to normal editing.

Does not rely on meshes. Easy to apply this method on any sort of mesh and forgiving to those unwilling to deal with meshes or topology.

High control over results. Complex shapes are as complicated as painting them in.

Not real lighting. It has no proper reaction to light, so doing things like multiple lighting sources, or a lighting source you didn't account for, would require a more complex node set-up.

Time-consuming to make changes. Making big changes across multiple textures requires a lot of back-and-forth painting that can end up being very time consuming for small changes.

Final Thoughts

I have to admit, I gave up on this early because I was really not enjoying the method and the results.

I wouldn't use this for my main method of 3D character cel-shading. It feels like painting my lighting onto the model which, although gives a high degree of control, is very inflexible. I can see myself using this for less important items like accessories, or even hair if I want lots of control. Perhaps even combining both methods! Normal editing for the shadow, and this gradated texture for maybe special lighting or effects.

However, for those who are reluctant or unable to learn how to deal with normals, this could be a potential solution, especially if the shapes are relatively simple.