What is Post Processing?

Definition:

Post Processing is a method or a technique that helps us to enhance the quality of images, videos, films, video games, etc. Generally, post-processing applies full-screen filters and effects to a camera’s image.

Use of Post Processing

Post Processing technique useful in

  • Photo Editing
  • Video Rendering
  • 3D Realistic Games
Post Processing Effect Example
Example of Post Processing in Photo Editing (Color grading, Blur Effect)

Post Processing in Unity?

  • In Unity, Post Processing stack Plugin is useful for applying unique image effects that directly apply to the main camera in the scene. The Post Processing stack is a key tool for the artist in unity to enhance game visual performance.
  • Most of AAA+ Games, 3D Games, VR Game, or App will use this type of Post Processing Effects.

List of Post Processing effects in Unity

  1. Anti-Aliasing
  2. Ambient Occlusion
  3. Bloom
  4. Chromatic Aberration
  5. Color Grading
  6. Depth of Field
  7. Auto Exposure
  8. Grain
  9. Motion Blur
  10. Screen Space Reflection
  11. Vignette

How to use Post Processing in Unity

  • If you are using an older version of Unity then you can download the post-processing stack from the Asset Store.
Unity Asset Store
Post Processing Effect Asset on Play store
  • In the latest version of Unity, you can access it via Package manager in the editor, this is the tested and verified version of the package.
Package Manager in Unity
Package Manager
  • You can download it from GitHub.

https://github.com/Unity-Technologies/PostProcessing


Post Processing Demo in Unity

Let’s understand every effect in detail.

Create a Unity Project

  • Open Unity hub and download the latest version of Unity
  • Create a new unity project.
  • Here we select “3D with Extra” template that by default added Post Processing Feature
  • Assign Project name and directory.
Create new Unity Project
Unity Hub – New Project
  • This is the Unity IDE
Unity Game Engine - IDE
Unity Editor

Import 3D Asset (Environment)

  • I mostly download 3D free assets from Asset Store from learning purposes Sometimes there are very useful assets available in on sale.
  • Download 3d Assets from the asset store as below.
Import 3D Asset from Unity Store
Unity Asset Store

Click on the “Import” button.

Import asset from Asset Store

Go to the scene “Map_v1” scene.

Open Map Scene

Camera and Scene Setup

  • In-Game window, Output show a black scene because there is no camera in the current scene.
  • In Hierarchy Window, add a new camera in the scene.
Camera import steps
Add camera Object in scene Add camera Object in scene
  • Set camera properties as below
    • Transform Position : x=-10,y=5,z=0
    • Transform Rotation : x=0,y=125,z=0
Texture problem demo
Texture Problem

Sometimes texture or lighting not perfect as it shows in the Asset image. It happens when we change the unity version.

So we need to bake the current scene again.

Unity performs the calculations for Baked Lights in the Unity Editor, and saves the results to disk as lighting data. This process is called baking.

  • Go to the Lighting settings. [Window menu > Rendering > Lighting Settings]
  • Go to the Debug settings component in the lighting settings window.
  • Click on the “Generate Lighting” button.
Baking Process in Unity
Lighting Baking Process

How to Apply Post Processing Effects

  • you can find post-processing components in Rendering Category as below
Rendering Category

Post Processing Components

  • Post Process Volume is a special type of volume that can be added to a scene. These volumes are manipulate post-processing parameters.
  • Post Process Layer will apply on the scene camera for full-screen effects.
  • Post-Process Debug

  • Click on the camera and go to the Inspector window.
  • Click on the “Add Component” button and add the Post-Process Layer component.
Post Process Layer in Unity
  • In the Layer property, select “Post Processing” in that Drop down list.
  • Select anti-aliasing mode from the list. (FXAA or SMAA)

Anti Aliasing

  • Anti Aliasing is a software technique for decreased “staircase effect” or “jaggies“.
  • Types of Anti Aliasing
    • FXAA, short for “fast approximate anti-aliasing,” was created by Nvidia, and it is probably the best anti-aliasing method for low-end PCs.
    • Other Types – SMAA, TXAA, DLSS.
  • In the Hierarchy window, click on the + button and add an empty game object in the scene
  • Rename this game object to “PostProcessingVolume“.
  • Click on PostProcessingVolume object and then add the Post-process volume component in the Inspector window as below.

HERE,

  • Is Global: if checked, post-processing applies on every layer (whole scene).
  • Weight: set to 1.
  • Priority: set priorities between more than one volume.
  • Profile: a profile means which effects we use in this volume.

How to create a Post Process profile in Unity

  • In the Inspector Window, click on the “New” button of the profile property.
  • The new profile is created in the folder that has the same name as the current scene.
  • Click on the Add Effect button and add post-processing effects in the current volume.
  • Change layer of PostProcessingVolume Object as below.

Let’s check out every effect of Post Processing in unity.

Post Processing Effects

Ambient Occlusion

Ambient Occlusion is a shading and rendering technique used to calculate how exposed each point in a scene is to ambient lighting.

It will make the scene more realistic via adding depth in the shadow part as below example.

Set ambient occlusion properties as below.

Ambient Occlusion Property

More Info: https://docs.unity3d.com/Packages/[email protected]/manual/Ambient-Occlusion.html


  • Click on the camera object in the Hierarchy window.
  • In the Inspector window, Add the Post-Process Debug component to the camera object.
  • Assign camera object to Post Process Layer field because we added Post Process Layer in Camera Object

Post-Process Debug will be useful to see how the Post Processing effects working in the scene.

  • Set the Debug Overlay from None to Ambient Occlusion.
  • Here, the black part shows the Ambient Occlusion Effect.

Auto Exposure

Example

Bloom

The Bloom effect creates fringes of light extending from the borders of bright areas in an image, contributing to the illusion of an extremely bright light overwhelming the Camera.

  • Add Bloom effect in the Post-Process Volume component.
Bloom Effect Properties
  • Import downloaded Texture to the unity project.
  • Assign this texture file to the Texture property of the Bloom Effect of Post-Process Volume

Example :

More Info Bloom Effect:https://docs.unity3d.com/Packages/[email protected]/manual/Bloom.html


chromatic aberration

Chromatic Aberration is a visual effect that creates when the camera lens fails to focus all color wavelengths to the same point and, the result is like a game with 3D glasses. It’s also known as “color fringing” or “purple fringing”.

The performance of the Chromatic Aberration effect depends on the Intensity value. If the Intensity value set high, the render will be slower as it will need more samples to render smooth chromatic aberrations.

Enabling Fast Mode is recommended where possible as it’s a lot faster, but not as smooth as the regular mode.

  • Set properties of the Chromatic Aberration component as below.
  • Disable Bloom effect.

What is LUT?

A Look-Up Table (LUT) is a mathematically precise way of taking specific RGB image values form a source image – and modifying them to new RGB values by changing the hue, saturation, and brightness values of that source image.

  • Download Spectral Lut file from GitHub:

https://github.com/Unity-Technologies/experimental-ARInterface/tree/master/Assets/TanksNetworkingAR/PostProcessing/Textures/Spectral%20LUTs

  • Import Lut file & Assign it in chromatic Aberration Property.

Example:


Color Grading

Color grading is the process of altering or correcting the color of the final image. 

Property:Function:
Post ExposureAdjusts the overall exposure of the scene in EV units. This is applied after HDR effect and right before tone mapping so it won’t affect previous effects in the chain.
TemperatureSets the white balance to a custom color temperature.
TintSets the white balance to compensate for a green or magenta tint.
Hue ShiftShift the hue of all colors.
SaturationPushes the intensity of all colors.
ContrastExpands or shrinks the overall range of tonal values.
 The Channel Mixer is used to modify the influence of each input color channel on the overall mix of the output channel. 

More about Color Grading: https://docs.unity3d.com/Packages/[email protected]/manual/Color-Grading.html

Example :

Here, we change the properties of color grading as below example.


Depth of Field

Depth of Field is a post-processing effect that adjusts j focus point of the camera. In reality, the camera can only focus on an object at a specific distance.

So if you want to add some depth effect in scenes like bokeh effect in photos then Depth of Field effect is very useful.

Example:


Grain

Grain effect will generate small particles on camera lenses like noise or unprocessed image.

The Grain effect is based on a coherent gradient noise.

Properties

PropertyFunction
ColoredEnable the checkbox to use colored grain.
IntensitySet the value of the Grain strength. Higher values show more visible grain.
SizeSet the value of the Grain particle size.
Luminance ContributionSet the value to control the noisiness response curve. This value is based on scene luminance. Lower values mean less noise in dark areas.
Properties of Grain Effects
  • Add Grain Effect in Post Process Volume Component.
  • set grain effect properties as below.


Example :


Lens Distortion

In photography, distortion is generally referred to as an optical aberration that deforms and bends physically straight lines and makes them appear curvy in images.

Lens Distortion effect is useful to create effects like FISH EYE, Sniper Scope Zoom Effect.


Motion Blur

The Motion Blur effect blurs an image when GameObjects are moving faster than the camera’s exposure time.

Motion blur doesn’t support AR/VR.

PropertyFunction
Shutter AngleSet the angle of the rotary shutter. Larger values give longer exposure and a stronger blur effect.
Sample CountSet the value for the number of sample points. This affects quality and performance.

If the game character moves faster than the camera , it creates blur effects.

Example: Car Racing Game – Need for Speed


Screen Space Reflection 

The Screen Space Reflection effect creates subtle reflections that simulate wet floor surfaces or puddles.

Example:


Vignette

The Vignette effect darkens the edges of an image, so the center part of the image looks brighter.

Vignette effect is a very famous effect in Photography and Film editing.

Properties

PropertyFunction
ColorSet the color of the Vignette.
CenterSet the Vignette center point (screen center is [0.5,0.5]).
IntensitySet the amount of vignetting on screen.
SmoothnessSet the smoothness of the Vignette borders.
RoundnessSet the value to round the Vignette. Lower values will make a more squared vignette.
RoundedEnable this checkbox to make the vignette perfectly round. When disable, the Vignette effect is dependent on the current aspect ratio.

Example:

Summary

In this article, you learned about different effects of Post Processing in Unity and how to apply those effects in unity.