With our scene ready to go, let's double-click on our newly created shader to open it in the code editor:
- Let's begin with our shader and populate the Properties block:
Properties { _MainTex ("Base (RGB)", 2D) = "white" {} _tintAmount ("Tint Amount", Range(0,1)) = 0.5 _ColorA ("Color A", Color) = (1,1,1,1) _ColorB ("Color B", Color) = (1,1,1,1) _Speed ("Wave Speed", Range(0.1, 80)) = 5 _Frequency ("Wave Frequency", Range(0, 5)) = 2 _Amplitude ("Wave Amplitude", Range(-1, 1)) = 1}
- We now need to tell Unity that we are going to be using a vertex function by adding the following to the #pragma statement:
CGPROGRAM#pragma surface surf Lambert vertex:vert
- In order to access the values that have been given to us by our properties, ...