Sign in to follow this  

What's the simplest method to implement "toon-style shading"?

This topic is 1107 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Sometimes it feels great to use toon-style shading. Some people prefer 2D cartoons to 3D animation animation films, but creating 2D games might sometimes be even more laborious than making 3D games. So this cartoon-style shading provides a wonderful balance.

 

But what are the specific steps to achieving toon-style shading effects? Or perhaps more accurately, since there are quite a number of difference techniques available, what is the simplest, yet visually-acceptable method? The shading style like in the game Spider-man: Shattered Dimensions, or The Walking Dead seires?

Share this post


Link to post
Share on other sites

Step 1: quantize the N dot L lighting term. Simple as: ndotl = ndotl > 0.5 ? 0.2 : 0.7; And just toy with the threshold and result values there. You can do more clever stuff - try smoothstep rather than a hard transition. You can also quantize to more colors, say 4, but I never liked  how it looks.

Step 2: Outlined edges. Take the dot product of the normal and the view vector, and if it exceeds a threshold, set the output color to black and exit.

Edited by Promit

Share this post


Link to post
Share on other sites

This topic is 1107 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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