Sign in to follow this  
Divega

LWJGL Terrain, the quadtree, and LoD

Recommended Posts

Alright guys I'm stumped. I've got a basic heightmap based terrain mesh currently made out of triangle strips. I want to implement level of detail with the diamond-square algorithm and I've found a few decent papers on the theory but none with actual code, or at least none with java code that I can clearly understand. Most papers i've read said that you can implement LoD with the use of the quadtree, and i know how to make a basic quadtree but i'm not sure how to implement a quadtree with terrain data. Can anyone point me in the right direction? I implemented my terrain class based off the tutorials from videotutorialsrock. I can post my code upon request.

Share this post


Link to post
Share on other sites
A common quadtree based technique is Geomipmapping. Basically each node in the quadtree represents a certain level of detail of the terrain. Parts of the terrain closest to the viewpoint are rendered at high detail by selecting high level nodes (ones at the bottom of hierarchy), while far away ones are rendered at very low detail (by selecting parent nodes).

For example, at the lowest level possible, the entire heightmap (say 512x512) will be drawn using a single chunk (say of size 64x64). When you get closer, that quadtree is split and you will draw the terrain using 4 chunks. This way you will have 4 * 64*64 vertices on screen. The closer you get to the terrain, the more chunks are drawn and so the higher the terrain resolution.

It's a bit more involved than that, but that's pretty much how it works.

Here is a [url="http://www.flipcode.com/articles/article_geomipmaps.pdf"]link[/url] to the paper. I'm sure you can find plenty of demos and source code with a quick google search.

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