How to do it...

Now that we have completed our scene setup and created our new script and shader, we can begin to fill in the code necessary to achieve the brightness, saturation, and contrast screen effects. We will be focusing on just the pixel operation and variable setup for our script and shader, since getting a screen effect system up and running is described in the Setting up the screen effects script system recipe in this chapter:

  1. Create a new shader by duplicating the ScreenGreyscale code by selecting it from the Project tab under the Chapter 9 | Shaders folder and pressing Ctrl + D. Once duplicated, rename the script to ScreenBSC. Then double-click on this shader to open it in your script editor.
  2. Editing the shader first makes ...

Get Unity 2018 Shaders and Effects Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.