The bloom optical effect aims to mimic the imaging effects of real-world cameras, where things in areas with lights will glow along the edges, thus overwhelming the camera. The bloom effect is very distinctive and you've likely seen it employed in areas in a game that are magical or heaven-like.
Mimicking real life with bloom and anti-aliasing
Getting ready
Make sure you have completed the Installing the Post Processing Stack recipe before starting this one.
How to do it...
- We first create a new Post Processing Profile by right-clicking within the Assets folder in the Project window and then selecting Create | Post Processing Profile. Once selected, it will allow us to rename the item. Go ahead and set the name to BloomProfile.
- Select the Post-process volume object and, from the Inspector window, go to the Post Processing Volume component and assign the Profile property to the BloomProflie we just created.
- Afterward, select the Game tab, if it hasn't been selected already to see the results of the changes we are about to make in the following steps.
- Select the Add effect... button and select Unity | Bloom. Once the effect has been added to the Overrides section of the Post Processing Volume component, select the arrow to open its properties. Check the Intensity property and set it to 3. Afterward, check and set the Threshold to 0.75, the Soft Knee to 0.1, and the Radius to 3:
- Next, select the object with the Post Process Layer component attached to it (in the example, it is the FPSController | FirstPersonCharacter object) and, from the Inspector tab, scroll down to the Post Process Layer script. From there, change the Anti-aliasing property dropdown to Fast Approximate Anti-aliasing:
- Afterward, save your scene and hit the Play button to check out your project:
How it works...
As mentioned before, bloom will make bright things even brighter while adding a glow to lighter areas. In this recipe, you may notice that the path is much lighter than it was previously. This can be used in order to ensure that players will follow the path to get to the next section of gameplay.
Anti-aliasing attempts to reduce the appearance of aliasing, which is the effect of lines appearing jagged on the screen. This is typically due to the fact that the display the player is using to play the game doesn't have a high enough resolution to be displayed properly. Anti-aliasing will combine colors with nearby lines in order to remove their prominence, at the cost of the game appearing blurry.