• Advertisement
Sign in to follow this  

Landscape to fly over

This topic is 1966 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
Advertisement
Hi,

i don't know how specific you need your bullet points, but steps involved would be something like this:[list]
[*]initialise your graphics API of choice
[*]create a landscape (procedurally or from a source like a height map)
[*]implement navigation
[/list]
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
There are height-map editors that you can use, such as [url="http://hme.sourceforge.net/"]HME[/url].

Or you can use procedural methods, such as [url="http://en.wikipedia.org/wiki/Perlin_noise"]Perlin noise[/url] or [url="http://en.wikipedia.org/wiki/Diamond-square_algorithm"]diamond squares[/url].

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 [url="http://http.developer.nvidia.com/GPUGems3/gpugems3_ch01.html"]marching cubes[/url]) 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 [url="http://http.developer.nvidia.com/GPUGems3/gpugems3_ch01.html"]tri-planar texturing[/url].

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement