How to do it...

Our individual layers for our old film screen effect are quite simple, but when combined, we get some very visually stunning effects. Let's run through how to construct the code for our script and shader, then we can step through each line of code and learn why things are working the way they are. At this point, you should have the screen effects system up and running, as we will not be covering how to set this up in this recipe.

  1. We will begin by entering the code in our script. Our first step in modifying our script is to rename the class to match our filename, RenderOldFilm:
[ExecuteInEditMode]public class RenderOldFilm : MonoBehaviour {
  1. The first block of code that we will enter will define the variable that we want ...

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.