noise_cubic {ambient}R Documentation

Cubic noise generator

Description

Cubic noise is a pretty simple alternative to perlin and simplex noise. In essence it takes a low resolution white noise and scales it up using cubic interpolation. This approach means that while cubic noise is smooth, it is much more random than perlin and simplex noise.

Usage

noise_cubic(dim, frequency = 0.01, fractal = "fbm", octaves = 3,
  lacunarity = 2, gain = 0.5, pertubation = "none",
  pertubation_amplitude = 1)

Arguments

dim

The dimensions (height, width, (and depth)) of the noise to be generated. The length determines the dimensionality of the noise.

frequency

Determines the granularity of the features in the noise.

fractal

The fractal type to use. Either 'none', 'fbm' (default), 'billow', or 'rigid-multi'. It is suggested that you experiment with the different types to get a feel for how they behaves.

octaves

The number of noise layers used to create the fractal noise. Ignored if fractal = 'none'. Defaults to 3.

lacunarity

The frequency multiplier between successive noise layers when building fractal noise. Ignored if fractal = 'none'. Defaults to 2.

gain

The relative strength between successive noise layers when building fractal noise. Ignored if fractal = 'none'. Defaults to 0.5.

pertubation

The pertubation to use. Either 'none' (default), 'normal', or 'fractal'. Defines the displacement (warping) of the noise, with 'normal' giving a smooth warping and 'fractal' giving a more eratic warping.

pertubation_amplitude

The maximal pertubation distance from the origin. Ignored if pertubation = 'none'. Defaults to 1.

Value

If length(dim) == 2 a matrix, if length(dim) == 3 a 3-dimensional array.

Examples

# Basic use
noise <- noise_cubic(c(100, 100))

image(noise, col = grey.colors(256, 0, 1))


[Package ambient version 0.1.0 Index]