Getting ready

Let's start this recipe by creating a shader and its material and importing a special texture, as follows:

  1. Start by creating a new shader; in this example, we will duplicate the one made in the previous recipe by selecting it in the Project tab and then hit Ctrl + D. We will change the name of this new shader to ToonShader.
You can rename an object in the Project window by single-clicking on the name.
  1. Create a new material for the shader (ToonShaderMat) and attach it to a 3D model. Toon shading works best on curved surfaces.
  2. This recipe requires an additional texture called a ramp map, which will be used to dictate when we want to use certain colors depending on the shade received:
  1. This book has an example texture in ...

Get Unity 2018 Shaders and Effects Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.