Toon/cel shading with variable line width?

Posted by Nick Wiggill on Game Development See other posts from Game Development or by Nick Wiggill
Published on 2012-12-03T13:33:11Z Indexed on 2012/12/03 17:20 UTC
Read the original article Hit count: 340

I see a few broad approaches out there to doing cel shading:

  1. Duplication & enlargement of model with flipped normals (not an option for me)
  2. Sobel filter / fragment shader approaches to edge detection
  3. Stencil buffer approaches to edge detection
  4. Geometry (or vertex) shader approaches that calculate face and edge normals

Am I correct in assuming the geometry-centric approach gives the greatest amount of control over lighting and line thickness, as well eg. for terrain where you might see the silhouette line of a hill merging gradually into a plain?

What if I didn't need pixel lighting on my terrain surfaces? (And I probably won't as I plan to use cell-based vertex- or texturemap-based lighting/shadowing.) Would I then be better off sticking with the geometry-type approach, or go for a screen space / fragment approach instead to keep things simpler? If so, how would I get the "inking" of hills within the mesh silhouette, rather than only the outline of the entire mesh (with no "ink" details inside that outline?

Lastly, is it possible to cheaply emulate the flipped-normals approach, using a geometry shader? Is that exactly what the GS approaches do?

What I want - varying line thickness with intrusive lines inside the silhouette...

enter image description here

What I don't want...

enter image description here

© Game Development or respective owner

Related posts about 3d

Related posts about shaders