Jump to content

  • Log In with Google      Sign In   
  • Create Account


LWJGL Terrain, the quadtree, and LoD


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Divega   Members   -  Reputation: 110

Like
0Likes
Like

Posted 20 September 2012 - 07:13 PM

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.

Sponsor:

#2 Waaayoff   Members   -  Reputation: 767

Like
0Likes
Like

Posted 24 September 2012 - 02:30 PM

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.
"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS