WebGL

WebGL hands drawing to the GPU: you upload vertex data once, write two small programs called shaders, and the GPU runs them in parallel on every vertex and pixel. Games, map libraries such as MapLibre 34,367 , Three.js 30,815 and Babylon.js 89,603 (Three.js and Babylon.js) build on it.

It is also low level: you write your own matrices and lighting in GLSL. This chapter teaches WebGL 2 and GLSL ES 3.00 and notes where WebGL 1 differs.

The running example is BookNest's shelf of six books, which gains a camera, lights and textures as you go.

What you will learn

Sections