Saturday, March 8, 2008

3D made easy #4: Toon rendering in 3D max without extra plugins

Creating the toon rendered line art look is easy, and you don't need any expensive plugins to achieve this look. The following information is based on 3D studio max, but the concepts should translate to any 3d app as long as it supports user setting for surface normals. Let's start with the standard 3dmax teapot:




Now to create the main tooning line around this object, you simply create a duplicate, and apply two modifiers to it:
  1. Push polygons - to push the geometry out along the surface normals, think of it as 'inflating' the model like blowing up a bicycle tire. Apply the push modifier with a value of .25 to 3 or so, to your artistic taste. The more you push, the thicker the toon lines will be.
  2. Flip normals - to flip the normals of the copy, so that any faces originally facing the camera now point away, and vice versa
  3. Assign a flat black material to the copy


The idea is that you should now have a teapot, surrounded by a second teapot which has been puffed out at every polygon, with inverted surface normals. Now, no matter which direction you look at this object from, it will appear to be surrounded by a cartoon line.

Now for the cartoon shading material:

Click for full version 1280x640

  1. Create a new material (I called mine 'Tooning")
  2. Set the ambient, diffuse, and specular to black
  3. In the self illumination channel, add a MIX map into the map slot (image step 1.)
  4. Set color 1 in mix to black
  5. Set color 2 in mix to some color that you want for your model
  6. In the mic amount slot, select a Falloff type map
  7. In the falloff map, set the falloff Type to Shadow / Light, to make it receptive to the lighting in the scene
  8. Set the mix curve to resemble the stairstep pattern here. This will generate the toon shading effect. The widths of the bars determine the amount of shading for each coor level, the heights represent darker (lower) to bighter (higher) colors
You should end up with something like this:


You can adjust the softness of the toon areas by experimenting with the shape of the mix curve. You can add bands, have bands slightly gradiated, etc. Experimentation is always the key to figuring this stuff out.

This method, contrary to typical 3D setups, works bets with a single, or as minimal as possible, light sources.

No comments: