Learn R Programming

ambient

ambient is a an R package that provides access to the FastNoise C++ library for generating noise. As such it provides fast generation of perlin, value, cubic, and worley noise in 2 and 3 dimensions, as well as simplex and white noise in 2, 3, and 4 dimensions. Further, it provides pattern generators and other utilities that can be used for modifying and working with noise.

Most of the noise patterns can be generated as fractals as well with support for fbm, billow and rigid-multifractal, and can optionally be pertubed.

There’s not much more to it. If you are in need of a noise generator ambient is your friend, if not you probably shouldn’t care.

Installation

ambient can be installed from CRAN using install.packages('ambient'), or you may get the development version from github using devtools:

# install.packages('pak')
pak::pak("thomasp85/ambient")

Examples

ambient provides a direct interface to the FastNoise functions by requesting a matrix/array of noise values, with a range of settings for pertubation and fractals:

library(ambient)
simplex <- noise_simplex(c(500, 500), pertubation = 'normal', 
                         pertubation_amplitude = 40)
plot(as.raster(normalise(simplex)))

much more powerful, however, is the tidy interface that allows full control of how the values should be calculated and combined:

library(dplyr)

long_grid(x = seq(0, 10, length.out = 1000), 
          y = seq(0, 10, length.out = 1000)) %>% 
  mutate(
    x1 = x + gen_simplex(x, y) / 2, 
    y1 = y + gen_simplex(x, y) / 2,
    worley = gen_worley(x, y, value = 'distance', seed = 5),
    worley_frac = fracture(gen_worley, ridged, octaves = 8, x = x, y = y, 
                           value = 'distance', seed = 5),
    full = blend(normalise(worley), normalise(worley_frac), gen_spheres(x1, y1))
  ) %>% 
  plot(full)

Copy Link

Version

Install

install.packages('ambient')

Monthly Downloads

3,607

Version

1.0.3

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Thomas Pedersen

Last Published

December 4th, 2025

Functions in ambient (1.0.3)

long_grid

Create a long format grid
noise_white

White noise generator
noise_cubic

Cubic noise generator
noise_simplex

Simplex noise generator
noise_blue

Blue noise generator
modifications

Simply value modifications
noise_value

Value noise generator
noise_worley

Worley (cell) noise generator
noise_perlin

Perlin noise generator
ridged

Ridged-Multi fractal
trans_affine

Apply linear transformation to a long_grid
fbm

Fractional Brownian Motion fractal
billow

Billow (cloud-like, lumpy) fractal
ambient-package

ambient: A Generator of Multidimensional Noise
gen_spheres

Generate a pattern of concentric spheres
clamped

Clamped fractal
fracture

Create fractals of a noise or pattern
curl_noise

Generate curl noise
gen_checkerboard

Generate a checkerboard pattern
gradient_noise

Calculate the gradient of a scalar field
gen_waves

Generate a wave pattern