Friday, May 22, 2009

Progressive download

Complete dataset for Earth with 76m sampling is 192GB, after wavelet compression it is roughly 14GB. That is still too much for direct download, and it will be even slightly larger after more detailed data are used for some parts at higher latitudes that are currently only coarsely defined. Possible solution could be to use a coarser sampling, but this rapidly washes out nice terrain features that the fractal cannot supersede easily.
Fortunately it seems we will be able to use the 76m dataset since progressive download works quite nicely.
Wavelet compression of elevation data helps here because it not only nicely compresses the data but perhaps more significantly it arranges the data in layers by level of detail. Particular level of detail for quad-tree nodes can be then downloaded when needed.

Results are that landing on the ground in a mountainous area (where the data are largest) requires around 30-40MB of compressed data to be downloaded progressively and cached. Further data (3-8MB) are needed again only after traveling some 300km from the spot. So it seems that even camera following a cruise missile can be handled too, though possibly it could skip the most detailed data at that speed anyway.

Lastly, the downloader uses libtorrent library so the data can be downloaded using p2p, initially from http seed.

Using finer sampling manifests itself mainly in mountainous areas where high frequency features occur most.
Here's comparison of High Tatras as rendered by the engine and by the nature.


Currently we are working on material mixer that will allow us to assign different materials to different climatic bands, so the peaks here will not be covered by grass and mountain pine will grow at higher elevations too.


Outerra planetary engine

Friday, March 6, 2009

chromium

Angrypig experimented with chromium code and ultimately managed to integrate the browser into our engine. Works fairly well, with mouse and keyboard too. It's still just a prototype, though; the integration with the engine will be reworked and optimized for example to have to update only the changed parts in the web page and to make the whole thing asynchronous.

Also, we are going to hook into V8 engine to handle javascript events in Google Maps, so that the camera moves to the selected location in the maps, and vice versa.







Outerra planetary engine

Thursday, February 26, 2009

Procedural terrain algorithm visualization

When I tried to visualize resolution of elevation dataset we are currently using, it occurred to me it would be a good idea to visualize also the various steps and enhancements to the procedural refinement algorithm. These more or less show also how the algorithm evolved.


First, the terrain rendered with bilinear subdivision just to show the resolution of elevation data. We currently use ~150m dataset for whole Earth. All detail below 150m is generated procedurally.
To have a completely procedural planet, another algorithm would generate rough map with continental plates and mountain ranges, that will be then used as the basis for further procedural refinement.


The same terrain now with bicubic subdivision of tiles producing molten ice cream hills. The terrain is textured mostly according to the slope, with slight perturbation with another fractal.




Adding homogeneous wavelet noise to the bicubically subdivided terrain. Doesn't look right, though - no erosion except for the glacial one, that is visible even in the original data.

Shows symptoms of simple fractal terrains - different parts look similar.




To fix the erosion, the amplitude of noise is modulated by slope - flat areas have less noise, while the steeper get more.

This starts to get right, at least for the valleys, but the slopes are still too monotonous.




The idea for the next step is that anything below the angle of repose is subject to excessive sediment deposition, and is then more even and less noisy.

This creates larger continuous grass surfaces on moderate slopes, with rocks here and there.




One problem with slope-dependent noise is that the mountaintops tend to be smooth because the slope is low there.
The subdivision also distributes the flatness to wider area.
The solution is to make the amplitude of noise rise with positive values of curvature too, depending also on elevation.



Also an interactive comparison here.