OpenSimplexNoise

Inherits: Resource < Reference < Object

Category: Core

Brief Description

Noise generator based on Open Simplex.

Properties

floatlacunarity
intoctaves
floatperiod
floatpersistence
intseed

Methods

Imageget_image ( int width, int height )
floatget_noise_2d ( float x, float y )
floatget_noise_2dv ( Vector2 pos )
floatget_noise_3d ( float x, float y, float z )
floatget_noise_3dv ( Vector3 pos )
floatget_noise_4d ( float x, float y, float z, float w )
Imageget_seamless_image ( int size )

Description

This resource allows you to configure and sample a fractal noise space. Here is a brief usage example that configures an OpenSimplexNoise and gets samples at various positions and dimensions:

  1. var noise = OpenSimplexNoise.new()
  2. # Configure
  3. noise.seed = randi()
  4. noise.octaves = 4
  5. noise.period = 20.0
  6. noise.persistence = 0.8
  7. # Sample
  8. print("Values:")
  9. print(noise.get_noise_2d(1.0, 1.0))
  10. print(noise.get_noise_3d(0.5, 3.0, 15.0))
  11. print(noise.get_noise_4d(0.5, 1.9, 4.7, 0.0))

Property Descriptions

Setterset_lacunarity(value)
Getterget_lacunarity()

Difference in period between octaves.


Setterset_octaves(value)
Getterget_octaves()

Number of OpenSimplex noise layers that are sampled to get the fractal noise.


Setterset_period(value)
Getterget_period()

Period of the base octave. A lower period results in a higher-frequency noise (more value changes across the same distance).


Setterset_persistence(value)
Getterget_persistence()

Contribution factor of the different octaves. A persistence value of 1 means all the octaves have the same contribution, a value of 0.5 means each octave contributes half as much as the previous one.


Setterset_seed(value)
Getterget_seed()

Seed used to generate random values, different seeds will generate different noise maps.

Method Descriptions

Generate a noise image with the requested width and height, based on the current noise parameters.


Returns the 2D noise value [-1,1] at the given position.


Returns the 2D noise value [-1,1] at the given position.


Returns the 3D noise value [-1,1] at the given position.


Returns the 3D noise value [-1,1] at the given position.


Returns the 4D noise value [-1,1] at the given position.


Generate a tileable noise image, based on the current noise parameters. Generated seamless images are always square (size x size).