CodeBlanks Logo Icon CodeBlanks

Summary - Shader

Reinforce shader usage with a summary task.

Summary: Shader Architecture

In this group, you explored the core shader architecture: programs running in parallel on the GPU, visual creation with Shader Graph, automated lighting in Surface Shaders, parameter exposure via Properties, and the Vertex/Fragment pipeline.

Shader "Custom/FullReview"
{
    Properties { _Color ("Color", Color) = (1,1,1,1) }
    SubShader {
        // Vertex and Fragment passes
    }
}

Selecting the right shader architecture establishes your game's visual fidelity while optimizing its performance budget.

Practice Shader system review

Define a Start method. Inside, declare string shaderAdi = "Custom/SurfaceShader"; and print "Shader yuklendi: " + shaderAdi to the console.

Starter code

Player.cs
using UnityEngine;

public class ShaderSummary : MonoBehaviour
{
    // Start icinde shaderAdi tanimla ve yuklendi mesajini yazdir
}

Sample solution

Player.cs
using UnityEngine;

public class ShaderSummary : MonoBehaviour
{
    void Start()
    {
        string shaderAdi = "Custom/SurfaceShader";
        Debug.Log("Shader yuklendi: " + shaderAdi);
    }
}

Expected output

Shader yuklendi: Custom/SurfaceShader

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 Which of the following correctly describes the data processing sequence in a graphics pipeline?

  • Vertex Shader -> Rasterization -> Fragment Shader Correct answer
  • Pixel Coloring -> Rasterization -> Vertex Transformation
  • AudioSource -> Fragment Shader -> Vertex Shader
  • Fragment Shader -> Vertex Shader -> Model Geometry

Explanation: In the pipeline, vertex positions are transformed first (Vertex), then geometry is discretized into pixels (Rasterization), and lastly pixel colors are determined (Fragment).

2 Material color update

Question
material.Set____("_Color", Color.white);
Answer
material.SetColor("_Color", Color.white);

Explanation: The SetColor method is used in C# to update the color property of a shader.

3 Shader architecture summary

Term Meaning
GPU Hardware running shaders in parallel
Shader Graph Visual node-based editor
Surface Shader Structure automating lighting
Properties Parameters edited in the Inspector

All lessons in Advanced