Unity: Getting started with “Post Processing”
Games nowadays have many scenes where some areas are more accented than other scenes are. Take a bar sign for example. Those are mostly very bright and have lightning effects which are even noticeable behind a actual letter of the sign. This is one of the effects you can apply with “Post Processing”.
Installing the Post Processing package
In order to get started, we need to install the Post Processing package.
- Open up the Package Manager
(Window > Package Manager)
- Make sure the “Packages:” Tab at the top is set to Unity Registry
- Search for the Post Processing package
- Install the package
After the installation, Unity will re-compile some scripts. Now you should see a folder called Post Processing inside the Project view within the Packages folder.
Setting up Post Processing requirements
I. Post-Processing Volume GameObject
In order to use any Post Processing effects, we need to prepare some things first.
- Create a empty GameObject and call it “Post Processing Volume”
- Add a “Post-Process Volume” component
- Make sure to tick the “Is Global” checkbox
- You’ll get a notification saying that you have not assigned a profile for this volume. Simply create one by clicking the New button next to it.
II. UI Layer
Now that the GameObject is set up, we need to create a new UI layer in order to properly apply the post-processing effects and to actually see them.
- Select “Layer” at the top of the Inspector
- Click on “Add Layer…”
- Choose UI Layer 8 and rename it to “Post Processing”
- Switch the Post Processing Volume Layer to the Post Processing Layer
III. Setting up the Main Camera
To render the post-processing effects, we need to tell the camera to do so:
- On the Main Camera, add a new “Post-Process Layer” Component
- Click on Layer inside the Post-Process Layer component
- Select the just created “Post Processing” UI layer
Adding a post-processing effect
As everything is set up now, we can get to the fun part of messing around with the effects. To add one, simply click on the “Add Effect…” button and choose the effect you’d like to add.
For now, let’s take a look at five effects and what they do:
A very commonly used effect in games! The bloom effect adds a glow effect to light areas of the scene.
II. Color Grading
With Color Grading, you can adjust the colors of your scene; similar to how you would adjust the colors on a photo in Photoshop. For example, you can adjust Hue, Saturation, Contrast, Brightness, …
Quickly said, the Vignette effect darkens the edges of your screen or changes the color of them.
IV. Chromatic Aberration
Chromatic aberration scatters the colors of the screen. You can achieve 3D-like effects with this effect. Take a look:
V. Lens Distortion
Change the form of the in-game camera:
As you can see, Post Processing can get your game to AAA status. Even if it is an indie game with far less available money to spent! Of course, there are many more effects you can use and make your game outstanding in your own style. However, as we want to keep it simple, we stay at the quick overview for now.