Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: Create landscape

  1. #1
    Intern Contributor
    Join Date
    Jun 2010
    Posts
    78

    Create landscape

    Hi
    Whats is the best algorithm to create a landscape?
    I would like to render it in triangles.

  2. #2
    Member Regular Contributor Rosario Leonardi's Avatar
    Join Date
    Aug 2008
    Location
    Italy
    Posts
    352

    Re: Create landscape

    The "best" algorithm depends on your porpoise.
    Every technique have is cons and pro, there is no ultimate landscape technique.

    First of all, go here -> http://www.vterrain.org/ <-

    Then start asking yourself:
    I need roads, tree, water? How many trees? How big must be my terrain?
    From which distance I'll see my terrain? I want to walk over it? I want to fly over it? With a plane? With a dragon/unicorn?
    My program must run on old hardware?

    When you have more detail ask again.

    Recent improvement help a lot in terrain rendering, a good combo can be using transform feedback to generate the vertex and geometry shader to draw the mountains silhouette.

    By the way, I'm still looking for more detail about this technique:
    http://developer.nvidia.com/object/s...8-terrain.html

    Another easy to implement (but with a lot of cons) is using geometry clipmap:
    http://http.developer.nvidia.com/GPU...chapter02.html
    ~ ~ I tell you, realtime 3D is made of blood, sweat and screams! ~ ~

  3. #3
    Intern Contributor
    Join Date
    Jun 2010
    Posts
    78

    Re: Create landscape

    It is rely the simplest landscape possible. No forest, roads etc. Just some textures and bumps on it. The size does not realy matter. I can fall over the edge it does not rely mather. It is only for demonstration purpose.

    Moving around. Is just like the view of a flying camera. Nothing else.

  4. #4
    Member Regular Contributor Rosario Leonardi's Avatar
    Join Date
    Aug 2008
    Location
    Italy
    Posts
    352

    Re: Create landscape

    The most simple technique is:
    Drawing a grid with 512 x 512 vertexes, and from an height map the displacement. (half an hour of work)

    You will finish you memory quite really soon.
    Then you think that an adaptive approach is better.

    An old algorithm (but still good) is ROAM
    http://www.gamasutra.com/view/featur...of_detail_.php

    All the computation is done in CPU, but it's ok for simple application, you can find libraries that implement it.

    If you want to transfer some work in your GPU try to use geometry clipmap (the last link in the previous post), it can render really big landscape but require vertex shader to read floating point texture (GeForce 8 or above). With this technique all computation is done in GPU, you only have to draw some grids.

    Did you take a look at vterrain.org, there are a lot of algorithm and articles.
    ~ ~ I tell you, realtime 3D is made of blood, sweat and screams! ~ ~

  5. #5
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    2,882

    Re: Create landscape

    Couple issues to think about when you're deciding what you need.

    Do you need cut-in features, like rivers, lakes, roads, etc. How should these LOD as the terrain LODs? What about buildings?

    How smooth do terrain LOD transitions need to be?

    What kind of lighting/shading/texturing do you need on it? (some terrain algs hand-wave texturing)? What min/max texture resolution do you need?

    Is the terrain small enough to load on startup? Or do you need to load-as-you-go?

    How much GPU mem can you devote to it? Does it matter to you if you upload a boatload of verts and spend a lot of vertex transforms on the GPU to render flat terrain where 10 tris would have sufficed?

    Does it matter to you if the silhouette of that mountain in the distance looks pretty sad because the tessellation algorithm doesn't use curvature to determine where to spend verts?

    How much frame time can you afford to spend trying to find the right triangle mesh every frame and batching it efficiently (view-dependent LOD, etc.)? Do you need to do this at run-time?

    Can you presume tessellator-capable GPU?

  6. #6
    Intern Contributor
    Join Date
    Jun 2010
    Posts
    78

    Re: Create landscape

    Thanks for input. Maybe I will bump this thread in the future.

Posting Permissions

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