0
0
Unityframework~20 mins

Bloom and color grading in Unity - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Bloom and Color Grading Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this bloom intensity adjustment code?
Consider this Unity C# snippet that adjusts bloom intensity dynamically. What will be the final bloom intensity printed?
Unity
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;

public class BloomTest : MonoBehaviour
{
    public PostProcessVolume volume;
    private Bloom bloomLayer;

    void Start()
    {
        volume.profile.TryGetSettings(out bloomLayer);
        bloomLayer.intensity.value = 1.5f;
        AdjustBloom(2.0f);
        Debug.Log($"Bloom intensity: {bloomLayer.intensity.value}");
    }

    void AdjustBloom(float multiplier)
    {
        bloomLayer.intensity.value *= multiplier;
    }
}
ABloom intensity: 2.0
BBloom intensity: 3.0
CBloom intensity: 1.5
DBloom intensity: 0
Attempts:
2 left
💡 Hint
Think about how the intensity value changes when multiplied by the multiplier.
Predict Output
intermediate
2:00remaining
What color tint will be applied after this color grading code runs?
Given this Unity C# code snippet that modifies color grading, what will be the final color filter applied?
Unity
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;

public class ColorGradingTest : MonoBehaviour
{
    public PostProcessVolume volume;
    private ColorGrading colorGradingLayer;

    void Start()
    {
        volume.profile.TryGetSettings(out colorGradingLayer);
        colorGradingLayer.colorFilter.value = Color.white;
        ApplyTint(new Color(0.5f, 0.2f, 0.2f));
        Debug.Log($"Color filter: {colorGradingLayer.colorFilter.value}");
    }

    void ApplyTint(Color tint)
    {
        colorGradingLayer.colorFilter.value = tint;
    }
}
AColor filter: RGBA(0, 0, 0, 1)
BColor filter: RGBA(1, 1, 1, 1)
CColor filter: RGBA(0.5, 0.2, 0.2, 1)
DColor filter: RGBA(0.2, 0.5, 0.2, 1)
Attempts:
2 left
💡 Hint
The color filter is set directly to the tint color passed.
🔧 Debug
advanced
2:00remaining
Why does this bloom intensity adjustment code cause a NullReferenceException?
Examine this Unity C# code snippet. Why does it throw a NullReferenceException when run?
Unity
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;

public class BloomBug : MonoBehaviour
{
    public PostProcessVolume volume;
    private Bloom bloomLayer;

    void Start()
    {
        bloomLayer.intensity.value = 2.0f;
    }
}
AbloomLayer is never assigned and is null, so accessing intensity causes NullReferenceException.
BStart method is not called automatically, so bloomLayer is null.
Cintensity is not a valid property of bloomLayer, causing NullReferenceException.
Dvolume is null, so accessing bloomLayer.intensity causes NullReferenceException.
Attempts:
2 left
💡 Hint
Check if bloomLayer is assigned before accessing its properties.
📝 Syntax
advanced
2:00remaining
Which option correctly sets the bloom threshold to 1.2 in Unity C#?
Choose the correct code snippet that sets the bloom threshold value to 1.2 using PostProcessing bloom settings.
AbloomLayer.threshold.value = 1.2f;
BbloomLayer.threshold = 1.2f;
CbloomLayer.threshold.SetValue(1.2f);
DbloomLayer.threshold = new FloatParameter(1.2f);
Attempts:
2 left
💡 Hint
Remember that bloom threshold is a parameter with a value property.
🚀 Application
expert
3:00remaining
How many color grading settings are changed after this code runs?
This Unity C# code modifies color grading settings. How many distinct settings are changed after execution?
Unity
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;

public class ColorGradingChange : MonoBehaviour
{
    public PostProcessVolume volume;
    private ColorGrading colorGradingLayer;

    void Start()
    {
        volume.profile.TryGetSettings(out colorGradingLayer);
        colorGradingLayer.saturation.value = -20f;
        colorGradingLayer.contrast.value = 15f;
        colorGradingLayer.colorFilter.value = Color.red;
        colorGradingLayer.saturation.value = -10f;
    }
}
A1
B4
C2
D3
Attempts:
2 left
💡 Hint
Count each unique setting property changed, ignoring repeated changes to the same property.