3
$\begingroup$

Please someone show me how to achieve cell shading by using the compositor and without using ramped color materials. Since nodes are new to me it would be helpful to have a screen cap of the schematic of the node connections required and any additional information on how to set lamps and lighting if it is needed, also what should and should not be checked to allow anyone who wants to reproduce it obtain the same results. Do not refer to this link:

How to render cartoon style with completely flat colors?

This page does not make it obvious what has to be done relevant to my request, it is a dead end to a noob who wants to understand as there are so many answers but none of them seem to be about affecting an entire scene, only materials.

I happily thought how fun would it be to make some cartoons with Blender. Connecting nodes... more like like pulling hair, no tutorial I follow exactly produces the same results described even when I copy an exact demonstration there is something probably not node related that keeps it from working.

The example below shows exactly what I want, cell shading in blue, highlights in yellow that is not gradual or granular. Textures get the same treatment and if I add an entire city to this scene it will also get the same cell shading. Nothing in this scene has any ramped or toon materials.

enter image description here

$\endgroup$
  • $\begingroup$ Please include blend file? $\endgroup$ – 10 Replies Nov 21 '16 at 21:56
  • $\begingroup$ The scene was not done in Blender, but I would just make a hundred cubes and monkey heads with a few with image textures if need be. $\endgroup$ – Eric Huelin Nov 22 '16 at 0:25
7
+25
$\begingroup$

You can create both cell shadows and highlights using the "Normal" render pass. This is how such pass looks like, when enabled you can view it inside UV/Image Editor selecting the Normal pass:

enter image description here

Render the scene without shading (or with minimal shading - ambient occlusion, etc.) and add cell effects in compositor like this:

enter image description here

Quick intro into compositor can be found here. Add nodes through the menu or with Shift+A.

You change the direction of shadow and highligh with those Normal nodes.

For nice edges Full Sample Anti-Aliasing should be on (Blender Internal setting):

enter image description here

Result:

enter image description here

It is worth noting that the Normal render pass is in global space (= coordinates relative to the world) and not camera space (= coordinates relative to the camera), so camera movement will not change the shading (it will not change how the normal pass looks like).

If you need cell shading working like a MatCap material is working, you will need a custom normal pass transformed into camera space. Since compositor has no Vector Transform node it cannot do this.

The solution is to create another render layer and override all materials in it with this material:

enter image description here

Use this layer instead of the Normal pass to make the shadow and highlight relative to camera and to follow it's movement.

enter image description here

$\endgroup$
  • $\begingroup$ This is pure confusion. 1- My monkey doesn't turn multi color when I check normal when I render in passes. 2 - I see nodes with nodes in them I don't know how to make those. 3- "For nice edges Full Sample AA should be on." what's an AA? What is global space, camera space, MatCap, custom normal pass? This is so deep into jargon it is hurting my noob head. $\endgroup$ – Eric Huelin Nov 22 '16 at 15:27
  • $\begingroup$ @EricHuelin Sorry about that, I will try to explain everything and make the answer longer. $\endgroup$ – Jaroslav Jerryno Novotny Nov 22 '16 at 17:20
  • $\begingroup$ How do I make a entire scene look cell shading when I know next to nothing about nodes? Should have been my question. $\endgroup$ – Eric Huelin Nov 24 '16 at 9:28
  • $\begingroup$ @EricHuelin I added some links, if there is something still hard to understand let me know .) $\endgroup$ – Jaroslav Jerryno Novotny Nov 24 '16 at 9:56
  • 1
    $\begingroup$ @EricHuelin They are only frames used to organize nodes. You find them in Add>Layout>Frame. This cell shading does not depend on lights (it is compositor effect) and you can decide if you want the shading to follow camera or stay absolute in word coordinates. See how MatCap material works for an idea what I have in mind. If you want cell shading based on lights it is best to use cell shaded shaders directly. $\endgroup$ – Jaroslav Jerryno Novotny Nov 24 '16 at 20:16
3
$\begingroup$

I have a solution using scenes in Blender internal, although I don't see why something similar to this couldn't be made to work in Cycles.

First set up a scene with textured objects as normal, I've gone for three copies of Suzanne with different textures, and haven't put much care into texture mapping. Once your textures are set up, set all your materials to shadeless. since we're going to add cell shading in the compositor later.

Making the material shadeless

At this point your render should look something like this:

The shadeless render

Next, add a new scene with linked objects.

Adding a new scene

In this new scene, select each object, and press U to make it single user, then go to the materials tab and add a new material that is linked to the object.

Material linked to the object

This material should be simple and black and white, we're going to use this to decide where the dark areas are in the cell shading later. I made these materials entirely diffuse, and used sun as opposed to point lighting.

The second scene should look something like this when rendered. The shade image

Finally, navigate to the first layer, and enter the node view, change the node tree type to edit to "Compositing".

Set up the following nodes.

Cell shading nodes

This mixes between the output from the texture scene, and a shadow colour, depending on the black and white value of the shadow layer.

Change the value of the Greater than node to influence how large the shadows should be, and change the Add node to influence the amount that the shadow colour gets blended into the shadows.

It would be possible to use colour curves, and an "RGB to BW" node as an alternative to the "Greater Than" and the "Add" nodes. This would give more control around the sharpness of the cell shading.

My final image looked like this:

final image

Blend File here

$\endgroup$
  • $\begingroup$ Well we are half way there, all I need is to learn how to add specular shine and yellow highlights. Also how to have both layers synchronized for animation. $\endgroup$ – Eric Huelin Nov 22 '16 at 14:10
  • $\begingroup$ You could add a third scene with exclusively specular lighting, and use a similar node layout with the mix inputs reversed to add highlights. I could write this up later if you want, but hopefully that description is a suitable starting point. $\endgroup$ – Joe Nov 22 '16 at 14:14
  • $\begingroup$ Any animation added before the second scene should work with this method. I don't know how you would edit animation for both scenes simultaneously, although I feel like this should be possible. $\endgroup$ – Joe Nov 22 '16 at 14:18
  • $\begingroup$ For simplicity you can use render layers and material override instead of duplicating the scene. $\endgroup$ – Jaroslav Jerryno Novotny Nov 22 '16 at 15:08
  • $\begingroup$ What's a "material override" ? $\endgroup$ – Eric Huelin Nov 22 '16 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.