Sign in to follow this  
redskyforge

State of play: terrain rendering

Recommended Posts

Hi there :)

As a quick intro about me, I released a 3D RPG on Android using libgdx at the start of the year and I'm now looking into starting my next project, a 3D RPG on PC. I have a pretty good idea of the technical requirements and implementation for the engine, but one thing I'm unsure about is the state of play for terrain rendering. I've been out of the loop of modern engine-level game programming for a while now (though I have done high level game programming for a next-gen studio a few years back), and the last time I seriously looked into terrain rendering was when ROAM was the way to go. Since then, I'm pretty sure things have changed, so what I'm looking for is a discussion on what modern tech/approaches are available these days.

My ultimate goal is to have the terrain looking something like it does in the Unreal Engine ([url="http://www.unrealengine.com/features/terrain/"]http://www.unrealeng...atures/terrain/[/url]) and I definitely want real-time LOD, but obviously as an indie it's way out of my price range. It would be Very Nice ™ if I could lift a module out of an open-source engine instead of reinventing the wheel (I'm happy open-sourcing my stuff too), but I'd still like some pointers to what modern games are using these days :)

Any recommendations/advice is very welcome.

Share this post


Link to post
Share on other sites
Based on the 7th screenshot of the Unreal Engine terrain I would assume they are doing adaptive LOD using a quadtree. This is a fairly easy way to implement terrain geometry.

Share this post


Link to post
Share on other sites
[quote name='Redskyforge' timestamp='1313667342' post='4850715']
Hi there :)

As a quick intro about me, I released a 3D RPG on Android using libgdx at the start of the year and I'm now looking into starting my next project, a 3D RPG on PC. I have a pretty good idea of the technical requirements and implementation for the engine, but one thing I'm unsure about is the state of play for terrain rendering. I've been out of the loop of modern engine-level game programming for a while now (though I have done high level game programming for a next-gen studio a few years back), and the last time I seriously looked into terrain rendering was when ROAM was the way to go. Since then, I'm pretty sure things have changed, so what I'm looking for is a discussion on what modern tech/approaches are available these days.

My ultimate goal is to have the terrain looking something like it does in the Unreal Engine ([url="http://www.unrealengine.com/features/terrain/"]http://www.unrealeng...atures/terrain/[/url]) and I definitely want real-time LOD, but obviously as an indie it's way out of my price range. It would be Very Nice ™ if I could lift a module out of an open-source engine instead of reinventing the wheel (I'm happy open-sourcing my stuff too), but I'd still like some pointers to what modern games are using these days :)

Any recommendations/advice is very welcome.
[/quote]

ROAM is pretty much out anymore due to the CPU+Dynamic Vertex Buffer costs involved. Most terrain engines start with something along the lines of [url="http://tulrich.com/geekstuff/chunklod.html"]http://tulrich.com/geekstuff/chunklod.html[/url] which is old but still of relevance in the current implementations. Basically the big deal is avoiding transferring vertices to the video card constantly where as the chunked versions do bulk 1 time replacements. Variations and upgrades exist to use vertex shader interpolations between transitions to avoid popping, sub-patch refinements instead of fixed grids, and a couple other things I can't remember of the top of my head.

Share this post


Link to post
Share on other sites
I suggest using [url="http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter02.html"]clipmap[/url] terrain.
Looks very similar to what they are using, and is fairly simple to implement. It can give you extremely vast viewing distances.

[url="http://www.youtube.com/watch?v=KTsEJDNpxZo&feature=related"]http://www.youtube.com/watch?v=KTsEJDNpxZo&feature=related[/url]
[url="http://www.youtube.com/watch?v=GHIH6M3nPoU&feature=related"]http://www.youtube.com/watch?v=GHIH6M3nPoU&feature=related[/url] Most types of terrains show no or little morphing.
[url="http://www.youtube.com/watch?v=THXhp0zrriw&feature=related"]http://www.youtube.com/watch?v=THXhp0zrriw&feature=related[/url] But those with sharp peaks can. I know of no way around this with any LOD system.


L. Spiro

Share this post


Link to post
Share on other sites
[quote name='YogurtEmperor' timestamp='1313723046' post='4851037']
[url="http://www.youtube.com/watch?v=THXhp0zrriw&feature=related"]http://www.youtube.c...feature=related[/url] But those with sharp peaks can. I know of no way around this with any LOD system.
[/quote]

Hard to avoid with geoclipmaps, but easy with geomipmaps (or any "per chunk" lod). Calculate the max error for each lower lod per chunk, multiply with screen distance. If it has a sharp spike, it will end up always being rendered at high(est) detail (less radical settings will at least have the popping happen while the chunk is still far away).

The first thing to ask yourself is what kind of terrain you are going for. Small but fancy or potentially infinite? Or even more basic questions: heightmap or a flexible approach allowing for caves and overhangs (or a combination).

A current PC should have no trouble handling GeoMipMapped terrain of about 8192x8192. For anything larger I'd definitely with GeoClipMapping

Terrain using geomipmaps: [url="http://festini.device-zero.de/Programming/Downloads/jstart.zip"]http://festini.devic...oads/jstart.zip[/url]
Messy source: [url="http://festini.device-zero.de/Programming/Downloads/jstartsrc.zip"]http://festini.devic...s/jstartsrc.zip[/url]

Share this post


Link to post
Share on other sites
My approach to caves is to simply load a new terrain up-side down, and another on top of that right-side up.
It only requires that the author of the terrain system have enough foresight to realize to make terrain as an instancable class and not as some kind of global (shudder) “this is the terrain in this engine, live with it”.
If your terrain can be loaded with any transform, you can patch terrains together at all kinds of angles to get good-looking overhangs or whatever you need.


L. Spiro

Share this post


Link to post
Share on other sites
Thanks for your replies! I'll investigate geomipmapping and geoclipmapping I think.

The quality of detail I'm going for is a good degree of realism from short to long distances. Detailed object groups like towns and other areas will probably be impostered at long range then streamed in as the player approaches.

Share this post


Link to post
Share on other sites
I'm interested in this topic as well but am a first timer at terrain rendering. Theres a lot of great content here, I'm going to read that chapter on geo clipmapping. Great videos as well. I have a few questions though.

Are geo clipmapping and geo mipmapping the best techniques out right now? (At least in terms of what an indie game developer can implement).

Also, if the game will have a lot of flat terrain, with maybe some slopes, slight curves, and rounded mountains, are these methods still the most efficient? I'm not sure what the overhead in these methods involve and am wondering if they are still good to implement for simpler terrain. I think the demo videos look amazing but I don't forsee users flying around in my game and thus wouldn't really see the incredible looking detailed mountain terrain in those videos.

Sorry for the lame questions, noob here, please forgive.

Thanks =)

Share this post


Link to post
Share on other sites
As a first thing, let's try to nail the problem to the basics. Me and several other forum members stated this multiple times, even recently but it's worth being clear.

[quote]John Carmack, 2006, on terrain rendering methods
That's one of those things that for years I think most of the research that's gone into has been wasted. Geometry level of detail on terrain.. there have been thousands of papers written about it, and I honestly don't think it's all that important. The way the hardware works, you're so much better off setting down a static mesh that's all in vertex and index buffers, and just letting the hardware plow through it, rather than going through and having the CPU attempt to do some really clever cross blended interpolation of vertices.[/quote]Whatever an algorithm is "efficient" or not is nowadays largely irrelevant.

For the time being, I am more inclined to chunking than clipmaps. Whatever this comes via generic DLOD or by using GeoMipmapping is not a real concern. GMM is basically DLOD on reverse and does not guarantee performance improvement when dealing with high-energy signals. In the past, I have been pretty negative about that but I've changed my mind in the last years. With so much vertex transform power, the chance to incur in high-energy signals is limited. Therefore, GMM would be my first choice right now as it's the one requiring less work to implement.

To directly answer your question: both geo clipmaps and mipmas are the best around - in one way or the other, for all but the most specialized applications. GMM would manage your data just fine (it's basically best case) while clipmaps... they simply don't care in the first place.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this