O'Reilly logo

Unity 2018 Shaders and Effects Cookbook by Alan Zucconi, John P. Doran

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required