How to do it...

To begin our Overlay Screen effect, we will need to get the code of our shader up and running without errors. We can then modify our script file to feed the correct data to the shader:

  1. Create a new shader by duplicating the ScreenGreyscale code and selecting it from the Project tab under the Chapter 9 | Shaders folder and pressing Ctrl + D. Once duplicated, rename the script to ScreenOverlay. Then, double-click on this shader to open it in your script editor.
  2. We first need to set up the properties in our Properties block. We will use the same properties from the previous few recipes in this chapter:
Properties {  _MainTex ("Base (RGB)", 2D) = "white" {}  _BlendTex ("Blend Texture", 2D) = "white"{} _Opacity ("Blend Opacity", ...

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.