
Keeping a thousand trees on screen
Every level of detail is a real mesh now. Switch points come from how many pixels a thing covers, and a zoomed-out jungle went from 113M triangles a frame to 7M.
Category
Terrain, shaders, level of detail and spell VFX — how the game gets drawn, and what broke on the way.
10 posts

Every level of detail is a real mesh now. Switch points come from how many pixels a thing covers, and a zoomed-out jungle went from 113M triangles a frame to 7M.

The 3D ground samples exactly sixteen textures, which is WebGL2's guaranteed floor. Adding one more does not degrade the render. It fails the shader link.

An outline drawn in screen pixels over geometry that keeps changing under it. Two named failure modes, a doubled hull on every building, and a lab for it.

Ninety generated letters, traced to vector and shipped as drawable paths. Split the brief into topology and execution, and keep fill out of the skeleton.

March an army across a winter map and it carves packed trenches with lit rims. Four separate weather signals travel in the four channels of one texture.

An MIT-licensed three.js casting sandbox became the spell renderer, after a Z-up remap, an ink-banding pass, and a rule about which number decides a spell's size.

The map used to be a flat plane with rock painted where you could not walk. Now the ground rises, cliffs block, ramps are the doors, and high ground sees.

Water used to be a wall. Adding one terrain value gave the map fords that infantry wade, ships crawl through and docks stand in, and broke three things.

Grass now bleeds into dirt along a warped contour instead of a grid of transition tiles, and the 2D and 3D views of a map finally draw the same world.

In April the camera stopped looking straight down. What a player got when a canvas RTS was rebuilt on three.js, and what the simulation never noticed.