Learning path · 12 lessons · about 4 hours

From Shadertoy to Unity

You will: take what you learn in the browser into a real unity project. For: game developers who use unity (built-in or urp).

Shader tutorials online are mostly written for Shadertoy, but you want effects in your game. This path teaches the ideas once, in HLSL, then shows what changes when the shader runs on a real mesh in Unity: vertex and fragment stages, normals, lighting and the rim glow every game uses. Every lesson ends in code you can export as a Unity shader.

Start lesson 1

What you will be able to do

  • Write a fragment shader and export it as a Unity shader file
  • Understand vertex shaders and move vertices with waves
  • Light a mesh with normals and diffuse shading
  • Add a Fresnel rim glow to any object

The lessons, in order

  1. 1
    Every pixel, one function

    Make the whole screen the same blue as the target.

    Play
  2. 2
    Colors are four numbers

    Match the green. The Colors panel shows its hex code — convert it to floats.

    Play
  3. 3
    Two axes

    Red grows to the right, green grows upward, blue is a constant 0.5.

    Play
  4. 4
    Distance fields & antialiasing

    Turn the solid disc into a glowing ring: radius 0.3, soft edge width 0.02.

    Play
  5. 5
    Time: make it move

    Make the ring pulse: radius = 0.25 + 0.08 × sin(time × 3).

    Play
  6. 6
    Cosine palettes

    Make a rainbow that scrolls: t = uv.x + time × 0.2.

    Play
  7. 7
    Taking it into Unity

    Free play. Export it with the button above.

    Play
  8. 8
    Real 3D: vertex & fragment shaders

    Color the sphere by its normals: red = facing +x, green = facing +y, blue = facing +z.

    Play
  9. 9
    Diffuse light on a torus

    Light the torus from one direction with a little ambient light.

    Play
  10. 10
    Fresnel rim glow

    A dark blue knot with a cyan glow around the edges.

    Play
  11. 11
    Your first vertex shader: waves

    Make the plane ripple with a 2D wave and light it using i_faceNormal.

    Play
  12. 12
    Push vertices along their normals

    Make rings of bulges travel up the sphere.

    Play

Ideas you will meet

Short explainers with a live example for each:

See all learning paths