Let the graphics card draw

Formo team · 16 October 2020

Hello,

This week we have been in a swimming pool. A virtual one, drawn in the browser, with floating people and a heat-map showing where a viewer was looking.


Why not just use the usual way?

A web page can draw in two ways. The simple way asks the processor to colour each pixel, one after another. The other way hands the job to the graphics card — a chip built to colour millions of pixels at once. Imagine painting a wall with a brush versus rolling a thousand rollers at the same time.

We write directly to the graphics card, without a big 3D library on top. It is more work, but we know exactly what happens, and we can make it do things the simple way cannot.

Thousands of animated pixels, drawn by the graphics card.


Small programs that colour every pixel

The graphics card runs tiny programs called shaders, one per pixel. A shader can say "make this region look like water" or "add glow along this edge". Because of them, a fill is not only a flat colour or a gradient — it can be a living pattern.

In our prototype a shape can take a shader as its fill: you open the code, change it, and expose a few values as sliders next to the shape.

From a flat colour to moving water, with a slider.


We are still learning what art directors would do with this. If you have a look in your head that no fill can make, tell us.

As always, let us know what you think on our Discord.

On this page

Formo

The browser studio where drawings become animations, toys, and games. Your files, nothing to install.