Noise

Library for generating and interacting with noise maps.


Source: pkg/lua/lib/noise.go | Import: noise

Functions


simplex_image_new

simplex_image_new(seed, coef, normalize, name, encoding, width, height, model?, disableColor?, disableAlpha?) -> int<collection.IMAGE>

Creates a new image, setting each pixel of the image to the simplex_2d result of the x,y pos multiplied by coef. If color is disabled, r,g,b values are set to 255. If alpha is disabled, alpha is set to 255.

Arguments

  • seed int
  • coef float
  • normalize bool - Use noise values between (0,1) instead of (-1,1).
  • name string
  • encoding int<image.Encoding>
  • width int
  • height int
  • model int<image.ColorModel>
  • disableColor bool - Don't set r,g,b values using noise.
  • disableAlpha bool - Don't set alpha values using noise.
Return Values

  • int<collection.IMAGE>
simplex_image_map

simplex_image_map(seed, coef, id, normalize, disableColor?, disableAlpha?, keep?)

Loops over the pixels of an image, setting each pixel of the image to the simplex_2d result of the x,y pos multiplied by coef. If color is disabled, r,g,b values are set to 255. If alpha is disabled, alpha is set to 255. If keep is set, the disabled values will be kept in the image, useful for only changing the alpha channel of an image.

Arguments

  • seed int
  • coef float
  • id int<collection.IMAGE>
  • normalize bool - Use noise values between (0,1) instead of (-1,1).
  • disableColor bool - Don't set r,g,b values using noise.
  • disableAlpha bool - Don't set alpha values using noise.
  • keep bool - Maintain color or alpha channels if they're disabled.
simplex_2d

simplex_2d(seed, x, y, normalize?) - float

Arguments

  • seed int
  • x float
  • y float
  • normalize bool - Use noise values between (0,1) instead of (-1,1).
Return Values

  • float
simplex_3d

simplex_3d(seed, x, y, z, normalize?) -> float

Arguments

  • seed int
  • x float
  • y float
  • z float
  • normalize bool - Use noise values between (0,1) instead of (-1,1).
Return Values

  • float
simplex_4d

simplex_4d(seed, x, y, z, w, normalize?) -> float

Arguments

  • seed int
  • x float
  • y float
  • z float
  • w float
  • normalize bool - Use noise values between (0,1) instead of (-1,1).
Return Values

  • float