Toon shading techniques

While still toy­ing around with dif­fer­ent story ideas, I’ve spent some time on improv­ing my toon/​cel shad­ing tech­niques. At first they may look awfully clumsy and com­pli­cated because it’s a rather sim­ple thing to get a toon shaded image from just about any 3D ren­derer, nowa­days. Even pretty “ink” out­lines are no longer the prob­lem they used to be.

Yet the tech­nique I’m devel­op­ing gives the artist (in this case me!) a lot more con­trol over the look and, best of all, even major changes can eas­ily be applied long after the 3D render-​​farm has gone to sleep. Being able to setup things like color, con­trast, line thick­ness and even light­ing in post can be a huge advan­tage when you think of the alter­na­tive: Time con­sum­ing re-​​rendering!

Ink outlines

I’ll start out by show­ing you how I pro­duce out­lines around objects, much like they appear in just about any tra­di­tional 2D ani­mated work. Sadly, most 3D pro­grams don’t come with a “Make cool toon out­lines” but­ton (con­trary to what many begin­ners seem to think, judg­ing by the plethora of ques­tions regard­ing the topic on var­i­ous CG forums), so there is a lot of trick­ery going on to achieve decent results. To be hon­est I think hand-​​painted lines will always have the advan­tage in looks here.
The way I do it isn’t exactly new and has been pub­lished more than once, so I won’t be going into much detail. As you can see below, I’ve had 3Delight ren­der me an image of the scene show­ing the direc­tions the nor­mals of the sur­faces are point­ing. Feed­ing this image to an edge detec­tion fil­ter in a post-​​processing appli­ca­ton like AE or PS will result in more or less decent out­lines  — some clean­ing up and fid­dling with the set­tings is required before any­thing use­ful will come up, though.

Cel shading in post

The more clever part is get­ting the cel-​​shading onto the objects! For this I used two more images, one ren­dered with only a sin­gle direc­tional light source and lam­bert shaded objects, and an addi­tional image in which I tagged all objects with IDs, accord­ing to which “mate­r­ial” they’d belong to. For sim­plic­i­ties sake I chose to test it on two sets of spheres.

Using this sec­ond image to mask the first, one receives an image depict­ing all objects that share mate­r­ial A, while objects shar­ing mate­r­ial B have been masked out. What’s left to do now is a mat­ter of remap­ping the color ranges to cre­ate the illu­sion of cel-​​shaded objects. Sev­eral plug-​​ins are capa­ble of doing this, but for this test I worked with the “Gra­di­ent map” fea­ture in Pho­to­shop.

Putting it together

You may have guessed it… mult­ply­ing the out­lines with the cel-​​shaded objects results in a nice car­toon style pic­ture, but with the added advan­tage of being able to make adjust­ments when­ever they may become nec­es­sary. An obvi­ous prob­lem is that you are lim­ited to only a cer­tain amount of col­ors on cel-​​shaded objects, because any­thing over, say, twenty shades will become unman­age­able. Which, on the other hand, may turn out to be a plus: Tra­dional ani­ma­tion is also lim­ited to a cer­tain num­ber of col­ors per character…