# XNA Quadtree with LOD

I'm looking to create a fairly large environment, and as such would like to implement a quadtree and use LOD on it. I've looked through numerous examples and I get the basic idea of a quadtree. Start with a root node with 4 vertices covering the whole map and divide into 4 children nodes until I meet some criteria (max number of triangles)

I'm looking for some very very basic algorithm or explanation with respect to drawing the quadtree. What vertices need to be stored per iteration? When do I determine what vertices to draw? When to update indices and vertices? Hope to integrate the bounding frustum? Do I include parent and child vertices?

I'm looking for very simple instruction on what to do. I've scoured the internet for days now looking, but everyone adds extra code and a different spin without explanation.

I understand quadtrees, but not with respect to 3d rendering and lod. A link to an outside source will probably have been read by myself already and won't help.

Regards, Byron.

-
What you've described is not the method that one would use to efficiently draw a terrain using a quadtree. You do not partition the terrain at the vertex level into the quadtree. You partition the terrain into blocks containing many vertices, and each block is assigned to a quadtree node. There are many ways to go about this. There are several quad tree terrain examples on the net written in XNA, but you said you don't want me to link to those so... – Olhovsky Jun 7 '11 at 4:49
@Olhovsky, this should probably be listed as an answer – Joel Martinez Jun 7 '11 at 17:41
@Joel - It's not an answer, because it doesn't answer the question asked. – Byron Jun 8 '11 at 8:06

## 1 Answer

The "modern" way to render terrain is to use chunked LOD.

With the last few generations of hardware, say the last 5-10 years, fiddling with the geometry primitives on a per frame level (as is needed e.g. for ROAM) is counterproductive as it incurs a horrible performance hit. You are much better off building a whole array of immutable chunks and selecting the proper ones based on distance etc.

-