Sign in to follow this  
piluve

CDLOD, question about the quadtree.

Recommended Posts

Good evening!

 

I´ve been reading some papers about rendering large terrains,LOD,tessellation etc . And I found one really interesting (http://www.vertexasylum.com/downloads/cdlod/cdlod_latest.pdf) it describes how to make a terrain LOD system using just one grid mesh and a quad tree ( in the vertex shader, lod borders are interpolated so we have a smooth transition). I have never used a quadtree so I´m a bit confused. The paper explains, that the quadtree is created at the begining and it contains all the heightmap values. 

 

I understand then, that the quadtree will contain HeightMap(width) * HeightMap(height) nodes (at the lowest lod)? But how do I organize the quadtree so each LOD (0,1,2,...) represents one of those nodes?

 

Sorry if the question is not clear :S

 

See you!

Edited by piluve

Share this post


Link to post
Share on other sites

You store the quadtree data in the mips of a texture.

As your mips half in size on each level, this maps nicely to the quadtree design (as-in each node has 4 child nodes)

 

On specific details you should just look at the code as the entire code seems to be available

Share this post


Link to post
Share on other sites

You store the quadtree data in the mips of a texture.

As your mips half in size on each level, this maps nicely to the quadtree design (as-in each node has 4 child nodes)

 

On specific details you should just look at the code as the entire code seems to be available

 

Thanks for your reply.

 

I think that mipmaps aren´t used in this implementation,it just provides the heightmap to all the grids (that have been scaled and morphed). I will check in deepth the code and see what can I understand.

 

See you.

Share this post


Link to post
Share on other sites

The article you are referring to does not mention storing all height values in the quadtree iirc. The quad-tree is generated using the min-max elevation for the area of terrain it covers. This way one can quickly generate bounding boxes for each quad-tree node and frustum cull them efficiently at run-time. The article does not mentioned using 1 grid mesh to render the entire terrain as a grid mesh is needed per LOD ( ie. each quad-tree level ). However, the static mesh vertices are displaced in the vertex shader to give the terrain appearance. A tesselation shader could be used instead whereby only a single quad would be need to cover the quad-tree node, and tesselated based on LOD. In anycase I would suggest getting a run-down of how quad-tree or other spatial data structure work before jumping into the code as this would just lead to more confusion.

Edited by cgrant

Share this post


Link to post
Share on other sites

The article you are referring to does not mention storing all height values in the quadtree iirc. The quad-tree is generated using the min-max elevation for the area of terrain it covers. This way one can quickly generate bounding boxes for each quad-tree node and frustum cull them efficiently at run-time. The article does not mentioned using 1 grid mesh to render the entire terrain as a grid mesh is needed per LOD ( ie. each quad-tree level ). However, the static mesh vertices are displaced in the vertex shader to give the terrain appearance. A tesselation shader could be used instead whereby only a single quad would be need to cover the quad-tree node, and tesselated based on LOD. In anycase I would suggest getting a run-down of how quad-tree or other spatial data structure work before jumping into the code as this would just lead to more confusion.

Thanks for the explanation, yeah I´m reading about quadtrees and other ways to store data as well as reading a few times the article and see if I understand it better.

See you!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this