0
0
Unityframework~10 mins

Bloom and color grading in Unity - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable the Bloom effect on the Volume component.

Unity
var volume = GetComponent<Volume>();
if (volume.profile.TryGet(out Bloom bloom)) {
    bloom.intensity.overrideState = [1];
}
Drag options to blanks, or click blank then click option'
Atrue
Benabled
Cnull
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'false' disables the effect.
Using 'null' causes a compile error.
Using 'enabled' is not a valid boolean value.
2fill in blank
medium

Complete the code to set the intensity of the Bloom effect to 1.5.

Unity
var volume = GetComponent<Volume>();
if (volume.profile.TryGet(out Bloom bloom)) {
    bloom.intensity.value = [1];
}
Drag options to blanks, or click blank then click option'
A1.5f
B0.5f
C2.0f
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using integer 1 instead of float 1.5f.
Using 0.5f sets intensity too low.
Using 2.0f sets intensity higher than requested.
3fill in blank
hard

Fix the error in the code to properly set the color filter in Color Adjustments.

Unity
var volume = GetComponent<Volume>();
if (volume.profile.TryGet(out ColorAdjustments colorAdjustments)) {
    colorAdjustments.colorFilter.value = [1];
}
Drag options to blanks, or click blank then click option'
AColor(1, 0, 0)
BColor.red
C"red"
Dnew Color(1, 0, 0)
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Color(1, 0, 0)' without 'new' keyword causes error.
Using string '"red"' is invalid for Color type.
4fill in blank
hard

Fill both blanks to create a VolumeProfile and add Bloom and Color Adjustments effects.

Unity
var profile = ScriptableObject.CreateInstance<VolumeProfile>();
profile.[1](out Bloom bloom);
profile.[2](out ColorAdjustments colorAdjustments);
Drag options to blanks, or click blank then click option'
ATryGet
BAdd
CRemove
DGetComponent
Attempts:
3 left
💡 Hint
Common Mistakes
Using TryGet instead of Add does not add new effects.
Using Remove deletes effects instead of adding.
Using GetComponent is invalid on VolumeProfile.
5fill in blank
hard

Fill all three blanks to set up a Volume component with a profile and enable Bloom with intensity 2.0.

Unity
var volume = gameObject.AddComponent<Volume>();
volume.isGlobal = [1];
volume.profile = [2];
if (volume.profile.TryGet(out Bloom bloom)) {
    bloom.intensity.overrideState = true;
    bloom.intensity.value = [3];
}
Drag options to blanks, or click blank then click option'
Afalse
Btrue
Cprofile
D2.0f
Attempts:
3 left
💡 Hint
Common Mistakes
Setting isGlobal to false limits effect to local area.
Assigning null or wrong variable to volume.profile causes errors.
Using integer 2 instead of float 2.0f for intensity.