In order to make our grayscale screen effect work, we need a script and shader. So, we will complete these two new items here and fill them in with the appropriate code to produce our first screen effect. Our first task is to complete the C# script. This will get the whole system running. After this, we will complete the shader and see the results of our screen effect. Let's complete our script and shader with the following steps:
- Open the TestRenderImage.cs C# script and begin by entering a few variables that we will need to store important objects and data. Enter the following code at the very top of the TestRenderImage class:
#region Variablespublic Shader curShader;public float greyscaleAmount = 1.0f;private Material ...