In this step, we will add Ambient and Specular light to our shader script as well as create our custom lighting models.
Note
The custom lighting model is basically the function that will be used to calculate our surface shader, which is the output of the surf()
function's interaction with the lights.
The surf()
function is the function that will take any UVs or data we need as input and fill in the output structure SurfaceOutput
(the predefined structure, such as Albedo
, Normal
, Emission
, Specular
, Gloss
, and Alpha
).
Let's get started. Go to MonoDevelop, open the MyShader file, and go to the Properties
section and add the highlighted script:
Properties { _AmbientColor ("Ambient Color", Color) = (0.5, 0.5, 0.5, 1.0) _SpecularColor ("Specular Color", Color) = (0.17, 0.42, 0.75, 1.0) _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 _MainTex ("Diffuse (RGBA)", 2D) = "white" {} _BumpMap ("Bumpmap", 2D) = "bump" {} }
Next...