LOD for procedural terrains

Started by
20 comments, last by Green_Baron 4 years, 5 months ago

I have been digging into "Chunked LOD" papers and examples. I mean while I want to ask what is really the up-to-date technique for doing LOD's for procedural terrain (calculations on CPU side and also for low end hardware like mobiles)? I don't want to miss something and adopt some maybe out dated strategy. Any suggestions welcome!

Advertisement

I would be interested as well in the "up-to-date" aspect, because it seems like there haven't been that many news on the subject in the past years.

I went the other way, going with an algorithm that uses the GPU (i think todays mobiles are pretty well equipped as well) and that doesn't need stitching and too much preparation on the CPU. CDLOD was my choice. For rendering the geometry it only uses a simple regular 2D mesh the size of a node and a displacement map which can be a single channel 16bit texture.

Green_Baron said:

I would be interested as well in the "up-to-date" aspect, because it seems like there haven't been that many news on the subject in the past years.

I went the other way, going with an algorithm that uses the GPU (i think todays mobiles are pretty well equipped as well) and that doesn't need stitching and too much preparation on the CPU. CDLOD was my choice. For rendering the geometry it only uses a simple regular 2D mesh the size of a node and a displacement map which can be a single channel 16bit texture.



Would it be possible to manage CLOD on CPU side, from your exp.?

Yes

You could have a look at the classic roam algorithm and its variants as well.

Green_Baron said:

Yes



What sources did you use when developing CDLOD for your project? Maybe can give some pointers?

Does it not display the link in my first reply ?

You could search github for "strugar cdlod". Strugar is the developer of that thing :-)

Green_Baron said:

Does it not display the link in my first reply ?

You could search github for "strugar cdlod". Strugar is the developer of that thing :-)



Ok. Sorry. Link works. Thanks!

Green_Baron said:

Does it not display the link in my first reply ?

You could search github for "strugar cdlod". Strugar is the developer of that thing :-)



Maybe u can give some pointers where to look at first? Its a lot of code :)

Yes, but much of it is renderer stuff and not directly connected to the lod algorithm. First read the paper. And you will have to go through this yourself in order to understand what's going on. I did actually take the time for myself to dissect and re-implement it in my environment.

But because i am a nice guy and have some time, here's a high level overview:

Setup:

  • For a given heightmap texture, build a quad tree hierarchy of nodes, calculate their bounding boxes, offsets and sizes.
  • prepare a regular gridmesh the size of a single node
  • calculate lod level ranges and transition areas from higher to lower lod level (this can also be done in the loop).

In the loop:

  • select the nodes that appear in the view frustum, sort them front to back
  • for every selected node, draw the gridmesh
  • for every vertex/grid mesh position:
  • calculate the world position and determine the distance to the camera from the node's offset and size.
  • use lod level ranges to morph the base grid from higher to lower levels, displacing the positions slightly in 2d. Don't forget height displacement (*).

Or use roam or geometry clipmapping, afaik they lend themselves better to cpu based lodding, but need more preparation and gymnastics to optimize meshes, stitch and skirt nodes, can pop between lod levels and so on.

(*) in the vertex shader, this can be done in two steps, a pre- and an exact lookup, so that terrain height is already observed for morphing.

Have fun :-)

This topic is closed to new replies.

Advertisement