- Home /
How to do a low impact terrain modification
Hi peeps,
I have an issue whereby I'm dynamically adjusting my terrain heights and alphas with the Terrain.terrainData.SetHeights
and Terrain.terainData.SetAlphas
methods respectively. The problem is it is quite slow and freezes my frame rate up when it does it. I already reduced my terrain size and I have 6 splat maps - I also moved the logic into a Coroutine with the same behavior. The question is how to adjust the terrain heights in a way that has less of an impact. I tried batching the changes but I think what's happening is instead of gradually changing the terrain in an Update() function it regenerates the entire terrain in one go. Is this something that can be further explore red in the Unity API or has someone come up with a solution for dynamically changing terrains? As a side note what is the Terrain.Flush()
do.. it almost feel like it's an unfinished API...
If I look at the profiler most of the processing is in the "SetAlphas" method and regenerating the terrain collider.
Answer by DaveA · Jan 15, 2014 at 07:24 AM
Terrains are a pretty incomplete API IMHO. My suggestions would be to use smaller terrains, tile them if need be, and look into some of the terrain-related stuff in the Asset Store which may save you time and pain.
Answer by morbidcamel · Jan 16, 2014 at 05:56 AM
Ok... Still apart from the obvious, is there someone who has dealt with terrains extensively, in particularly changing the alphas? Is this something we need to pass onto UnityTech for consideration?
Your answer
![](https://koobas.hobune.stream/wayback/20220613130145im_/https://answers.unity.com/themes/thub/images/avi.jpg)