Command Palette

Search for a command to run...

Hectal
Phase 12: Shaders with GLSL
3D Web · Exercise 1 of 5Next
Advanced

Write a stripe shader

The plane covers the screen but its fragment shader paints it black. Make it show four vertical white stripes on black: white in the second half of each quarter of the width, using vUv.x, fract and step.

What Check tests

  1. The first quarter's first half is black
  2. The first quarter's second half is white
  3. The second stripe is white too
  4. The gap between stripes is black

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.

Console

Nothing logged yet.