Using the Unity Post Processing V2 Package
The Post Process V2 package in Unity allows the application of image processing effects after the Camera draws the scene but before the scene is rendered on the screen. Done proper post-processing can significantly improve the visuals of the project but can also be very resource-heavy.
Post Process Layer
To start using post-processing, download the Post Processing V2 Package from the Package Manager. Window>Packager Manager>Post Processing
Next, add a Post Process Layer component to the Camera that you want to have the effects. The Post Process Layer component allows you to configure Anti-aliasing, Layer, and the Trigger object for the post-process volumes. Then assign the Layer to PostProcessing (may need to make the Layer). The Layer is what tells the Camera where the post-processing is applied.
Post Process Volume
The next thing that is needed is a Post Process Volume in the scene for the Trigger to enter (if not set to Global). Then set the Layer to PostProcessing, turn on Is Global, and create a new Profile.
The Post-process Volume component controls each volume’s priority and blending with the Weight and Priority properties. On the Post-process Volume adding effect overrides will enable you to make settings unique to that volume.
You can add the Post-process Volume component to any GameObject, including the Main Camera GameObject. However, the optimal way to use this component is to create a dedicated GameObject for each volume.
Post Process Effects
Once the post-processing Profile is added to the Post-process Volume component, you can add post-processing effects to the scene by either adding them to the Profile or as Overrides on the Post-process Volume.
Ambient Occlusion
Ambient Occlusion adds shadows to areas that are not directly affected by ambient light, like creases, corners, holes, and spaces between objects that are close together.
The Ambient Occlusion has two modes:
Scalable Ambient Obscurance: This is a standard implementation of ambient obscurance that works on older platforms. Scalable Ambient Obscurance should not be used on mobile platforms or consoles, as the Multi-scale Volumetric Occlusion mode is faster and provides better graphics for these platforms.
Multi-scale Volumetric Occlusion: This mode is optimized for consoles and desktop platforms. It has better graphics and runs faster than Scalable Ambient Obscurance on these platforms but requires compute shader support.
Anti-aliasing
The Anti-aliasing effect helps eliminate the jagged edges of objects in your scene by surrounding the perimeter with pixels of similar color.
Anti-aliasing has three modes:
Fast Approximate Anti-aliasing (FXAA) Is a fast algorithm for mobile and platforms that don’t support motion vectors.
Subpixel Morphological Anti-aliasing (SMAA) Is a high-quality but slower algorithm for mobile and platforms that don’t support motion vectors.
Temporal Anti-aliasing (TAA) Is an advanced technique that requires motion vectors. Ideal for desktop and console platforms.
Auto Exposure
Auto Exposure simulates the way the human eye adjusts to changes in light levels. Like when walking into a brightly lit room from a dark one. The effect changes the exposure of the rendered image to match the mid-tone to simulate this.
Bloom
Bloom makes the image’s bright areas glow by creating fringes of light that extend from the bright spots.
Chromatic Aberration
The Chromatic Aberration effect breaks the image into the red, green, and blue channels along the edges of objects in the scene. It is often used for drunk effects in games.
Color Grading
The Color Grading effect works much like a photo editing program. It can change the saturation, hue, and luminance of the final image that is rendered. Color Grading is where the magic happens. It can change the look and feel of the game and make a scene pop.
The Color Grading effect comes with three modes:
Low Definition Range (LDR): Ideal for lower-end platforms. Grading is applied to the final rendered frame clamped in a [0,1] range and stored in a standard LUT.
High Definition Range (HDR): Ideal for platforms that support HDR rendering. All color operations are applied in HDR and stored in a 3D log-encoded LUT to ensure sufficient range coverage and precision.
External: For use with custom 3D LUTs authored in external software.
Deferred Fog
The Deferred Fog effect simulates haze and desaturation caused by the atmosphere when looking at objects at a distance. It is also often used for fog or mist outdoors to hide the clipping of objects in the scene to improve performance.
Depth of Field
The Depth of Field effect blurs objects in the foreground or background of the image compared to the focal point. The blurring is used to draw the viewer’s focus to the object or area that the focal point is set.
Grain
The Grain effect overlays coherent gradient noise onto the final image. The noise gives your game a gritty effect, much like an old TV or VHS tape.
Lens Distortion
The Lens Distortion effect applies distortion to the image simulating the shape of a real-world camera lens. This distortion allows you to get many results, like a fish-eye or wide-angle lens look.
Motion Blur
The Motion Blur effect blurs the image in the direction of the Camera’s movement. This Motion Blur simulates the blur effect a real-world camera creates when it moves while taking a picture.
Screen Space Reflections
The Screen Space Reflection effect creates realistic reflections since it reflects both static and dynamic Objects. Screen Space Reflections can be very resource-heavy.
Vignette
The Vignette effect darkens the edges of the screen. The Vignette effect is used to draw attention to the center of an image. You can also use it to show a character’s health by changing the color or image used in the Vignette.
With this brief overview of how to use the Post-processing package and its different effects, you can start making your projects stand out. For more information, you can look at the complete documentation for the Unity Post Process V2 Package.