Using the Overlay Blend Mode with screen effects
For our final recipe, we are going to take a look at another type of Blend Mode, the Overlay Blend Mode. This Blend Mode actually makes use of some conditional statements that determine the final color of each pixel in each channel, so the process of using this type of Blend Mode requires a bit more coding to work. Let's take a look at how this is done.
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 shade:.
- Create a new shader by duplicating the
ScreenGrayscale
code and selecting it from the Project tab under theChapter 10
|Shaders
folder and pressing Ctrl + D. Once duplicated, rename the scriptScreenOverlay
, then double-click on this shader to open it in your script editor. - We first need to set up properties in our
Properties
block. We will use the same properties...