🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

3D Terrain Library from NASA SRTM/ETM

Started by
4 comments, last by meusse 4 years, 1 month ago

Hello Everyone,

My goal is to create a scenery library using SRTM/ETM space imagery to automate the process as much as possible while providing the greatest degree of realism (matching real world terrain as closely as possible – elevation and details like terrain, ecosystems and bodies of water). I would like to break this library into varying levels of detail; based on hardware performance and then altitude (on the ground, flying low to the ground, flying high above the ground and low earth orbit).

I lack the background in 3D Modeling and its application to 3D programming for creating a library that would be friendly across all platforms using OpenGL, WebGL and DirectX (windows) for rendering. I'm looking for some ideas to develop a plan on how to create a process to accomplish this goal. Any help would be much appreciated.

Thanks,

Matt

Advertisement

High detail would be a resolution of a metre or less. srtm is 90/30m, and only covers latitudes +-60° or so. That's enough for a rough donut, which some would describe as a less optinal approximation to the earth's shape :-) But there are other sources, no worries. And there's allways the chance to diy terrain. Don't underestimate the amount of data needed to render even a small area of a few 10s of km² at 1m resolution. It is overwhelming !

There is enough to read for a turtle's lifetime on rendering planetary terrain, with example applications and even books (e.g. Cozzi/Ring 3D Engine Design for Virtual Globes). There are open source engines like Cesium or WorldWind but i haven't taken a look at them. And i assume you've already searched for such or similar libraries on the web.

I have no idea what your programming experience is, but when you say "library" i fantasize that you want to make something below engine level, am i right ? Then here's a task, as a warm-up, a starter, an amuse-gueule: build a flat mesh in the x/z plane of given power of two size between let's say 32 and 4096 (parameter), calculate vertices and indices for element drawing. Load a texture with height values of the same size. You can create that texture from srtm ascii data, it's a small routine (i have one that does a monochrome 16bit png in my github for comparison). Make a program that simply offsets the texture values in y on the created flat mesh, thus rendering what's called a height map. See how it gets laggier and laggier when you increase the size of the mesh.

Next step: LOD the mesh.

Hi there! Yes, when I say library I mean a library of assets that can be consumed by engines that would utilize OpenGL, WebGL or DirectX. I think I understand the limiting factor of resolution which is about 98 feet. The idea for this originated with a desire to create my own flight simulation software (hybrid blend of xplane and orbiter sim). Mainly as a way to brush off some rust with C languages and learn the subject of computer graphics along with physics coupled with the concept of computational fluid dynamics for engineering applications. My day job is flying the 747, so I'm trying to merge my passion for aviation/aerospace with computer science through simulation programming. A major victory for moving towards a completed product would be figuring out terrain generation, which is why I elected to start with it.

Anyway, the resolution should be fine for the given application and the missing pieces would have to be filled in with DIY terrain I suppose. I've been looking at the new Microsoft Flight Simulator and they are using Bing to feed their terrain/scenery. I think this is pretty cool actually. I used to fly for an aerial mapping company that collected the images for Pictometry. It was like mowing the sky for 8 hours a day flying line by line. They in turn processed the data and licensed the library to Microsoft. Article: https://www.polygon.com/2019/9/30/20885197/microsoft-flight-simulator-bing-maps-hands-on-demo

I have zero knowledge of computer graphics and rendering in general. The subject as you mentioned is dense, and I don't necessarily know what to filter out to learn specifically how to take data from the space imagery to generate highly realistic terrain. I do not want to become a subject expert on computer graphics, just learn enough to accomplish the referenced task. Do you have some suggested reading for the basics and then onto the specifics for completing the task at hand?

Thanks!

That's cool :-) I once had a PPL-A and flew around guests in a PA28 from a southern German club, but gave up that hobby in favour of sailing the ocean. But that got too expensive. Now i'm doing this sort of programming as a hobby and my goals are similar to yours, only i got humble in the past two years, slowly understanding the magnitude of such an enterprise.

If you haven't already done so, also look at FlightGear , they may be less "graphical" than MS but from what i understand their atmospheric modelling and flight dynamics are superior. But i allways found it difficult to compare simulator flying with real flying (apart from the procedures) because pc simulators imo lack decisive senses.

Here's what i have so far (source on github): a basic framework, render arbitrary heightmaps, cd-lodding the terrain, and basic shading. Right now i am working on cascaded shadow maps and atmopsheric scattering for the nice effects. May main problem is that everything terrain lod is done in shaders with my chosen cdlod, incuding positions. Since our consumer grade graphics cards don't support double float precision with enough performace, i can't really render a planetary sized ellipsoid with a reasoable frame rate (yet). This is because the lod algorithm knows no fixed precalculated mesh that could benefit from the gpu's 64bit abilities. But i am expecting that to change soon ™ because of competition on the market.

So, in your case, rendering a height- or displacement map right away may be a bit too early. I started with learnopengl.com and can recommend that. Work through the tutorials, don't miss out. I had to learn C++ at the same time, if that's not the case it might flow faster. You must definitely get into the shader stuff, there is no way around. Also, grab the Red Book (OpenGL Programming Guide 9th ed.) for an overview over the more modern OpenGL 4.5.

Yeah, when you're through with the basics of opengl (other apis are not fundamentally different, the learnt is not vain in the near future), look at other's source code and how they have tackled things. Nvidia, AMD, Intel, they all have repositories for the open source community where they make their ideas available (i'm just studying cascaded shadow mapping from an intel rep).

And specific questions are better than general ones if it comes to “i'm stuck, how do i proceed”.

I forgot: you probably know but there are a quite a few online sources for imagery and other geo data, commercial (e.g. esri) or not (e.g. nasa worldwind), readily georeferenced.

That's awesome! What part of Germany? I fly into Hahn, Frankfurt and Leipzig quite a bit. I've already got a good grasp on C languages, but need to review since I haven't been actively using them in the last few months. Looks like I'll start with OpenGL and find a basic intro to computer graphics. Will stop by here again soon. Thanks again. -Matt

This topic is closed to new replies.

Advertisement