With our scene, shader, and material created and ready to go, we can begin to write the code for our shader. Launch the shader by double-clicking on it in the Project tab in the Unity editor. Perform the following steps:
- As we are creating a very simple shader, we will not need to include any properties in our Properties block. We will still include a Global Color Tint, just to stay consistent with the other shaders in this book. Enter the following code in the Properties block of your shader:
Properties{ _MainTint("Global Color Tint", Color) = (1,1,1,1)}
- This next step tells Unity that we will be including a vertex function in our shader:
CGPROGRAM#pragma surface surf Lambert vertex:vert
- As usual, if we have included ...