The Improved Terrain Generation Pipeline
The past two weeks I've been working to multithread and optimize the terrain generation in Mini Solar System and it's finally paying off. I left off last week with a mostly optimized but partly functional system, and I'm pleased to say this week I have ironed out most of the wrinkles and the terrain generation is almost ten times faster. Setup As previously mentioned , the old system would use one thread per terrain face, but now we are calculating the same face in parallel with multiple threads. I settled on an approach with the task graph system where one task would be launched to calculate the vertices, UVs, and tris for the mesh as well as the normals and tangents. Then that task would be used as a prerequisite for another task back on the game thread that would compile the terrain data from each thread and build the final mesh once all threads were finished. It had to be done in two separate tasks like this because the procedural mesh component ca...