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 blending 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 needs a bit more coding to work. Let's take a look at how this is done in the next few recipes.
Getting ready
For this last Screen Effect, we will need to set up our two scripts as we have in the previous recipes in this chapter. For this recipe, we will be using the same scene we have been using, so we don't have to create a new one:
Create a new script file called
Overlay_ImageEffect
and shader file calledOverlay_Effect
.Copy the code from the previous C# script file to our new script file.
Copy the code from the previous shader file to our new shader file.
Assign the
Overlay_ImageEffect
script to the main camera andOverlay_Effect
to the script component in the Inspector...