Perform the following steps to create a BlinnPhong lighting model:
- First, let's remove all of the current properties with their definitions in the SubShader block. Then we need to add our own properties to the Properties block so that we can control the look of the Specular highlight:
Properties { _MainTint ("Diffuse Tint", Color) = (1,1,1,1) _MainTex ("Base (RGB)", 2D) = "white" {} _SpecularColor ("Specular Color", Color) = (1,1,1,1) _SpecPower ("Specular Power", Range(0.1,60)) = 3 }
- Then we need to make sure that we have created the corresponding variables in our CGPROGRAM block so that we can access the data from our Properties block, in our subshader:
sampler2D _MainTex; float4 _MainTint; float4 _SpecularColor; float ...