L3DT development blog
Large 3D terrain generator

March 24

Fun and games with gigapixel maps

Hi Everyone,

As part of the validation process for the forthcoming L3DT release 16.0X, I thought it might be fun to generate a gigapixel terrain map; i.e. one with 32k x 32k heightfield pixels. In the past when I've generated large terrain maps of this size, the objective was usually to verify that various algorithms in L3DT could handle large maps. I didn't care at all whether the results looked any good or not, as that was normally tested and tweaked much more quickly with smaller map sizes. Consequently, previous large terrain tests have often used settings optimised for speed, not quality, such as little or no erosion, no flooding of water table, etc.

This time around, I wanted to look at the results in the Sapphire 3D renderer to make sure it properly supported large maps. Since I was actually going to look at the results, instead of just verifying that the algorithms didn't crash, I thought I might make a little more effort to produce something nice. Erosion was enabled (at 30%), the water table was flooded (that took two days), and the attributes map, normals map, light map and texture maps were all generated at 2x resolution, meaning each was 64k x 64k pixels in size, or 4 gigapixels each. All up, the project is 82 gigabytes of raw data, which mercifully is only 29 gigabytes on disk thanks to file compression. It took about a week to generate on an old quad core box with only 4GB of RAM, but generate it did, and no bugs were encountered.

Anyway, here's a quick screenshot in Sapphire showing an aerial view from around 530m / 1700ft above ground level, with a horizon distance of 31km / 19 mi:

The view from 1,700ft.

Now, I'll freely admit that the image isn't stunning; without vegetation, roads or structures, you can easily see that the terrain is not particularly detailed (10m mesh spacing), and the texture is a little coarse (2x res only). This map represents the sort of level of detail you might find in a flight-sim, not an FPS game.

However, what was of interest to me what what happens when you fly a little higher, with a longer horizon distance. This is the same map, at the same location, from an altitude of 7000m / 23,000ft, with the horizon pushed out to 108 km / 67 mi:

The view from 23,000ft.

Now it's starting to feel like a large map. Note how the mountain that looked quite large in the the distance of the first image (indicated by red arrow below left), now looks rather puny in the second image (indicated below right):

1,700ft altitude, again. 23,000ft altitude, again.

I only really grokked the full scale of the map when I went looking for the same features in the 2D view. Note how the area we've been looking at, from the lakes to those those really distant mountains (purple arrow, > 100km away), is just a small part of the southwestern corner of the map.

The 2D view, same features marked (arrows at bottom left)

Truly, a 32k x 32k heightfield is a stonking big map to run around on.

Anyway, the take-home message from all of this is that L3DT 16.0X seems to work just fine with gigapixel maps, and Sapphire works fine too.

There should be a disclaimer, however; for the really long view distance shot (108km horizon), I was trying for a nice image, so I had both the geometry turned way up (370k triangles), and the texture level-of-detail bias disabled, so the frame rate dropped to only 0.7fps on account of all the the heightmap, water map and texture data that Sapphire had to process to render each frame. I could still move around, but only barely. This post should therefore not be interpreted as meaning Sapphire will be snappy when viewing so much data all at once, only that it can do it without crashing. That said, when I turned the horizon distance back to normal (from 100km to 10km) and the triangle count back to normal (from 370k to 32k), the frame rate bounced back to normal too (~10fps, on my ancient system.) With reasonable horizon distances, there is was no appreciable performance penalty of moving around on a 32k x 32k map, as compared to, say, a 'tiny' 2k x 2k map. Sapphire seems to scale well, which is nice.

Anyway, that's enough for now.

Cheerio, Aaron.

2016/03/24 12:43 · aaron
 
blog/2016/03-24.txt · Last modified: 2017/08/31 06:15 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
L3DT Development Blog RSS Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki