Jump to content

  • Log In with Google      Sign In   
  • Create Account


Landscape to fly over


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 tuppe99   Members   -  Reputation: 125

Like
0Likes
Like

Posted 01 September 2012 - 05:14 AM

This answer to this question may be long, but I just need bullet points actually.

I am an absolute noob when it comes to graphics programming, but to get started all I want to do is to create a 3D landscape that I can "fly" over.

What are the steps involved in accomplishing something like that?


Thanks!

Sponsor:

#2 weeska   Members   -  Reputation: 255

Like
0Likes
Like

Posted 01 September 2012 - 05:24 AM

Hi,

i don't know how specific you need your bullet points, but steps involved would be something like this:
  • initialise your graphics API of choice
  • create a landscape (procedurally or from a source like a height map)
  • implement navigation
The landscape part can basically done by using a vertex shader to displace a sufficiently subdivided plane's vertices. The navigation part depends on the kind "flying" you want to have, but can be done with some translations and rotations depending on keyboard input.

#3 tuppe99   Members   -  Reputation: 125

Like
0Likes
Like

Posted 01 September 2012 - 05:30 AM

Thanks for the reply :)
The first one I have covered.

My noobness lies with the 2nd one. Since I have no idea how to create one, or even know what an vertex shader is, I guess I need to do some reading first. Any sources/tutorial that can help me with creating landscapes specifically?

#4 JTippetts   Moderators   -  Reputation: 8158

Like
0Likes
Like

Posted 01 September 2012 - 10:07 AM

There are height-map editors that you can use, such as HME.

Or you can use procedural methods, such as Perlin noise or diamond squares.

There are a couple of main ways you can implement a terrain.

1) Heightmap
A heightmap terrain is based upon an evenly spaced grid of squares (think of it like a piece of graph paper). Each vertex of the grid is displaced up or down by some value, depending on the value for that location in the heightmap. A heightmap is basically a black and white image, where fully black pixels represent 0 displacement, and fully white pixels represent maximum elevation displacement. Heightmaps can be constructed procedurally, using a dedicated heightmap editor like HME above, or even edited using an image editor like Photoshop or the Gimp, by drawing black and white areas and saving the image. Doing it in an image editor is somewhat tricky, though, since it is difficult to visualize the final result.

A heightmap terrain can easily be texture mapped by treating the terrain as if it were a flat plane, and stretching/tiling the terrain texture(s) across it. However, this method may render poor quality on terrains that have extreme height differences and steep areas, resulting in a lot of texture stretching.

Heightmap terrain has the advantage of being very easy to implement. There are plenty of algorithms that operate on heightmap grids for the purpose of Level of Detail (LOD) in order to boost the rendering performance of large landscape grids viewed at a great distance. However, heightmap terrain has the disadvantage of being unable to implement perfectly steep terrain, overhangs, or anything like that. There are hacks you can perform, though, that displace the grid in X and Y after the vertical displacement is done, but they might possibly break other things.

2) Triangle soup
Voxel terrains and other free-form terrains are commonly implemented as a triangle soup, rather than a regular grid of squares. The term triangle soup isn't official or anything, but it is an apt description. The terrain is just a collection of triangles, not particularly tied to any kind of grid. Or they might be grid-based (as in a terrain surface constructed via an algorithm such as marching cubes) but "messy". They lack the neatness of a grid of faces, and thus can tend to complicate things such as LOD determination.

Texturing a triangle soup type of mesh is less flexible and more complicated than a simple heightmap. A common technique to use is tri-planar texturing.

Triangle soups have the advantage that any terrain shape can be represented, including overhangs, cliffs, caves, etc... The disadvantage is the vastly increased difficulty in managing the data, implementing LOD as needed, and texturing. Constructing the terrain can also be problematic, unless procedural methods alone are used. Dealing with these sorts of terrains usually amount to exercises in creative data management. The solutions for heightmap terrain are very well known and well documented, but voxel terrains and other volumetric terrains are less exhaustively documented and implemented.

I recommend, if you're just starting out and learning, to go with a heightmap. After you gain some experience, then you can try to tackle terrains of greater complexity.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS