Side Roads and Laybys
Side Roads and Laybys are another feature we've added to increase the visual fidelity on the road edges. They offer a little more variety when you're driving along, and are a pretty standard sight in most rally stages.
For these features there were some substantial changes to the way the main track mesh was generated. Previously the number of width polygons was fixed, e.g. say 10 polygons/vertices either side of every interpolated spline point (see the ditch and mounds post for further insight into the spline mesh). The width of the track could vary along the length but this would stretch and squeeze the size of some polygons depending on the makeup of the track. To better facilate these (and future) features, I changed the way it worked, to allow us to specify how many vertices we want per unit of measurement. So, rather than specifying 10 vertices either side of the track, we now specify 1 vertex every half a metre, or whatever.
For the side roads, I also added support for 'holes' in the track mesh, essentially a gap where we don't have any track verts at all. The empty space is then used to generate a road entry mesh, along with a new road mesh going away from the main track. The entry mesh is basically hand crafted from the exposed edge verts of the main track and first row of verts from the new side road mesh. After which, all 3 meshes are combined.
For laybys, the width of the track is simply modified, tagged appropriately, and textured to suit. Both of these features benefited from the previous work done around selectively increasing the road spline interpolation, as the extra verts could be used to create more realistic looking feature meshes.
The eagle eyed amongst you will notice a bit of a texturing issue where the feature meets the main road, this will be addressed later on. :)