• 1.摘要
  • 2.基本信息
  • 3.基本内容

柏林噪声

自然噪声生成算法

Perlin噪声 ( Perlin noise )指由Ken Perlin发明的自然噪声生成算法 。

基本信息

  • 中文名

    柏林噪声

  • 外文名

    Perlin noise

  • 柏林噪声

    一种自然噪声生成算法

基本内容

一个噪声函数基本上是一个种子随机发生器。它需要一个整数作为参数,然后根据这个参数返回一个随机数。如果你两次都传同一个参数进来,它就会产生两次相同的数。这条规律非常重要,否则柏林函数只是生成一堆垃圾。

Here is a graph showing an example noise function. A random value between 0 and1 is assigned to every

point on the X axis.

这里的一张图展现了噪声函数的一个例子。X轴上每个点被赋予一个0到1之间的随机数。

By smoothly interpolating between the values, we can define a continuous function that takes a non-integer as a parameter. I will discuss various ways of interpolating the values later in this article.

通过在值之间平滑的插值,我们定义了一个带有一个非整参数的连续函数。我们将会在后面的内容中讨论多种插值方式

Definitions

定义

Before I go any further, let me define what I mean by amplitude and frequency. If you have studied physics, you may well have come across the concept of amplitude and frequency applied to a sin wave.

当我们准备深入之前,让我定义下什么是振幅(amplitude)和频率(frequency)。如果你学过物理,你可能遇到过在正玄波中振幅(amlitude)和频率(frequency)的概念。

Sin Wave

The wavelength of a sin wave is the distance from one peak to another. The amplitude is the height of the wave. The frequency is defined to be 1/wavelength.

正玄波

正玄波的波长(wavelength)是两个波峰只间的距离。振幅是此波的高度。频率我们定义为 1/波长(wavelength)。

Noise Wave

In the graph of this example noise function, the red spots indicate the random values defined along the dimension of the function. In this case, the amplitude is the difference between the minimum and maximum values the function could have. The wavelength is the distance from one red spot to the next. Again frequency is defined to be 1/wavelength.

噪声波

这个噪声波的例子中,红点表示定义沿着在函数维上的随机值。在这种情况下,振幅是这个函数的最大值与最小值的差值。波长(wavelength)是两个红点之间的距离。同样的频率(frequency)定义为1/波长(wavelength).