Jump to content
  • Advertisement
Sign in to follow this  
Divega

LWJGL Terrain, the quadtree, and LoD

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

If you intended to correct an error in the post then please contact us.

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
Advertisement
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 link 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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!