Command Palette

Search for a command to run...

Hectal
Phase 1: How a Screen Draws 3D
3D Web · Exercise 4 of 5 PreviousNext
Beginner

Check for WebGL 2 first

The page needs a <div id="fallback" hidden> with a message, and the code must decide with a function supportsWebGL2() whether to start the scene or to show the fallback.

Here WebGL 2 works, so the scene must start and the fallback must stay hidden. The function must ask for a "webgl2" context.

What Check tests

  1. The page has a #fallback element that is hidden
  2. The code defines supportsWebGL2() and asks for a webgl2 context
  3. The scene starts and draws

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.