0
0
Unityframework~5 mins

Bloom and color grading in Unity

Choose your learning style9 modes available
Introduction

Bloom and color grading help make game visuals look more vibrant and realistic by adding glow and adjusting colors.

You want to make bright lights in your game glow softly, like sunlight or neon signs.
You want to change the overall mood of a scene by adjusting colors, like making it look warm or cold.
You want to improve the visual quality of your game to make it more appealing.
You want to highlight important objects or areas by making colors pop.
You want to create a cinematic look for cutscenes or gameplay.
Syntax
Unity
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;

public class BloomAndColorGradingSetup : MonoBehaviour
{
    public Volume volume;
    private Bloom bloom;
    private ColorAdjustments colorAdjustments;

    void Start()
    {
        if (volume.profile.TryGet<Bloom>(out bloom))
        {
            bloom.intensity.value = 1.5f; // Set bloom glow strength
        }
        if (volume.profile.TryGet<ColorAdjustments>(out colorAdjustments))
        {
            colorAdjustments.saturation.value = 20f; // Increase color saturation
            colorAdjustments.contrast.value = 10f;   // Increase contrast
        }
    }
}

You need to have a Volume component with a profile that includes Bloom and ColorAdjustments effects.

Adjust values like intensity, saturation, and contrast to get the look you want.

Examples
This makes bright areas glow more intensely.
Unity
bloom.intensity.value = 2.0f; // Stronger bloom glow
This reduces color vibrancy, making the scene look more gray.
Unity
colorAdjustments.saturation.value = -30f; // Desaturate colors for a dull look
This shifts colors to warmer tones like orange and red.
Unity
colorAdjustments.temperature.value = 10f; // Warmer color tone
Sample Program

This script sets up bloom and color grading on a volume to add a soft glow and slightly boost colors when the game starts.

Unity
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;

public class SimpleBloomColorGrading : MonoBehaviour
{
    public Volume volume;
    private Bloom bloom;
    private ColorAdjustments colorAdjustments;

    void Start()
    {
        if (volume.profile.TryGet<Bloom>(out bloom))
        {
            bloom.intensity.value = 1.2f;
            bloom.threshold.value = 1.0f;
        }
        if (volume.profile.TryGet<ColorAdjustments>(out colorAdjustments))
        {
            colorAdjustments.saturation.value = 15f;
            colorAdjustments.contrast.value = 5f;
        }
    }
}
OutputSuccess
Important Notes

Make sure your camera uses a Universal Render Pipeline (URP) asset for these effects to work.

You can tweak bloom and color grading settings in the Volume profile in the Unity Editor for quick previews.

Too much bloom or saturation can make the scene look unnatural, so adjust carefully.

Summary

Bloom adds a glowing effect to bright parts of the scene.

Color grading changes the overall colors to set mood or style.

Use Unity's Volume system to control these effects easily.