Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 1.5 — WebGL, WebGPU and the Libraries
3D Web · Example 2 of 2

The same cube on the WebGPU renderer

The output differs by browser, so the page does not check it. In Chrome or Edge with WebGPU it prints running on: WebGPU. Without it three.js prints the warning THREE.WebGPURenderer: WebGPU is not available, running under WebGL2 backend. and the line reads running on: WebGL 2 (fallback). Note that navigator.gpu can be there while no adapter is (that first line says true even in a browser that then has to fall back). The status bar shows the backend too.

A web page reaches the GPU through WebGL 2 or the newer WebGPU, and almost nobody uses them directly: libraries such as three.js sit on top. You choose a library by what it costs and gives you, and you must always check that the browser can draw 3D before you try.

Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.

Ready for more? This phase has 5 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

Write a function canUseWebGPU() that returns true only when WebGPU is really usable.

02

Your client wants a 3D model of a chair on a product page, with nothing else interactive. Which tool would you try first and why?

Explain it without notes

01

Name the main differences between WebGL 2 and WebGPU a beginner needs to know, and say which one this course starts with and why.

02

Why is checking navigator.gpu alone not enough to use WebGPU?

The same cube on the WebGPU renderer
Press Run to see the page.
idle

Console

Nothing logged yet.