Help with Procedural Height (3D)

Hi all,

I am currently working on a project which generates a random spherical planet, consisting of polygonal tiles.

The problem I face is I don’t know how to apply some kind of heightmap to the world.

Below are some screenshots of my project so far:

2780423--201167--upload_2016-9-7_20-30-47.png
Current state: No height generated on start.

2780423--201168--upload_2016-9-7_20-33-43.png
Example: Random height per tile.

Obviously I can simply give every tile a random height, but this would not look natural.

I was thinking it would be most appropriate to use some kind of cellular automata, or maybe even a 3D Perlin noise map - any ideas on implementation?

How did you make these tiles? You may want to look into Voronoi polygons to generate the shapes and heightmap.

http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/demo.html

I don’t see too much wrong with the random height image. It seems pretty interesting to me. I don’t know what the desired effect is, however.

I am using Voronoi polygons already, just wondering what the best way to apply a pseudo-random heightmap is.

I agree that it is pretty interesting as is, however I would like some more uniform or natural landmasses, rather than entirely scattered - kind of like continents.

I recently tried using some rules to smooth the heights, an implementation of a cellular automata, but it is too inconsistent.

Does anyone have any ideas as to how I could apply a Perlin (or other) noise map to these tiles. They are just a List in my project.

You should read through those links, and the demo and code provided. They cover heightmapping voronoi with perlin noise among many other subjects. All the concepts can be applied to sphere-mapping.

I have read them and I see how I can apply the height based on distance from water etc.

I am still struggling to see how I can apply a noise map to my planet though.

The noise function is what generates what is water and what is land randomly, therefore the height of the land masses is randomly configured, and in relation to the “natural” layout of the planet.

You’re missing the actual point I am making: the issue I am having is making the land tiles into a continent, rather than just being scattered randomly. The need to be pseudo-random, such that the land masses are semi-realistic.

I am certain that the link I provided does exactly that, but on a 2D plane. The exact same methodology can be applied to a sphere.

You start with the generated voronoi polygons:

In the Demo they are using Perlin noise among others to control the shape of the island, giving the initial seed that the edges are water. You can define whatever you want as a seed, or start with some randomly picked spots to be bodies of water.

The code can mark both centerpoints or corners as water or land, which can be used to define lakes or oceans if the water is completely surrounded by land. This may not apply to a spherical layout as it is a contiguous surface.

The source code for this is in Map.as

Result:

Then you use the distance from water as height.

Use any 3d noise module you want (libnoise, turbulence library, Perlin implementation). For each cell use the mid point position, normalize it and feed it into the noise. In return you recive a noise value (usually -1 to 1). “Map” this value to a certain height / terrain. fe -1 to -0.5 deep sea, -0.5 to 0 shallow sea, 0 to 0.3 coast, 0.3 to 0.6 hills, 0.6 to 1 mountain/snow.
Note: this approach is purely height based and does not have biomes or polar caps but should give you a start.

To control the “granularity” of your terrain types simply multiply the normalized tile position with a radius. values closer to zero will have larger areas covered with same terrain. larger values will look chaotic and noisy.
You need 3d noise to prevent seams. Imagine the noise module as a 3 dimensional height map. With the coordinates you feed into it you query the noise value at the given position. The closer the coordinates are together the more the height values will be correlated.
Now imagine you do it for every cell on your sphere very close around the center. Or imagine you mulitply each position (vector) with a large number (length, radius) and query the position there.

The continents will probably look very round. For more details you want to “overlay” different noise (fractal).

Biome construction also includes temperature, water etc beside height.

If you want to take a shortcut with a ready asset:

This pretty much provides what you want if I understood you right. Saves you some time and headache.
Also have a look at http://experilous.com/1/store/offer/worldbuilder from same author and the blog on his site.

Good luck.