How to Use Post Processing in Unity
Objective: To get started with using Post Processing in in our 2D Galaxy Shooter game in Unity!
Firstly we need to make sure that we have the package downloaded into our project. To find this, we need to go up to the top tabs in Unity and click Window → Package Manager → Post Processing → Install.
It will take some time to compile and when it is finished, within your Project window → Packages, you will now have the package.
To get started with using post processing, we need to setup a profile. Let’s create a new game object called “Post Process Volume”. This is going to control all the effects of our video game. On this game object add the component → Post Process Volume.
Two things to do from here, first let’s tick the ‘Is Global’ button so the effects are on the whole scene, and secondly, click on the ‘new’ button as this will automatically create a profile for us.
Note: You can have multiple volumes that affect different scenes. E.g. If you have a dark cave, you could use a specific post process volume in this area compared to when you are outside in a forest.
Now, we need to tell our Main Camera to render the volume effects. To do this, select your Main Camera in the Hierarchy → Add Component → Post Process Layer.
We are now met with a warning that is telling us we need to add a layer. Simply go to the top right in the Inspector, whilst on the Post Process Volume game object and create the layer and assign it to this game object:
Back on the Main Camera now, we can change the layer that it was requesting from us to ‘Post Processing’:
Now you can simply add your effects in the Post Process Volume and you can start creating some magic: