Change terrain heightmap resolution

Hello,

I bought a terrain from the asset store, but they have the heightmap resolution set to over 2000, i want to change it to something near 512, but i know if i change it will erase the terrain.

Anybody knows if there is a Unity script that can change the height map resolution without clearing it somehow?

Thanks

To do this you basically need to resample the terrain heightmap data at a larger interval, so that what was formerly 4x4 pixels is now 1x1, or however your ratio goes down.

To write the script, start by getting familiar with the SetHeights() and GetHeights() calls on the TerrainData object associated with your terrain. You would be sampling from one terrain grid and putting it into the other.

While you’re working on it, just bring in the old terrain, make a new terrain the correct size, and have your script copy the data from one terrain to the other, until you get it working the way you want it.

I would also recommend using source control so you can easily revert errors in the data when you are working, as well as for the obvious “creep and save” features of good source control.