hshutao's picture

How to render terrain?

who can give me example for render terrain( USGS DEM) with texture(NASA TM image)? and is it possible for large area?

thanks


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

How large is the terrain going to be? What is your target hardware?

Terrain rendering is a very large and actively researched topic. I'm afraid it cannot be covered in a simple example, so you'll have to do a bit of reading: www.vterrain.org is a good starting place.

The high-level idea, which holds true for almost all terrain rendering methods, is more or less as follows:

  1. Load terrain data and textures from disc into an algorithm-specific datastrucutre. Use a paging mechanism if the dataset is too large to hold in main memory. Some algorithms preprocess terrain data at this stage (e.g. to create different levels of detail).
  2. From the camera's position, determine which parts of the terrain are visible. Again, this depends on the algorithm and the data structure used. For small terrains it's generally faster to skip this step and just render everything.
  3. Render each visible part. Again, the details are determined by the algorithm.

A good starting place is to implement the Chunked LOD algorithm (google "Chunked LOD" or check the site above). It's easy to implement, fast and scales well to larger datasets (with paging).

hshutao's picture

hi, Fiddler

thank your fast reply and suggestion.

hshutao