Cube World Aero
A cube landscape built from scratch in WebGL.
Open Cube World Aero (new tab)A small WebGL scene written without a 3D library: the geometry, matrices and shading all go straight through the raw WebGL API, wrapped in a glossy Frutiger Aero interface. Tap to blow bubbles and drag to look around.
Open the sceneHow it is built
One cube is copied across a grid, moved to its cell and stretched in height, with a colour on each corner. Perspective and look-at matrices place the camera, and the fragment shader blends the corner colours and lights every face.
Levels
- Heights and per-vertex colour.
- Heights and colours sampled from a height map and a colour map.
- Clouds, butterflies and bubbles moving along cubic Bézier curves, each with its own model matrix.
Performance
The whole landscape is one buffer drawn in a single call, so it stays smooth up to tens of thousands of cubes. A live readout shows the grid size, build time and frame rate.