Dev.to WebDev 🛠 Dev 👁 0 📖 3 min read

11,334 windows: a night city in plain WebGL 2, without a library

Our studio's home page opens on a city at night. Every window in it stands for one security hole found in WordPress sites in 2025, and there were 11,334. This is how the city is made: plain WebGL 2, no 3D library, three

11,334 windows: a night city in plain WebGL 2, without a library

The night city of 11,334 windows

Our studio's home page opens on a city at night. Every window in it stands for one security hole found in WordPress sites in 2025, and there were 11,334. This is how the city is made: plain WebGL 2, no 3D library, three draw calls, and about 3 KB of code once it is compressed.

See it live, with a slider to move through the story: https://dreamnexus.digital/notes/11334-windows

Why a city

We look after websites. The part of that work nobody sees is updates: 11,334 new security holes were found in WordPress sites in 2025, and 91% of them were in plugins (Patchstack, State of WordPress Security 2026). A number like that slides past you in a sentence. A city where every window is one of those holes does not.

So the city is the data. It has exactly 11,334 windows. They turn red with the count, 9% of them go blue for the holes that were not in plugins, and one building, the one we look after, is lit again floor by floor.

Building the plan

The city is generated, not modelled. Our building stands in the middle with twelve floors. The other buildings are placed on a grid of lots from the middle outwards, each with a random width and height, until the windows on their two visible faces add up to 11,334. Then the list is cut at exactly that number.

A seeded random generator makes it the same city on every visit. Each window is eight numbers: where it is, which face it is on, how far it is from the middle, a random value, its floor, and whether it belongs to our building. That is 11,334 × 8 floats, about 363 KB on the graphics card, sent once.

// x, y, z, face | distance, random, floor, ours
wins.push(x, wy, z, face, Math.hypot(x, z) / 70, rnd(), floor, own);

Three draw calls

Everything is drawn with instancing. The buildings are one cube drawn once per building, stretched to its size. The windows are one small rectangle drawn 11,334 times, and the vertex shader moves each copy to its place and decides its colour. Then the same rectangles are drawn a second time, larger and with additive blending, as the glow. No post-processing and no bloom pass.

The story is four numbers passed to the shaders: how far the count has spread, whether the plugin holes have turned blue, how dark the rest of the city is, and how many floors of our building are lit again. The windows work out their own colour from those numbers, so moving through the story costs nothing on the processor.

float on = smoothstep(0., .035, hole*1.12 - kd - rnd*.1);   // the red spreads outwards
c = mix(c, warm, own*smoothstep(0., .35, fix - floor));      // our floors come back on

Letting the scroll drive it, calmly

On the home page the scroll is the timeline. The first version followed the scroll exactly, and on a phone that felt nervous: a small movement of the thumb flipped the text. Now the story has five resting points. Between them the scroll still moves the city, but around each one it holds still, so a small scroll never changes what you are reading. Five marks show where you are, and a link skips the whole scene.

It is measured against its own sticky stage, not the window, because a phone's address bar appears and disappears while you scroll and changes the window's height.

When not to draw it

The city only draws while it moves. At rest the page asks the browser for no frames at all.

It asks for WebGL 2 with failIfMajorPerformanceCaveat, and checks the renderer's name: a browser that would draw in software gets a still picture instead of a stutter. When frames take too long on a weak graphics chip, it draws fewer pixels rather than fewer frames. With reduced motion turned on, or without JavaScript, the five steps of the story are plain text, one under the other.

On a laptop with integrated Intel graphics it runs at 90 to 140 frames a second.

The same city, three times

One renderer, three uses. The hero of the home page shows the calm city and switches our building on once. The scroll story runs the full timeline. And our Instagram films start from the same idea, rendered frame by frame.

The city is on our home page: https://dreamnexus.digital. Happy to answer questions about the shaders or the fallbacks in the comments.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.