O'Reilly logo

Unity 4 Game Development HOTSHOT by Jate Wittayabundit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Shader programming – Half Lambert, Rim Light, and Toon Ramp

In this last step, we will add the last three properties, _RimColor, _RimPower, and _Ramp to get the toon shader result. The _RimColor and _RimPower properties basically control the back lighting effect of our character. The _Ramp properties will be the ramp textures that are used to calculate the lighting effect based on the angle between the light direction and surface normal of the object. We will also get the Half Lambert lighting effect to make a smooth lighting effect.

Engage thrusters

This is the last section, after which you will be able to see the result of your custom shader:

  1. Go to MonoDevelop, open the MyShader file, go to the Properties section, and add the highlighted script ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required