Skip to main content
Annual billing

ThreeJS.net annual plans cost about 50% less than 12 monthly payments

Save

Glass City at Night

A night district from a slow drone orbit

About this scene

Seven hundred towers from a single instanced box, each with procedural windows computed in the fragment shader, traffic sliding along the avenues as GPU points, horizon haze that matches the fog, and a light bloom. Drag to orbit; click to make the windows flare.

How it is built

  1. 01

    One box, many towers

    The city is a single InstancedMesh: one draw call for every building. Heights follow a downtown falloff so the skyline has a centre instead of uniform noise.

  2. 02

    Windows without textures

    The fragment shader divides each wall into window cells in metres, so windows stay the same size on tall and short towers. A hash decides which are lit and how they flicker.

  3. 03

    Motion on the GPU

    Cars are points whose position along their lane is computed from time in the vertex shader, so 900 of them cost almost nothing on the CPU.

Questions

How many draw calls does the city use?
A handful: the towers are one InstancedMesh, the traffic one Points object, plus the ground and sky. That is why it stays smooth on laptops.
Can I change the colours?
The palette is three constants at the top of the file (accent, secondary, haze). Remix it in the Three.js Scene Generator and ask for your brand colours.

More examples