Jump to content
  • Advertisement
Sign in to follow this  
chibitotoro0_0

OpenGL efficient terrain modelling/rendering methods

This topic is 3181 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

I was wondering, what is the standard (mostly commonly used way(s)) of making/rendering terrains. I've programmed ROAM in OpenGL before and I've looked up other methods like quad-tree and so on, but all of them seem to derive off of the idea of using a height map (I may be mistaken). If it's just a height map that is being used, doesn't this restrict a modelers freedom to model the terrain as he pleases? If we just use height maps we're only going to have terrains that are planes with genus 0. What if we wanted to model more complex terrain shapes but render only those relative to the viewing frustrum of the camera? I can even image dividing up the terrain model into an octree if needed and rendering respective octrees children as necessary but is this the standard way of doing it? I've also read stuff before about occlusion testing to see if a wall is in the way and not render stuff being blocked. When I look at most games that I play, it doesn't seem like a height map is being used.

Share this post


Link to post
Share on other sites
Advertisement
From what I remember, Crysis uses height-maps for most of the terrain, but allows some areas of the height-map to be replaced with voxels for cliffs, overhangs, caves, etc...

In other games, the terrain is simply chunked into a collection of models like any other piece of geometry in the game. It could be sculpted as you like in 3dsMax (etc.) and have different LODs for distant rendering.

Share this post


Link to post
Share on other sites
If you use chunks of models segmented into octrees and use LOD, wouldn't you get cracks in your terrain at the thresholds where the LOD kicks in? unless im assuming that the chunked LOD method is also using a heightmap as well

[Edited by - chibitotoro0_0 on December 1, 2009 8:22:35 PM]

Share this post


Link to post
Share on other sites
The most common work-around I've seen for cracks is to add "skirts" to the chunks -- bits of vertical geometry that extrude downwards around the edges to fill in any gaps. These cracks are usually small and in the distance, so any incorrect texturing on the skirt is usually unnoticed.

Another solution is to have lots of variations for each lod, designed to correctly align with neighbouring chunks of different lod levels.
e.g.
LOD0 (high detail)
LOD1 w/ east neighbour at LOD0
LOD1 w/ west neighbour at LOD0
LOD1 w/ east and west neighbours at LOD0
...
LOD1 w/ south neighbour at LOD2
...
etc

If you're doing chunked-LOD from a height-map or voxel data, then you can procedurally create these different mesh permutations as needed. If you're modelling them by hand, this might be a bit of a nightmare!

Share this post


Link to post
Share on other sites
If you need more freedom you can use a vector map instead of a height map. That means you do not only store a heightmap (z-displacement), but also an east-west-map (x-displacement) and a south-north-map (y-displacement).

For a heightmap the final position is float3(x, y, h(x, y)).

For a vector map the final position is float3(x + f(x, y), y + g(x, y), h(x, y))

In general you need 3 times the memory for that, but for the x and y displacement you don't need the same resolution usually, so you can save there a bit.

You can still use the same basic ideas like chunked lod for heightmaps. And with vector maps you can create overhanging cliffs.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!