DevShot #5 - Tire tracks
Project Slide is a game where the player drives vehicles on various types of terrain. With that in mind, it may surprise you that there haven’t been any tire tracks left by the vehicles up to this point. I decided it was finally time to do something about that and spent a few days designing a system where any vehicle can have its tires leave tracks on the landscape.
The system is not yet complete but it is already showing promising results. It supports many different track patterns (although only one is created at this point), varying tire widths, it takes slipping and skidding into account etc.
The tracks are rendered to a texture which can be used by any material in the scene. At the moment, only the terrain materials use it to leave marks on the terrain, but it can be used for other effects too, eg. to flatten foliage and grass as the vehicle drives over it. Before being rendered to the texture, however, the tracks are generated as procedural meshes, as can be seen in image 3.
The color of the meshes in image 3 specifies how much slip the tires were experiencing at the time. The more red the area is, the more slipping there was, and the system uses this information to blend in a different texture at these areas.
There is a surprising amount of details and edge cases to deal with in a system like this, eg. how to deal with overlapping tracks, what happens when vehicles switch between driving forward and backward, efficient rendering of many tracks and so on. Right now I am eager to get back to creating content for the demo, but it was a lot of fun to create this system and I expect to improve it in the future. If you want to know more about how it works, drop me a line below!