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.

Thursday, January 29, 2009

Playing with detail texturing

Playing with detail texturing.

First creating detail material map for each tile, computed from terrain data - elevation, slope and curvature, using two additional fractal channels for mixing.
The algorithm first computes slope, if it's steeper than some defined angle of repose it's considered to be a rock.
I'm not using slope directly here though - a positive (convex) curvature is used to boost the slope slightly to make rocks more protruding at the top.

Gradual slopes and flat parts can use one of three textures. The mixing is done using one fractal channel. The first texture is default, the two other textures have some coherent probability of occurrence, that is additionally altered so they are more likely to occur on gradual slopes (dryer grass) or flat parts, respectively.

Yet another fractal channel is used for coloring - slight modification of texture colors to break the monotonous pattern on large flat areas.

The textures didn't come from an artist so all the patterns are my fault.
Also, due to this bug I can't have anisotropic filtering on atlas textures yet.






Wednesday, December 3, 2008

vimeo

We tried Vimeo's HD videos and the result is here, with music giving it somewhat different mood



Only afterwards I noticed that the function computing the tree distribution stopped working correctly after some variables (namely the local terrain curvature) changed in magnitude as they are computed slightly differently. So the trees now grow on much steeper slopes than they should. I won't deal with it now, it has to be reworked into a generic vegetation placement module anyway, when climate info becomes available.

Just now I have to optimize tile manager and generator because it not very efficiently handles GPU memory.