Making it shine like a pro!
Post processing in Unity is the processes used to add effects and adjustments to the rendered output of your game before the final image is displayed. I like to think of this process as being like adding filters to an image in photoshop to get different effects like adding grain to the image or adjusting the colors. Today we’ll take a brief look at what it takes to set up and apply post processing to our game.
First things first! We need to install the post processing package from the Unity package Manager. We can do this using the following steps.
- Navigate to Window > Package Manager
- Select “Unity Registry” from the drop-down at the top of the package manager screen
- Search for “Post Processing”
- Install the package
Once installed Unity will add a Post Processing folder to your Packages folder.
Now that we have post processing installed, let’s set it up in our scene. We need to create an empty game object to attach our Post Processing Volume component to, let’s call it “Post Processing Volume” to keeps things clear for ourselves. Let’s add the Post Processing Volume Component and make sure to set the “Is Global” flag to checked so that it affects our entire project.
We should receive a message that we need to assign a profile to our newly created Post Processing Volume. To resolve this, we can simply click the New button next to the Profile slot in the inspector and Unity will create one for us.
For our effects to show up in our rendered game we need to supply a layer for the effects to render to.
- Select Add Layer… from the Layer menu displayed just below the name of our Post Processing Volume object in the inspector.
- Type “Post Processing” into one of the User Layers displayed that isn’t in use.
- Back in our Post Processing Volume object in the inspector, use the Layer drop-down to now select our new Post Processing Layer
The last step before we start adding effects to our game is to add the Post Processing Layer that we just created to our main camera.
- Select the Main Camera
- Add a new “Post-Process Layer” Component to it
- Set the Layer property in the Post-Process Layer component to our Post Processing layer
With that, we can simply click “Add Effect…” button on the Post-process Volume component attached to our Post Processing Volume game object and choose from the available effects provided in the package for us. They include
I chose to use Bloom to add some glow and intensity to the light areas of my game, and Color Grading to adjust the colors after the other effects, and give the game a slightly darker feel.
That’s it for today! Next time, we’ll look at bringing our game to life and adding a more immersion by adding sound! If you enjoyed this article, or want to come along with me as I progress on my journey, follow me at gamedevchris.medium.com.