# Very Big HeightMap Problems

This topic is 3213 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello and sorry about my bad English.(I use XNA) Now I use a 256X256 height map to my scene. I'm tried to use a 2048X2048 but the game was very very slowly,and it was in the same terrain scene. When I try a 1024X1024 height map my game dont work when I press on the debug button. How big scene games render a very big terrains? If I use a small heightmap and small models,the terrain's texture detail level is very bad and it will be ugly.

##### Share on other sites
Usually you split the terrain into smaller pieces, 64x64 e.g., and do a frustum culling test on each of this chunks. That should speed up your terrain rendering a lot.

##### Share on other sites
1)How can i split the terrain to smaller parts? What do you mean? I dont understand you.
2)How can I do culling in XNA?
3)What is frustum culling ?

Thank you very much!

##### Share on other sites

There is also a tutorial here that takes you though how to implement quad-tree rendering for terrain.

http://msmvps.com/blogs/valentin/archive/2008/09/30/smart-terrain-rendering-with-xna.aspx

I used the quad-tree component from codeplex and it worked great for a 2048x2048 heightmap.

##### Share on other sites
I did a quad-tree implementation for XNA for the very same thing. A Quad-tree is basically a tree structure that divides itself by four. So for example, you start with a root node which has four children nodes, each of those nodes then has four children nodes, etc.

The idea is that because your heights maps are divisble by four i.e. 2048x2048 you can split them into smaller chunks in the tree structure. How deep you go into the tree depends on your requirements - i think I did a recursive tree which means you can run out of stack if you go too far.

So you pick your depth and divide your terrain to fit evenly into each node, then you can frustum cull each terrain against a bounding box that describes how big this particular chunk of terrain is. I think XNA has a frustum class im sure, there are some articles floating about for XNA frustum culling heres one (http://www.nfostergames.com/Lessons/SimpleViewCulling.htm).

Another advantage of this is that because all the child nodes are contained within their respective parent node you can cull them just by checking if their parents node is visible in the frustum! Saving you lots of time.

I think thats about all I can remember now! I haven't touched this for over a year!

1. 1
2. 2
3. 3
Rutin
14
4. 4
khawk
11
5. 5

• 9
• 9
• 11
• 11
• 23
• ### Forum Statistics

• Total Topics
633671
• Total Posts
3013271
×