3D Level Design: Post Processing Profiles in Unity
In this article, we will cover how to add a global and local post processing volume and a brief overview of some of the effects you can use with the Universal Renderer Pipeline inn Unity 2020 and above.
Adding a Post Processing Volume
In the Hierarchy, add a Volume and we are going to add a Global Volume which will add it to the entire scene.
This adds the Volume to the Hierarchy and it is missing a Profile. Click on New to create a Volume Profile.
In the Main Camera, make sure to set “Post Processing” true and you can immediately see its affects when you turn on Anti-aliasing.
Anti-aliasing blends the pixels which smooths over the edges on the game objects.
In the Global Volume, we can being to add Overrides.
There are several Post-processing overrides.
I will give an overview of a few overrides and one of the biggest ones would be Bloom.
Bloom is the light spilling over from the borders of bright areas.
Below is the properties from Unity 2020 documentation.
Something to be mindful about is differentiating the different intensity levels of individual emissive objects.
Those lights are not getting the Bloom effect because the intensity of the emission levels are low.
We go to the Emission channel on the material and
adjust the Intensity of the emission, we can start to see how it interacts with the Bloom.
Shadows, Midtones, Highlights
Post process gives you plenty of color adjustment options and mixers. I am going to focus on Shadows, Midtones and Highlights.
Shadow, Midtones, and Highlights allow you to adjust the darker, mix and brighter colors in the scene and the hue of these levels.
Other Post Processing Effects
Vignette is the darkening towards the edge of the scene. It is a great option to focus the attention of player to a certain area by focusing the light to the center.
Film grain is the effect or side effect of physical particles ending up on the reel. It gives a dirtiness and griminess to the lens.
Motion blur happens when the camera moves faster than the exposure time. You can see how the scene blurs as the camera moves quickly in a direction.
Lens distortion is gives the fish eye effect by simulating the shape of the lens.
Field of Depth
Field of Depth simulates the focus properties of cameras. This will either focus in on something close and blur the rest or visa versa. Those levels and blends can be adjusted.
Chromatic Aberration separates the R,B,G colors along the edges to give a disoriented effect.
So far, we have been apply these post process effects to the entire scene but what if we want different areas to have different effects. This is where local volumes come into play.
Add a Volume to the hierarchy, and you can select from either box, sphere, or convex to create a local volume. Each option determines the shape.
These volumes are game objects with a transform and collider so you can position in the scene and detect when the player had entered the area.
We just need to create a new Volume Profile for this box volume. From here we can add the post processing effects we want for this area by adding an override.
One property I want to call out is the Blend Distance, which will determine the distance at which it will start to blend the volume the player is current in with the one where the player is entering.
If the Blend Distance is 0, it will just snap from one volume to the next without any graceful transition.
You can see below how below the Blend Distance is set to 1, so the Box Volume is gradually transition into from the Global Volume.
This is just an overview of Post-Processing using the URP pipeline. Check out the link below to the Unity 2020 documentation for all of the Post-Processing effects.
Also all of these effects and volumes with their properties can be controlled through script, which makes the possibilities endless when it comes to implementing them into your game.