One-seed city
Type a number and the city rises. Same seed, same city. procedural generation · instancing · WASD
Type a number and the city rises. Same seed, same city. procedural generation · instancing · WASD
Visual mode: HDRI lighting, ambient occlusion, bloom, depth of field and quality that adapts to your device. Light mode: no post-processing, for phones, weak laptops and for studying the technique.
Each block gets a number derived from the seed and its position (a hash). That number feeds a pseudo-random generator, so the same seed always builds the same city.
r = mulberry32(hash(semente, x, z))Low-frequency noise plus the distance to the center decides whether a block is downtown (towers), residential, industrial or a park.
The city is split into 288 m chunks. Only the 7 × 7 around the camera exist; as you fly, the ones behind disappear and new ones are born ahead.
All buildings in a chunk are one instanced mesh; windows are drawn in the shader, with no texture, and edges smoothed with screen-space derivatives.
In late afternoon the sun drops near the horizon: the face toward it warms up, the opposite one cools down, glass mirrors the orange sky. A low fog layer thickens with distance, and water tanks, antennas and signs come from each building’s hash. At night, cars leave light trails proportional to their speed.
névoa = max(dist, e^(−y/22) · dist)