Sign in to follow this  
CC Ricers

Outlines with constant thickness in toon shader

Recommended Posts

I know how one form of toon shading is done for creating the outline around the models. The easier approach I've seen render the mesh again in a solid black color, extruding it some distance along its original normals, and flip the normals.

For me, this creates a passable look but it seems too "last-gen" of a look to toon shading outlines. I say last-gen because it is less shader work but on the other hand it you have to render the mesh twice and it also has this very bold, crude apperance that isn't always desirable. Close-up, the outlines of the models are very thick and the angled look is too apparent.

I would prefer clean, constant-width outlines on the models similar to that seen in Borderlands. The outlines in [url="http://cdn2.digitaltrends.com/wp-content/uploads/2011/08/borderlands.jpg"]this image[/url] are the same thickness no matter how far away something is, as comparing the character in the foreground and the tower far away in the center-right. I am almost sure there is a depth and normal comparison to check where the outlines should be drawn, but I'm not sure exactly how to draw those pixels where the contrasts in depth and normals meet. Are there any resources to for rendering this sort of style of outlines? I'm not too worried about anti-aliasing them, that can be taken care of easily with post process FXAA or something similar.

Share this post


Link to post
Share on other sites
[quote name='CC Ricers' timestamp='1343665793' post='4964541']
I am almost sure there is a depth and normal comparison to check where the outlines should be drawn, but I'm not sure exactly how to draw those pixels where the contrasts in depth and normals meet. Are there any resources to for rendering this sort of style of outlines? I'm not too worried about anti-aliasing them, that can be taken care of easily with post process FXAA or something similar.
[/quote]
You are on the right track, the basic idea is to use a pixel-based post-processing step based on depth+normals. When using a sobel filter you will have almost always 2 pixel width outlines, using FXAA to AA them helps a lot. Here's a recent thread about outlines: http://www.gamedev.net/topic/628592-cell-shading-techniques-to-consider/

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this