Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perlin Noise detail level. How to zoom in on a landscape?

I've written my own Perlin Noise implementation and it works well. I can 'zoom' in and out by changing the frequency, but as I zoom in the noise gets smoother and smoother.

Assume I have a landscape that displays a continent. I want to zoom in down to a city-size area (or closer), but still have detail. I think I need to re-generate the landscape at the closer detail but I'm not sure if there are any implementations that can help with that?

Zoomed out, I see the continent and oceans, but I want to have large regions represented in small areas.

Here is an example of the problem I'm having (Continent level):

alt text
(source: blind-games.com)

Zoomed in:

alt text
(source: blind-games.com)

How can I still get rich detail when zooming in to an area on the map? Any examples of techniques involved?

like image 923
Jason Avatar asked Jul 18 '10 00:07

Jason


People also ask

What is octaves in Perlin noise?

Perlin noise combines multiple functions called 'octaves' to produce natural looking surfaces. Each octave adds a layer of detail to the surface. For example: octave 1 could be mountains, octave 2 could be boulders, octave 3 could be the rocks.

Does Minecraft use 2d or 3D Perlin noise?

Minecraft is specifically using Perlin noise calculations, like the kind you'd use to create a rough-looking texture for a 3D model.

What is Lacunarity noise?

Lacunarity determines the change in frequency between octaves. Smaller values result in coarser noise with more visible structure; finer values result in finer, more uniform noise. The default value is 2. 0 .

What is persistence in Perlin noise?

Persistence. A multiplier that determines how quickly the amplitudes diminish for each successive octave in a Perlin-noise function. The amplitude of each successive octave is equal to the product of the previous octave's amplitude and the persistence value. Increasing the persistence produces "rougher" Perlin noise.


2 Answers

You need to generate using noise at successively higher frequencies to avoid the smoothness. Try http://www.arendpeter.com/Perlin_Noise.html for a clearer explanation of how to manipulate noise frequency. Octaves naturally fit together with a level of detail (LOD) implementation, which as long as you support on the fly generation, means you only have to generate more detail as you move close to it. Be aware that there are draw backs to on the fly generation of terrain, such as complicating generation of features like rivers and roads, so you may end up with pre-generation of terrain to a fixed minimum level of detail (e.g. 64 km grid squares), and then on the fly generation of more detailed features.

I'd also recommend looking at Simplex noise which has lower computational overhead (see https://en.wikipedia.org/wiki/Simplex_noise for more details).

like image 144
andrewdoull Avatar answered Sep 28 '22 09:09

andrewdoull


Assuming that you're generating the map files statically rather than on the fly I think your simplest solution is to generate the entire map at the highest resolution you require. In effect you're then zooming out and back in to that level of granularity. It's more computationally expensive and will yield larger map files. Depending upon your implementation for the viewer you can either use one single map file or build some de-resolutioned files for the bigger view.

like image 23
Miles Gillham Avatar answered Sep 28 '22 08:09

Miles Gillham