Command Palette

Search for a command to run...

Hectal
Phase 18: Production-ready 3D
3D Web · Exercise 1 of 4Next
Intermediate

Show the picture when WebGL is missing

This page pretends the visitor's browser has no WebGL. Right now startScene() would throw.

Write supportsWebGL2() (safe against getContext throwing). When it is false, show #fallback with a sentence in #reason and a text alternative on its picture, and create no canvas.

What Check tests

  1. No canvas was made
  2. The fallback is shown
  3. A reason is written in plain words
  4. The picture has a text alternative

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.