A week ago, I posted about a new terrain generator. This week, I went back and added in parameters, that would make certain that each time the generator was run, the planet would have uniquely different terrain.
The difference between planets goes beyond just different colorations. Additionally, all parameters of the noise function have random factors applied to them. Specifically, the strength of seven of the noise functions is multiplied by a factor between 80% and 120% depending on the planet. This can have quite wide-ranging effects. Furthermore, the way the octaves of the noise functions are combined is also slightly randomized, to either give more or less detail - number of octaves, as well as the rate of fall-off from the first to later octaves.
You might also notice the lively background. Stars are added randomly around the night sky with random luminosity. Additionally, I managed to get a rudimentary nebula-noise going. Honestly, it looks mostly like some sort of aurora. Taking out the distracting planet and turning up the colours of the aurora looks as follows:
As mentioned, it is still pretty simple, which shows when you focus on it too much. It is drawn using Perlin noise with very strong domain-warping, low-frequency domain warping. That is:
noise(ix/350,iy/350,25*noise(ix/1500,iy/1500))
And then some added stuff on top of that.
Anyway, code and demonstration can as always be found on my OpenProcessing.
Planets
Aurora
The difference between planets goes beyond just different colorations. Additionally, all parameters of the noise function have random factors applied to them. Specifically, the strength of seven of the noise functions is multiplied by a factor between 80% and 120% depending on the planet. This can have quite wide-ranging effects. Furthermore, the way the octaves of the noise functions are combined is also slightly randomized, to either give more or less detail - number of octaves, as well as the rate of fall-off from the first to later octaves.
You might also notice the lively background. Stars are added randomly around the night sky with random luminosity. Additionally, I managed to get a rudimentary nebula-noise going. Honestly, it looks mostly like some sort of aurora. Taking out the distracting planet and turning up the colours of the aurora looks as follows:
As mentioned, it is still pretty simple, which shows when you focus on it too much. It is drawn using Perlin noise with very strong domain-warping, low-frequency domain warping. That is:
noise(ix/350,iy/350,25*noise(ix/1500,iy/1500))
And then some added stuff on top of that.
Anyway, code and demonstration can as always be found on my OpenProcessing.
Planets
Aurora
That looks great! I'm just curious though: why did you opt for the colored ring around the planet? It doesn't strike me as particularly realistic.
ReplyDeleteI've been using this script to "spherize" my world maps, are you using the same or did you write your own? http://code.activestate.com/recipes/580695-image-projection-onto-sphere/
I've been struggling with the north and south poles on my planets. I'd have to "warp" the world maps that I'm creating to somehow account for the fact that the top is really tiny while the middle is really large, but I've yet to get it right. The fact that I'm building my maps from an X*Y grid doesn't help, either, because there are essentially more X-es in the middle of the map than on the top and bottom.
Thanks!
DeleteThe coloured ring represents the atmosphere, though you are quite right, the colours are not chosen for realism, but for esthetic effect.
So, two points. First, to "sphericize" the map, I am finding the distance from the centre of the image to any given pixel, and then dividing its coordinates by cosinus of its distance before finding its height. In the middle where the distance is low, the coordinates are divided by 1, remaining the same. By the rim of the planet, where the distance closes in on pi/2, the distance is divided by a number close to zero, that is, inflated incredibly.
This only really works for rendering the planet without using an underlying grid, though.
When we're talking about generating actual 2D maps of a 3D sphere, it's not actually as hard as you'd imagine because of the existence of 3D noise. Just replace the X and Y coordinates with longitude and latitude and plop it into a "point on the surface of a sphere"-formula to get an x, y and z for the noise to use. This also makes sure the planet has continuous, wrapping terrain. Voila.
I don't know, it at least sounded like those were the issues you were having. But this does make me think I should do a full post about spherical terrain at some point.
Aaah, that sounds brilliant and yet so simple, thanks for the tip! Indeed, translating long,lat to x,y when creating a 2d plane to then "spherize" sounds like a much better plan than what I've been using. I'll give it a shot soon! :)
Delete