Updates to the heightmap from SetHeights and SyncHeightmap for terrain

Hello, while developing tools for the terrain i noticed that SyncHeightmap() is much faster than SetHeights() when manipulating great amounts of heightmap data, however, it takes a big performance hit because it’s waiting on the GPU. I also noticed that while calling SyncHeightmaps there’s only 1 additional function which takes a performance hit and is visible inside the profiler - “Terrain.RecomputeInvalidPatches”. Is this function just updating the heightmap information on the CPU with new heights collected from the GPU? If this is the case, how come SetHeights() is taking magnitudes longer to process compared to the former function? Is it because the former function is not sending any data back to the GPU while SetHeights() does? If that’s the case, could the terrain API be extended for more versatile use for heightmap updates, which would allow to update the terrain heightmaps specifically for terrain collider only?

With 2019.1 “CopyActiveRenderTextureToHeightmap” got introduced which allows to update the heightmap on the GPU without updating it on the CPU. A vice versa approach would also be great, giving full control on what goes on with the terrain collider on the CPU side.

I really hope we’ll get an AsyncSyncHeightmap sometime. Seems like a small fix…