Locating and modifying shader light models

When we have created shaders so far, we have relied on the default template that Unity provides and is easily accessible in the Assets panel.

Let's start here and identify the part of the shader that handles scene lighting.

We will start by creating a default shader:

  1. In the Project panel, click on the PACKT_Shaders folder to view its contents in the Assets panel.
  2. In an empty area of the Assets panel, create a new default shader. Right-click and navigate to Create | Shader | Standard Surface Shader from the drop-down list.
  3. Rename the shader TestLambert.
  4. Double-click on the new shader to open it in MonoDevelop.
  5. In MonoDevelop, replace the first line with the following code:
                Shader "PACKT/TestLambert" ...

Get Mastering Unity Shaders and Effects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.