Yard Box

This toy draws a 3D yard as pixel art and needs WebGL 2. Try a current Chrome, Safari, Edge or Firefox, or turn on hardware acceleration.

Yard Box

3v3 in the courtyard box behind a panel block, on a floating island. First to five.

Click the player on the ball to shoot, his team-mate to pass, the pitch to dribble there · S P D · Space pause · Q E or arrows turn · drag to turn, wheel to zoom

How it's drawn

Real 3D, tiny target. three.js r160 renders the scene with an orthographic camera at 31° elevation into a half-float target of about 480 × 300 art pixels with a depth texture, no anti-aliasing. The camera snaps so the world origin lands on a whole art pixel, so nothing static shimmers.

Post pass. One shader reads every art pixel with texelFetch, darkens it ×0.5 where it sits more than 0.5 m in front of a neighbour (depth outlines), then snaps it to the nearest of 62 fixed colours in OKLab, with lightness weighted ×1.35. A 4×4 Bayer dither is optional. Empty depth becomes the page colour; a second pass blows the art up in whole-pixel blocks.

Light. A sun or moon with hard 2048 shadow maps, a hemisphere fill, two streetlamps and weak doorway lamps (point lights, decay 2). Day, dusk and night blend over 1.6 s; lamp faces, TVs, room floors and the facade's emissive canvas fade between off and on, and flats switch their lights at random.

World. Boxes, cylinders and extrusions, merged per material. Turf, planks, nets and the panel facades are drawn texel by texel on canvases. Turn to the block's side and the upper floors lift away to show a section of the ground floor.

Kids. Rigs of about 17 boxes posed every frame with two-bone IK. The game runs at a fixed 60 Hz: the ball in 4 substeps (bounces, lively boards, dead netting, posts, nets, legs), kids that read a forward-simulated ball, keepers with a 0.1 to 0.3 s reaction.