Terrain-specific CLOD algorithm

Hi,



I know, there is the AreaClodMesh that can alter a model's level of detail (vertex count) based on the occupied screen space, but is there in jMonkey an implementation of a CLOD algorithm specifically for terrains, like the one mentioned at "http://wwwvis.informatik.uni-stuttgart.de/~roettger/data/Papers/TERRAIN.PDF"?



It is very easy to implement, I have done it for my simple little engine, but since I want to move to jMonkey engine now, I was wondering whether such an algorithm exists there.



The algorithm presented in the mentioned paper can significanly increase the frame rate!

There isn't, and it would be awesome if somebody could provide an implementation! :wink:

No this type of LOD isnt anymore in JME for terrain pages - for normal terrainrendering it uses TerrainPages, which had an option for this lod. But it was removed - cant find the thread now.



Search for Terrainpage in this forum, there are many threads about terrain.



I would like to see an implementation, too :wink:



regards

Sorry for my ignorance, but isn't these kind of algorithms obsolete on modern graphics hardware. It takes way to much cpu time to find what triangles to draw.

tom said:

Sorry for my ignorance, but isn't these kind of algorithms obsolete on modern graphics hardware. It takes way to much cpu time to find what triangles to draw.

It certainly does, if you really go for the full Dynamic thing with real-time computation of index buffers while rendering. But how about a hybrid approach, in which you'd cache the index buffers for a number of LOD levels on disk for each terrain block?

Hi tom,



as hevee mentioned, in order to provide the best compromise between CPU cycles and frame rate and also used heap memory, a hybrid approach is surely the way to go.

What is also possible is to update the LOD not at every frame but only every i-th frame and in addition to that only if the viewer's position has changed.



But in reality, not everyone has a high-end graphics card which can seamlessly display large terrains at real-time frame rates. In those situations, a CLOD algorithm, as mentioned here, would greatly benefit them, even if the CPU has some more work to do (which it might not already have, given the fact, that almost everything today will be load off onto the GPU -> shaders)  :).

There is a working one built into the terra projects

You would aim for CLOD only on really ancient hardware. Clipmap terrain is the best to use (that's what Terra does). Terrain LOD can be done better with geometry shaders, but that works only on new hardware.



Still, i can imagine one scenario worth trying out: intelligently (manually?) generated terrain mesh, with CLOD and mapped VBO. That would have the benefit that you can model the terrain with cliffs, however you like, since you are no more using a height map, and you would not be punished on performance for pushing indices and vertices to the GPU each frame. CLOD has very visible "triangle popping", which even some newer games don't try to hide (shame on them).

Sometime intend on modding the terra implementation to keep the highest points from collapsing

This is a perfect candidate for a thread …

Terra supports clipmaps? This is quite interesting. Is it possible to use the clipmap implementation without having to use the Terra system itself?

Momoko_Fan said:

Terra supports clipmaps? This is quite interesting. Is it possible to use the clipmap implementation without having to use the Terra system itself?

Just to clear this up a little, you might be thinking about texture clipmapping. This isn't what's in terra.
Terra has a very simple terrain LOD algorithm which results in something that looks like geometry clipmapping (which is essentially the same concept applied to another kind of dataset).
However the terra approach is quite different in that it actually breaks up the dataset into tiles on disk and then uses precomputed index buffers for LOD levels, both of which clipmapping as I understand it was designed to avoid.
hevee said:

Momoko_Fan said:

Terra supports clipmaps? This is quite interesting. Is it possible to use the clipmap implementation without having to use the Terra system itself?

Just to clear this up a little, you might be thinking about texture clipmapping. This isn't what's in terra.
Terra has a very simple terrain LOD algorithm which results in something that looks like geometry clipmapping (which is essentially the same concept applied to another kind of dataset).
However the terra approach is quite different in that it actually breaks up the dataset into tiles on disk and then uses precomputed index buffers for LOD levels, both of which clipmapping as I understand it was designed to avoid.


It does this on a threaded task, so its background work - doesnt effect FPS while computing the buffers.

Is this bad ???, if so what is a better way
theprism said:

Is this bad ???, if so what is a better way

It is not bad, on the contrary it is a very fast algorithm at run time. However there are other algorithms, most prominently the one kburjack is planning to implement, which preserve the shape of the terrain better.

Why not implement the ROAM algorithm? It can  target a frame-rate / triangle count and is view-dependent.  There are some modifications to the algorithm that reduce popping as well.



I believe even Crysis' engine does CLOD on fly (for terrain), and it doesn't take long to notice popping there either.

ROAM is pretty much obsolete now… Since it requires constantly updating the index data it's not that great. Algorithms like geomipmapping are much better as you can cache the index buffers for each LOD level- thus no need to resend geometry data for the terrain every frame.