O'Reilly logo

Unity 3 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—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 light direction and surface normal of the object.

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.shader file, and go to the Properties section and add the highlighted script as follows:
    Properties { _MainTex ("Texture", 2D) = "white" {} _BumpMap ("Bumpmap", 2D) = "bump" ...

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