Jump to content
  • Advertisement
Sign in to follow this  
Stainless

Large scale terrains (again)

This topic is 1057 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'm still at the design stage for my terrain system. A lot of the other work on my flight sim has gone very well, but I've been battering around ideas for the terrain for months now without coming up with a design I like.

 

I can generate whole planets worth of random terrain no problem, but generating terrain based on real world locations is another whole barrel of triangles.

 

The input data I already have is in the form of two textures per map, Each map is something like 1000 miles by 1000 miles.

 

The first texture is a height map. Standard stuff, but at a resolution of 1 pixel = 400 square meters .... not very useful as it stands.

 

The second has type information in it. it is broken down into 16 terrain types,(4 bits) (water, grass, mountain, etc.) and two bits for roads and railways.

 

My original plan was to generate a terrain patch for each pixel of the source data, but when you get to above 35,000 feet the number of terrain patches visible becomes ridiculous.

 

So I'm thinking I am going to need a terrain patch to be about 10 miles square. These will have to be generated from the original data and include a really good CLOD system. Which one is up for debate.

 

To get the level of detail I need from this is going to be a major challenge. I need to have terrain that looks good when you are stood next to your aircraft, and still looks good at 35,000 feet. Not easy.

 

So I am looking for guidance from the folks here.

 

Anybody seen any good papers worth reading?

Anybody got experience writing terrain systems for flight simulators and is willing to share knowledge?

 

At the moment I have a dozen possible solutions in my head, none of which solve all the problems, all of which solve some of the problems.

I keep starting writing code, and then stopping what I am doing because I realise it won't work.

Edited by Stainless

Share this post


Link to post
Share on other sites
Advertisement

http://vterrain.org/LOD/Implementations/ is a great site for terrain rendering stuffs. Also since much of the work is academic, you can find good links on citeseer.

 

 

Having just watched "The code" on netflix, I can offer what was done by boeing in their sims(In the 80's mind you). They used random heights, and what appeared to be midpoint displacement or another fractal function to create the fine detail. The run-time looked like ROAM, He gave some detail as to the vertex count, but i can't recall of the top of my head. You might try this to fake increased heightmap resolution when creating your patches. Or get a better data set. I'm currently learning how to stream patches myself and using the SRTM 1 arc minute data.

 

What do you expect the visible distance to be?  knowing this would let you figure out what the max area that would need to be in memory at once. From there you could start to figure out where the trade off goes for increased number of patches ( with less LODS) vs increased patch size( with more index buffers) but my instincts tell me that 10 miles x 10 miles is large for a single patch.

Share this post


Link to post
Share on other sites


What do you expect the visible distance to be?

 

Remember this depends on current altitude and air speed.

 

If you're at ground level standing still you probably have a visible distance of a mile or so. If you're at 30,000 feet travelling 500 mph, your view distance is probably nearer 100 miles.

 

This influences how much you have to stream in advance from the disk and how much is in ram.

 

In some sims like flightgear this is apparent if you fly in the ufo debug aircraft that can fly at several thousand miles per hour. The streaming simply can't keep up and the game lags, eventually locking up as tiles aren't removed from ram or loaded quick enough. It's designed to cope with the maximum airspeed of the real aircraft it simulates. 

 

Useful information to consider right there!

Share this post


Link to post
Share on other sites


Anybody got experience writing terrain systems for flight simulators and is willing to share knowledge?

 

i'm working the same issue myself right now for AIRSHIPS!, a ww1-ish airship flight sim.  the game world extends from the arctic to north africa, and from the mississippi to the urals.

 

my world coordinate system is currently based on sectors that are 10,000 feet across, so 1000x1000 verts for a terrain patch / chunk / mesh at 10 feet between vertices was the original plan, but that's a kind of a big mesh. 

 

a low rez heightmap based on real world data in combo with some higher rez "noise" seems to be the way to go. similar to the boeing approach described above.

 

you'll have a maximum mesh size you'll want to deal with, and a minimum mesh resolution for your highest LOD, say 1 vert per foot, and a mesh size of say 250x250 verts=62500 verts per patch/chunk. so your highest LOD chunk might be 250 feet across. at lowest LOD, a chunk will still be 250x250 verts, but at a much lower resolution. how low depends on your personal taste as to how low no longer looks acceptable. that may be 100 feet between verts, IE 250,000 feet across.  obviously, you want to keep the LOD levels power of two size with respect to each other. whatever you highest and lowest resolutions are, and whatever power of two it take to get from one to the other will be the number of LODs you'll need. all the rest is pretty much generating and paging the right stuff quickly enough.

 


I keep starting writing code, and then stopping what I am doing because I realise it won't work.

 

step 1: figure out how to do it. step 2: implement.  imagine writing every line of code in your head before you sit down at the computer:  "ok, i turn on the pc, fire up the ide, goto this section of code, add this routine, goto that section of code, the new design i've figured out already can reuse this with a minor mod..." and so on. then when you do sit down at the computer, you'll already have done it once - in your mind. 

 


If you're at 30,000 feet travelling 500 mph, your view distance is probably nearer 100 miles.

 

there should be a way to look this up or figure it out. my plan is to use max visual range of the largest object in the game as a guideline. using a rule of thumb of max visual range = 100 x object size, i came up with a visual range of at least 73 miles for the largest airship in the game. altitudes will typically stay below 20,000, except in the case of uncontrolled ascent.

 

a geometric solution based on diameter of the earth and an observation point at 35K ft should give you the max visual range including curvature.

 

and don't forget, if all else fails, there's always fog! <g>.

 

http://www.gamedev.net/topic/671128-dealing-with-terrain-chunks-for-a-big-world/

Share this post


Link to post
Share on other sites

The size of the terrain patch is not so much of an issue. The key things you want to look at is the LOD you apply to each patch.

 

You have data points every 20m (Using your 1 pixel per 400m2). You can use this resolution close up but at 35000ft do you need to use one point per 20m, the further your patch is away the less detail you need.

 

If the terrain patchs carry LOD details you can then use whatever LOD calculations you want to apply to know if the patch needs a rebuild at a different LOD than it currently has. This way you can carry a massive number of terrain patches and reduce the render workload.

Share this post


Link to post
Share on other sites

Yes guys, my initial plan was to have each terrain patch be a single quad at the lowest resolution. However after some experimentation, I think the best I can get away with is 4 triangles, so I can give the patch some form.

 

The reference LOD will be one of the higher resolution LOD's, but which one depends on my initial patch size.

 

So my LOD design looks something like this.

 

Lowest res  : 4 triangles

.......  N LODS down sampled from reference data

Reference   : Real world data

........ N LODS up sampled from reference data (standard CLOD of some form)

Best :            Up sampled and mixed with noise

 

Sounds simple when you write it like that rolleyes.gif

 


there should be a way to look this up or figure it out.

 

Yes, I remember looking this up some time ago. It's based on the curvature of the Earth and altitude of eye point. It's vast though. If I am going to support modern planes I need to be able to go up to 60,000 feet.

 


step 1: figure out how to do it. step 2: implement. imagine writing every line of code in your head before you sit down at the computer:

biggrin.png  Do that all the time. Even dream about code.

 

It's things you don't expect that bite me. Usually in the graphics card. I'll use this technique, only supported on Nvidia cards..... ballacks..... I'll use this one , not supported on Nvidia cards .....

 

Wall. Meet head.

 

What I did with random planets is use latitude and longitude as inputs to a noise function. This gives you completely seemless terrain even at the poles.

 

As you decrease in altitude I just increased the resolution of the noise function, so you get more detail but without an increased vertex count.

 

It's like sliding one of those frames full of nails across a terrain.

 

This turned out to be ok at the time, but as you get nearer the base frequency of the noise functions, things get very bad. Verts dance around with even the smallest change in view vector. Not good.

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!