0
0
Unityframework~20 mins

Post-processing effects in Unity - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Post-processing Mastery
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 Unity C# script snippet?

Consider this Unity C# script that applies a simple color grading effect using the Post-processing stack. What will be the color of the pixel after applying this effect?

Unity
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;

public class SimpleColorGrading : MonoBehaviour
{
    public PostProcessVolume volume;
    private ColorGrading colorGrading;

    void Start()
    {
        colorGrading = ScriptableObject.CreateInstance<ColorGrading>();
        colorGrading.enabled.Override(true);
        colorGrading.saturation.Override(-100f); // desaturate completely

        volume = PostProcessManager.instance.QuickVolume(gameObject.layer, 100f, colorGrading);
    }

    void OnDestroy()
    {
        RuntimeUtilities.DestroyVolume(volume, true, true);
    }
}
AThe scene colors will be inverted (negative colors).
BThe scene colors will appear in full color with no change.
CThe scene colors will be completely black and white (grayscale).
DThe scene colors will be brighter with increased saturation.
Attempts:
2 left
💡 Hint

Think about what setting saturation to -100 does to colors.

🧠 Conceptual
intermediate
1:30remaining
Which post-processing effect is best for simulating camera lens blur?

In Unity's post-processing stack, which effect is primarily used to simulate the blur caused by a camera lens focusing on a subject?

ABloom
BChromatic Aberration
CVignette
DDepth of Field
Attempts:
2 left
💡 Hint

Think about which effect controls focus and blur based on distance.

🔧 Debug
advanced
2:30remaining
Why does this custom post-processing effect script cause a runtime error?

Examine the following custom post-processing effect script snippet. Why does it cause a runtime error when applied?

Unity
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;

[System.Serializable]
[PostProcess(typeof(CustomEffectRenderer), PostProcessEvent.AfterStack, "Custom/Effect")]
public sealed class CustomEffect : PostProcessEffectSettings
{
    public FloatParameter intensity = new FloatParameter { value = 0.5f };
}

public sealed class CustomEffectRenderer : PostProcessEffectRenderer<CustomEffect>
{
    public override void Render(PostProcessRenderContext context)
    {
        var sheet = context.propertySheets.Get(Shader.Find("Hidden/CustomEffectShader"));
        sheet.properties.SetFloat("_Intensity", settings.intensity);
        context.command.BlitFullscreenTriangle(context.source, context.destination, sheet, 0);
    }
}
AThe shader "Hidden/CustomEffectShader" is missing or not included in the project, causing Shader.Find to return null.
BThe intensity parameter is not initialized properly, causing a null reference exception.
CThe PostProcess attribute is missing the required 'renderer' parameter.
DThe Render method is missing a call to base.Render(context), causing the effect not to render.
Attempts:
2 left
💡 Hint

Check if the shader used in Shader.Find exists and is included in the build.

📝 Syntax
advanced
2:00remaining
Which option correctly enables and configures the Vignette effect in Unity's Post-processing stack?

Choose the code snippet that correctly enables the Vignette effect and sets its intensity to 0.4.

A
vignette.enabled.Override(true);
vignette.intensity.Override(0.4f);
B
vignette.enabled.Set(true);
vignette.intensity.Set(0.4f);
C
vignette.enabled = new BoolParameter(true);
vignette.intensity = new FloatParameter(0.4f);
D
vignette.enabled = true;
vignette.intensity = 0.4f;
Attempts:
2 left
💡 Hint

Remember how to set override values on PostProcessEffectSettings parameters.

🚀 Application
expert
3:00remaining
How to combine Bloom and Chromatic Aberration effects for a glowing and color-fringing look?

You want to create a glowing effect with color fringing around bright areas in your Unity scene. Which sequence of steps correctly applies Bloom and Chromatic Aberration post-processing effects to achieve this?

AEnable Chromatic Aberration with moderate intensity, then enable Bloom with high intensity; apply Bloom before Chromatic Aberration in the post-processing stack.
BEnable Bloom with high intensity and threshold, then enable Chromatic Aberration with moderate intensity; apply Chromatic Aberration after Bloom in the post-processing stack.
CEnable Bloom with high intensity and threshold, then enable Chromatic Aberration with moderate intensity; apply Bloom after Chromatic Aberration in the post-processing stack.
DEnable Chromatic Aberration with high intensity, then enable Bloom with moderate intensity; apply Chromatic Aberration after Bloom in the post-processing stack.
Attempts:
2 left
💡 Hint

Consider the order of effects in the stack and how Bloom and Chromatic Aberration visually combine.