LODs and terrain holes

Started by
5 comments, last by Vilem Otte 5 years ago

Hi everybody!

I've been pondering lately about how to LOD heightmap uniform grid terrains. Many games that published talks about their heightmap terrain rendering (Far Cry 4, 5, Witcher 3, ...) do it using the simple known vertex-kill 'hack' by producing an invalid vertex which takes all adjacent triangles with it. That's all pretty obvious, but it's only the nicest LOD.

How about uglier LODs and smooth transitions? If you store the kill/keep 1bit info per vertex (for example in a heightmap aligned with the vertices, or in a splat map, albedo map), your mipmaps will run into the same problems as foliage alpha maps do, that the holes will become either too small or too big in distance. Also, they won't match between LODs, which puts artists under more pressure to cover the hole edges with explicit geometry farther away from the hole itself, so that it works at all LODs.

Have you seen any papers specifically mentioning holes in heightmap terrains dealing with LODs? How to combine per-vertex holes (or discarding whole triangles) with techniques such as CDLOD?

Any comments? Thanks :)

 

Advertisement

These kinds of problems are interesting to me but I'm completely lost. I guess I'm missing some background info.

I remember this paper as the only one covering changing the genus: http://multires.caltech.edu/pubs/hybrid.pdf

For terrain it could work in a similar way as seen in the Buddha image, so edges in the mesh open up to build a hole when moving closer. But it would no longer be a simple height map then. 

Voxels handle this problem very elegantly - there is no need to tackle it at all. But any kind of surface remeshing makes LOD hard to solve if genus reduces at distance.

I guess games are fine if something like a tunnel just closes at distance? I don't know.

The problem is, that every terrain system will implement this on their own - and it will differ, an example from me: as height map is technically a plane - I decided to implement binary triangle trees.

terrain_tess.thumb.png.dc7cd312cf1497b9abac3e7be85c90e4.png

To explain the image - at the center of tessellated mesh there is an observer, you can see terrain cells being tessellated at different level. As the implementation is done using binary triangle trees - adjacency is guaranteed (assuming you choose correct index buffer).

In terms of LOD I can't get less tessellation than 2 triangles in cell.

Supported height map is of "unlimited" size, as my height map is a virtual texture (the page requests are not based on what you see like in Rage or Quake Wars (where they used virtual textures for albedo, normals, etc.), but based on selected tessellation level on the terrain). I had to solve problem with authoring terrains by building custom editor.

 

When editing the height map of the terrain, you always edit the page on most detailed pyramid level (and higher pyramid levels are then computed).

 

Thsi is WIP, but: during editing of height map I allow for specifying a 'hole' (basically negative values as of now), which is then written into the virtual texture (and all impacted pages are updated). As the update algorithm is technically a mip-map generation, I could always copy negative sign from child pages into parent one for given pixel - and therefore keep a hole even in the distance.

 

As for the games (like Skyrim) I'm quite sure they do render holes only on the most detailed terrain cell where you are currently at. Further they mask it with distant 3D model, so you never see the actual hole in the terrain.

 

Note. By pyramid, I mean pyramid of full virtual texture - when editing it - you need to load pages, edit/update them, and store in virtual texture file - as there is no way you could hold everything in memory at once.

My current blog on programming, linux and stuff - http://gameprogrammerdiary.blogspot.com

Hi and thanks Vilem. So what you're explaining is that you propagate the hole from the finer 4 texels up to the coarser 1 texel using a minimum operation (minimum out of 4 texels instead of the average of 4 texels), so the hole becomes bigger?

I suspected games to actually not deal with holes and mask them somehow in the distance!

Yes, that is way how I deal with holes still being in terrain in distance currently. As you pointed out, it can become bigger (which could be a problem, but so far I didn't notice it - of course this always boils down to: what kind of art are you using and whether you also place distant LOD geometry of your objects around the hole).

I think most of the games won't deal with them in distance (at least I'm quite sure none of Bethesda games show you holes only in loaded terrain cells around you).

Also, how do you render your terrain?

My current blog on programming, linux and stuff - http://gameprogrammerdiary.blogspot.com

This topic is closed to new replies.

Advertisement