Let's start by editing the Vertex and Fragment Shaders:
- Create a Properties block with these items in it:
Properties { _MainTex("Base (RGB) Trans (A)", 2D) = "white" {} _Colour("Colour", Color) = (1,1,1,1) _BumpMap("Noise text", 2D) = "bump" {} _Magnitude("Magnitude", Range(0,1)) = 0.05}
- Add their variables in the second pass:
sampler2D _MainTex;fixed4 _Colour;sampler2D _BumpMap;float _Magnitude;
- Add the texture information to the input and output structures:
float2 texcoord : TEXCOORD0;
- Transfer the UV data from the input to the output structure:
// Vertex functionvertOutput vert(vertInput v) { vertOutput o; o.vertex = UnityObjectToClipPos(v.vertex); o.uvgrab = ComputeGrabScreenPos(o.vertex); o.texcoord = v.texcoord; ...