five-on-it / apps/client/src/renderer/roads
apps/client/src/renderer/roads
The roads' look: a ribbon per road along its centre line (paved roads dark asphalt, an unpaved track brown, both lit like the level's own ground so they match the asphalt a level models around its junctions), and the paint on the paved ones as @foi/world's roadPaint lays it: edge lines, centre lines and lane lines, clear of the junctions and giving way to the level's own paint (a zebra crossing, a stop line, a grate). The paint is one mesh of thin quads per colour a little above the ribbons.
A ribbon lies on the road's surface (@foi/world's roadProfiles: the ground under it in columns across it, 2 m apart at most, at each of its points), a little over it, so it leans with a road leaning over a city's relief instead of sinking under its high side. Where a track runs into a street both lie on the same ground, so the asphalt is drawn a step nearer the camera than the dirt (and the dirt a little lower), and the paint a step nearer than both: whatever the distance, the street wins over the track and the paint over the street.