Bird
Raised Fist0
Unityframework~20 mins

Shader Graph basics in Unity - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Shader Graph Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate
2:00remaining
What is the output color of this simple Shader Graph?

Consider a Shader Graph that outputs a color using a Color node set to (1, 0, 0, 1) connected directly to the Base Color input of the Master Node. What color will the shader render on the object?

AThe object will appear transparent.
BThe object will appear solid green.
CThe object will appear solid blue.
DThe object will appear solid red.
Attempts:
2 left
💡 Hint

Remember the RGBA color format where (1, 0, 0, 1) means full red, no green or blue, and fully opaque.

🧠 Conceptual
intermediate
2:00remaining
What does the 'Time' node provide in Shader Graph?

In Shader Graph, what kind of value does the Time node output and how is it commonly used?

AIt outputs the current time in seconds and is often used to create animations or effects that change over time.
BIt outputs the system clock time and is used to sync shaders with real-world time.
CIt outputs a random value every frame to create flickering effects.
DIt outputs the time since the last frame and is used to control frame rate.
Attempts:
2 left
💡 Hint

Think about how you can make a shader change smoothly as time passes.

🔧 Debug
advanced
2:00remaining
Why does this Shader Graph output a black color instead of white?

Given a Shader Graph where a Vector1 node with value 0 is connected to the Metallic input and a Color node set to white (1,1,1,1) is connected to the Base Color, but the object appears black. What is the most likely cause?

AThe shader graph is missing a connection to the <strong>Emission</strong> input, causing black output.
BThe <strong>Metallic</strong> input set to 0 causes the shader to render black.
CThe object’s material is not assigned to the mesh renderer, so it appears black.
DThe <strong>Alpha</strong> channel of the Color node is set to 0, making the object fully transparent and appear black.
Attempts:
2 left
💡 Hint

Check the alpha channel of the color input and how transparency affects rendering.

📝 Syntax
advanced
2:00remaining
Which node setup correctly blends two colors based on a mask in Shader Graph?

You want to blend Color A and Color B using a Mask node that outputs values between 0 and 1. Which node connection correctly produces the blended color?

AUse a <strong>Multiply</strong> node with Color A and Mask, then add Color B.
BUse a <strong>Lerp</strong> node with Color A as input A, Color B as input B, and Mask as the T input.
CUse an <strong>Add</strong> node to add Color A and Color B, then multiply by Mask.
DUse a <strong>Subtract</strong> node with Color B minus Color A, then multiply by Mask.
Attempts:
2 left
💡 Hint

Think about how linear interpolation (Lerp) works to blend between two values based on a factor.

🚀 Application
expert
3:00remaining
How to create a pulsing glow effect using Shader Graph?

You want to create a pulsing glow effect on an object’s emission color that smoothly changes brightness over time. Which node setup achieves this effect?

AUse a <strong>Sine</strong> node connected to the <strong>Time</strong> node’s output, then multiply the result by the base emission color before connecting to the Emission input.
BUse a <strong>Step</strong> node with Time input to create a pulsing on/off effect, then connect to Emission input.
CUse a <strong>Random</strong> node connected to Emission input to create a flickering glow.
DUse a <strong>Divide</strong> node dividing Time by a constant, then connect directly to Emission input.
Attempts:
2 left
💡 Hint

Think about how sine waves create smooth oscillations over time.

Practice

(1/5)
1. What is the main purpose of Shader Graph in Unity?
easy
A. To write complex shader code manually
B. To create shaders visually by connecting nodes
C. To design 3D models for games
D. To animate characters in Unity

Solution

  1. Step 1: Understand Shader Graph's function

    Shader Graph allows users to build shaders without writing code by using visual nodes.
  2. Step 2: Compare options with Shader Graph's purpose

    Options B, C, and D describe other tasks unrelated to Shader Graph's visual shader creation.
  3. Final Answer:

    To create shaders visually by connecting nodes -> Option B
  4. Quick Check:

    Shader Graph = Visual shader creation [OK]
Hint: Shader Graph means visual node-based shader building [OK]
Common Mistakes:
  • Confusing Shader Graph with coding shaders manually
  • Thinking Shader Graph is for 3D modeling or animation
  • Assuming Shader Graph is a text editor
2. Which of the following is the correct way to add a Color node in Shader Graph?
easy
A. Right-click in the graph and select Create Node > Color
B. Type 'color' in the console window
C. Drag a texture file into the graph
D. Use the Material Inspector to add a Color node

Solution

  1. Step 1: Recall how to add nodes in Shader Graph

    Nodes are added by right-clicking in the graph area and choosing from the Create Node menu.
  2. Step 2: Evaluate each option

    Right-click in the graph and select Create Node > Color correctly describes adding a Color node. Options A, B, and D do not add nodes in Shader Graph.
  3. Final Answer:

    Right-click in the graph and select Create Node > Color -> Option A
  4. Quick Check:

    Add nodes via right-click menu [OK]
Hint: Add nodes by right-clicking inside Shader Graph [OK]
Common Mistakes:
  • Trying to add nodes via console or inspector
  • Dragging textures instead of adding Color nodes
  • Looking for Color node outside the graph editor
3. Given this Shader Graph setup: a Color node set to red connected to the Base Color input of the PBR Master node. What color will the object appear in the game?
medium
A. Blue
B. Green
C. Red
D. White

Solution

  1. Step 1: Identify the Color node value

    The Color node is set to red, so it outputs red color values.
  2. Step 2: Understand connection to PBR Master node

    The Color node connects to Base Color input, which defines the object's visible color.
  3. Final Answer:

    Red -> Option C
  4. Quick Check:

    Base Color input = Color node output [OK]
Hint: Base Color input shows connected Color node's color [OK]
Common Mistakes:
  • Assuming default color instead of connected node's color
  • Confusing node connections and outputs
  • Ignoring the Color node's set value
4. You connected a Texture2D node to the Base Color input but the object appears white. What is the most likely error?
medium
A. The object has no mesh renderer
B. The PBR Master node is missing
C. The graph is saved but not compiled
D. The Texture2D node has no texture assigned

Solution

  1. Step 1: Analyze the Texture2D node connection

    If the Texture2D node is connected but no texture is assigned, it outputs white by default.
  2. Step 2: Check other options

    The PBR Master node is required but usually present; saving compiles automatically; mesh renderer missing would cause no rendering, not white color.
  3. Final Answer:

    The Texture2D node has no texture assigned -> Option D
  4. Quick Check:

    Unassigned Texture2D = white output [OK]
Hint: Assign textures to Texture2D nodes to avoid white output [OK]
Common Mistakes:
  • Forgetting to assign a texture to Texture2D node
  • Assuming saving is separate from compiling
  • Confusing mesh renderer issues with shader color
5. How can you create a shader that smoothly changes an object's color from blue to green over time using Shader Graph?
hard
A. Use a Time node connected to a Lerp node blending blue and green colors, output to Base Color
B. Add a Color node set to blue and animate it manually in the inspector
C. Connect a Texture2D node with a blue-green gradient texture to Base Color
D. Use a Vector1 node to switch instantly between blue and green colors

Solution

  1. Step 1: Understand color blending over time

    Smooth color change requires blending two colors based on time, which Lerp node does.
  2. Step 2: Use Time node and Lerp node

    Connect Time node output to Lerp's T input, and set Lerp's A and B inputs to blue and green colors respectively, then connect to Base Color.
  3. Step 3: Evaluate other options

    Add a Color node set to blue and animate it manually in the inspector requires manual animation, not smooth automatic change. Connect a Texture2D node with a blue-green gradient texture to Base Color uses static texture, no time change. Use a Vector1 node to switch instantly between blue and green colors switches instantly, no smooth transition.
  4. Final Answer:

    Use a Time node connected to a Lerp node blending blue and green colors, output to Base Color -> Option A
  5. Quick Check:

    Time + Lerp = smooth color change [OK]
Hint: Use Time node with Lerp for smooth color transitions [OK]
Common Mistakes:
  • Trying manual animation instead of node-based blending
  • Using static textures instead of procedural nodes
  • Switching colors instantly without interpolation
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard