Toon Shader

Post Fx number 3! A toon shader!

Started this one off by grabbing the diffuse colour of the scene.


I then divided the post process output by it to get only the lighting.


Clamping that and taking the r channel gave me the lighting in black and white.


I used this as the uv input for a texture. At first, I used a simple texture with black at the tottom and white at the top, which made the shadows black and the highlights white.


Multiplying this with the diffuse gave us a shadow overlay.


Changing the texture’s tiling type and filter to clamp and nearest neighbor brought me closer to the toon look I was after.


But the effect was much too dark, so I multiplied the lighting output by 3 to make it lighter.


I combined it with the edge detection I setup in the last blog post and played around with brightness.


In the end I settled on this.


I wasn’t happy with the weird fuziness I was getting on the edges though. This was to do with the normal map, so I removed the normal map from the wall to get this.


There’s clearly something funky going on with the normals for the wall, but I’ve left it for now.

Here’s some final shots!



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s