+ Reply to Thread
Results 1 to 21 of 21

Thread: Terrain rendering techniques

  1. #1
    Junior Member
    Join Date
    Aug 2004
    Location
    Alexandria, VA
    Posts
    27

    Default Terrain rendering techniques

    Does anyone have any good book recommendations for terrain rendering?

    I am interested in implementing a continuous LOD system, and am not sure where to begin.

  2. #2
    Senior Member
    Join Date
    Jul 2004
    Location
    Durham, UK
    Posts
    4,873

    Default

    I can offer this advice about terrain rendering: if you're just writing an indie game, do it brute force with a quadtree or octree, and design the complexity around your minimum graphics card spec. Or you will simply spend a lot of time doing something far more complicated than it needs to be to achieve the desired effect.

    Cas

  3. #3
    Senior Member
    Join Date
    Jul 2004
    Posts
    624

    Default

    ...and in the end, will probably end up with something slower than a simple quad-tree/brute force rendering scheme. Generally speaking, most LOD schemes are just not worth it these days.

  4. #4
    Senior Member
    Join Date
    Jul 2004
    Location
    Malta
    Posts
    273

    Default

    For our game we started out with model made of meshes arranged in 2-dimensional array and just rendering what's visible from the player's view up to a fixed distance ahead. Being a straight 3d scroller.. this was quite easy.. the camera always faced in the direction of -Z. In a sense the technique was borrowed from 2d tile-based scrolling where tiles were replaced by meshes representing patches of terrain.

    However, we found out that the rendering was taking too much time so the tech guru in the team came up with a rendering algorithm that varied the geometry detail of the mesh depending on distance.. and it actually worked in any direction. It was quite a challenge for him as he had to fit it around our existing model structures in order not to break existing code. He actually managed (bless him!) and we experience a substantial improvement.. to the point that we could afford to extend the horizon and the play area.

    The shot below shows the terrain in action in debug mode, with colour edges indicating the transition points between different levels of geometry detail.
    http://colinvella.no-ip.com/perihelion/018.jpg
    This is a more recent shot:
    http://colinvella.no-ip.com/perihelion/057.jpg

    Anyway.. enough bragging.. the point I'm trying to make is that it may be worth-while investigating some terrain rendering algorithms particularly if you're rendering large open-air spaces. There are some books available on the subject but you're probably better off looking up whitepapers and the source code examples available on the net.
    Nemesis

  5. #5
    Moderator
    Join Date
    Jul 2004
    Location
    Zürich, Switzerland
    Posts
    1,966

    Default

    I second Nemesis' suggestion. I cut the heightmap into 64x64 chunks and treat each patch independently (edges shared by two different patches are tricky). I update the patch subdivision based on distance, in a discrete scale of 3 steps (camera very close, medium distance, very far). The distance check and eventual recalculation is done 2-4 times per second or based on distance (this depends on the patch size and the speed of the camera).

    This has the advantages of LOD (fewer triangles) and it has a relatively small overhead (since some of the patches are recalculated sometimes and not too close in time)
    Gabriel Gambetta
    Google Zürich - Formerly Mystery Studio

  6. #6
    Senior Member
    Join Date
    Jul 2004
    Location
    Hamburg, Germany
    Posts
    298

    Default

    Buy, buy, buy (or use OpenSource). Look at somthing like Torque or OGRE that have a included terrain renderers. If you decide to write your own, apply to a post graduate position at your local university and drop the game project ..

    Well, it might not be that dramatic, but you will complete your project much faster by using someone elses code...
    Kai Backman, programmer (Blog)
    ShortHike Space Station Game

  7. #7
    Senior Member
    Join Date
    Aug 2004
    Location
    Utah, USA
    Posts
    844

    Default

    I agree with Mistaril. Why reinvent the wheel? There's so many terrain engines out there, even many free open source ones. Find one or buy on and use it. Your time would be better spent on the details of the game instead of the rendering engine.

  8. #8
    Moderator
    Join Date
    Jul 2004
    Location
    Zürich, Switzerland
    Posts
    1,966

    Default

    Quote Originally Posted by Greg Squire
    I agree with Mistaril. Why reinvent the wheel? There's so many terrain engines out there, even many free open source ones. Find one or buy on and use it.
    In fact, the terrain I described above is a highly modified version of one of OGRE's terrain plugins. So I didn't reinvent the wheel, I adapted it to my car More advantages of open source!
    Gabriel Gambetta
    Google Zürich - Formerly Mystery Studio

  9. #9
    Administrator
    Join Date
    Jul 2004
    Location
    WA
    Posts
    1,415

    Default

    I'm working on a platform where off the shelf terrain rendering isn't available. One of the better systems I've seen for CLOD is

    http://www.gamasutra.com/reatures/20.../ulrich_01.htm

    If your not familiar with the exsisting body of knowlege surrounding CLOD terrain you may have a hard time with the article, it's written assuming you are familiar with the implementation details of the other methods. (Lindstrom, Rottger, ROAM, etc.)
    Dan MacDonald
    a prisoner of the cause

  10. #10
    Senior Member
    Join Date
    Jul 2004
    Location
    Detroit area, USA
    Posts
    119

    Default

    When I was building a terrain renderer last spring, I found a couple of books that provided a good starting point for learning about the topic:

    "Focus on 3D Terrain Programming" by Trent Polack. ISBN 1-59200-028-2

    "Real-Time 3D Terrain Engines using C++ and DirectX 9" by Greg Snook. ISBN 1-58450-204-5

    However, I was focused on making a lunar landscape, so I wasn't very interested in the bits about making realistic looking trees and grass. Also, a lot of the material in these books was drawn from the Internet (no big surprise there), so you can probably find everything you need online.
    Paul Kerchen

  11. #11
    Senior Member
    Join Date
    Jul 2004
    Posts
    624

    Default

    FYI, the terrain in Unreal Tournament 2003/2004 was brute force. It was broken up into smaller segments which were culled against portals, but that was it. No LOD was used.

  12. #12
    Junior Member
    Join Date
    Aug 2004
    Location
    Sunny Farnborough in England
    Posts
    14

    Default Cipher

    Try Cipher engine (http://www.cipherengine.com), just had a landscape renderer added, cool well supported engine with full source for $100..

    Marcus
    Attached Images  

  13. #13
    Senior Member
    Join Date
    Jul 2004
    Location
    Malta
    Posts
    273

    Default

    Quote Originally Posted by EpicBoy
    FYI, the terrain in Unreal Tournament 2003/2004 was brute force. It was broken up into smaller segments which were culled against portals, but that was it. No LOD was used.
    Are you sure the maps aren't mostly indoor? I have a feeling that the "outdoor" bits aren't height-map based i.e. probably modeled like the indoor bits.
    Nemesis

  14. #14
    Senior Member
    Join Date
    Jul 2004
    Posts
    624

    Default

    I work at Epic.

    Trust me, we have a real honest to goodness terrain system. Check out some of the larger Onslaught maps. They are huge, entirely outdoor, and rendered brute force (with portal culling of terrain sectors).

  15. #15

    Default

    In my current project I'm just using brute force with quadtree culling. I tried out some of the LOD approaches but didn't find them to be worth the trouble since my grid is only 256x256. Fillrate has proven to be the bottleneck since I use texture splatting, and reflective water effects. Of course, my game requires hardware T&L due to the sheer amount of geometry used so things may be different if you're targetting a lower spec.

  16. #16
    Senior Member
    Join Date
    Jul 2004
    Location
    Malta
    Posts
    273

    Default

    Quote Originally Posted by EpicBoy
    I work at Epic.
    Ummm.. ok.. can't argue there! I guess that as with many optimisation techniques, there are specific cases where using CLOD / ROAM etc. is worthwhile.. e.g. some really large terrain.
    Nemesis

  17. #17
    Senior Member
    Join Date
    Jul 2004
    Location
    Croatia, Europe
    Posts
    125

    Default

    Quote Originally Posted by ggambett
    I second Nemesis' suggestion. I cut the heightmap into 64x64 chunks and treat each patch independently (edges shared by two different patches are tricky). I update the patch subdivision based on distance, in a discrete scale of 3 steps (camera very close, medium distance, very far).
    If you're already limiting yourself to 3 discrete steps you should just precalculate them and be done with it. If you use "flanges" for chunk-to-chunk connectivity (strips of quads "hanging" from the chunk edges), you'll never need to touch your vertex data at all.

    Anyway, the approach I would recommend is basically this:

    http://www.tulrich.com/geekstuff/chunklod.html ,

    with "flanges" (I don't know if that's what Thatcher is using these days, it very well may be), and no geomorphing.

  18. #18
    Senior Member
    Join Date
    Aug 2004
    Location
    Dorset, England
    Posts
    1,012

    Default

    As stated before...Blitz3D or Torque does this nicely.
    Indiepath Ltd
    "do good things - make money"
    And that is not the general opinion of Indiepath Ltd - etc... legal .... blah..

  19. #19
    Senior Member
    Join Date
    Jul 2004
    Posts
    624

    Default

    Blitz terrains are notoriously slow and don't allow nice texturing techniques.

  20. #20
    Junior Member
    Join Date
    Aug 2004
    Location
    Alexandria, VA
    Posts
    27

    Default

    Thanks to everyone for your input!

    I will check out the recommendations made in this thread.

  21. #21
    Senior Member
    Join Date
    Aug 2004
    Location
    Portland, Oregon, USA
    Posts
    146

    Default

    Having made about 8 different terrain engines myself (for various projects), I would recommend that you stay away from ROAM (it's terrible for modern TNL graphics cards). ROAM was designed before hardware TNL became prevalent, and its' dependence on the CPU will bottleneck any modern graphics card.

    The method I favor (as most hardware friendly) is chunked geomipmapping. Do a google on "geomipmap" and you should find a paper or two on it. There are modifications you can do to it to make it CLOD, and if implemented well, it does not stall out your pipeline like other CLOD algorithms do.

    On the other hand, with the advent of programmable GPUs, people have been coming back to CLOD but done entirely on the video card. This can be VERY fast and very smooth, but you are eliminating the entire market of people who don't have the nice programmable GPU cards (which might be fine for you... shrug).. Of course, the geomipmap algorithm can ALSO be implemented as a GPU program, so.....

    People can and do go on and on and on about the merits of various approaches... So I will just stop here.. heh.

    Just my .02...

    Chaster

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts