- Home /
Dynamic Terrain Loading
I have to admit that I'm not really good in coding, and now I have a scene a heavy one and i need to make it faster on runtime using Dynamic terrain loading. I have no idea what is the algorithm. Am I guessing correct? where am i going wrong?
1.Creating a matrix of terrains. 2.Apply SetNeighbors to connect them. 3.Apply a heightmap to this matrix of terrains so each terrain gets its own share of the heightmap. 4.Tell the camera which terrain to load according to the cameras FOV.
The two last steps I really don't have any idea how it works it terms of coding. Can anyone please help me with that. thanks,
Check out some already existing answers to your questions. Unity Answers helpfully lists them right next to your question under "Related". Try this one for a sample project: http://answers.unity3d.com/questions/9988/dynamic-terrain-loading
This works great! it is so fast indeed. But now my question is, how to apply one heightmap over a matrix of terrains? in this project it's the same terrain being recreated as the camera moves. thanks,
Answer by zharramadar · Jan 17, 2011 at 12:28 AM
You can't easily spread a single heightmap into a matrix of terrains, as terrains have their own terrainData. Each terrain is able to hold a terrainData, which also contains your heightmap information. I suggest you split your heightmap in several chunks in the size of your terrain matrix. Otherwise you need to parse the heightmap and create several terrainData to associate with each terrain.