Diffuse shading
Before starting our journey into texture mapping, it is important to understand how diffuse materials work. Certain objects might have a uniform color and smooth surface, but not smooth enough to shine on reflected light. These matte materials are best represented with a Diffuse shader. While in the real world, pure diffuse materials do not exist; Diffuse shaders are relatively cheap to implement and find a large application in games with low-poly aesthetics.
Getting ready
There are several ways in which you can create your own Diffuse shader. A quick way is to start with the Standard Shader in Unity 5 and edit it to remove any texture, similarly to what was previously done in Chapter 1, Creating Your First Shader.
How to do it...
Let's start with our Standard Shader, and apply the following changes:
- Remove all the properties except
_Color
:_Color ("Color", Color) = (1,1,1,1)
- From the
SubShader{}
section, remove the_MainTex
,_Glossiness
, and_Metallic
variables...