Interface INoise

All Known Implementing Classes:
NoiseSimplex

public interface INoise
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Evaluates the noise.
    default double
    fbm(Vec3 v, FbmOpts opts)
    Generates 3D Fractional Brownian motion (fBm) from the implementing noise.
    default double
    map(double value, double min1, double max1, double min2, double max2)
    Maps a value from one range to another.
    default double
    normalize(double v)
    Normalises a value from [-1,1] to [0,1].
    default double
    permute(double x)
    Permutation function used by the Simplex noise implementation.
    default double
    rand(double n)
    Single float random based on a seed.
    default double
    2‑D random based on a vec2.
    default Vec3
    3‑D random based on a vec3.
    default Vec2
    2‑D random hash.
    default Vec3
    3‑D random hash (used by GLSL rand3).
    default Vec4
    4‑D random hash (mirrors GLSL rand4).
    default double
    taylorInvSqrt(double r)
    Taylor inverse square root approximation used in GLSL.
  • Field Details

  • Method Details

    • evaluate

      double evaluate(Vec3 p)
      Evaluates the noise.
      Parameters:
      p - The point at which the noise must be evaluated.
      Returns:
      The noise value.
    • fbm

      default double fbm(Vec3 v, FbmOpts opts)
      Generates 3D Fractional Brownian motion (fBm) from the implementing noise. Mirrors the GLSL gln_sfbm function from assets/shader/lib/noise/simplex.glsl with the fbm.glsl include block.
      Parameters:
      v - Point to sample fBm at.
      opts - Options for fBm generation (see FbmOpts).
      Returns:
      Value of fBm at point "v".
    • permute

      default double permute(double x)
      Permutation function used by the Simplex noise implementation. Equivalent to GLSL: mod(((x * 34.0) + 1.0) * x, 289.0)
    • taylorInvSqrt

      default double taylorInvSqrt(double r)
      Taylor inverse square root approximation used in GLSL. Equivalent to: 1.79284291400159 - 0.85373472095314 * r
    • map

      default double map(double value, double min1, double max1, double min2, double max2)
      Maps a value from one range to another.
    • normalize

      default double normalize(double v)
      Normalises a value from [-1,1] to [0,1].
    • rand2

      default Vec2 rand2(Vec2 p)
      2‑D random hash.
    • rand3

      default Vec3 rand3(Vec3 p)
      3‑D random hash (used by GLSL rand3).
    • rand4

      default Vec4 rand4(Vec4 p)
      4‑D random hash (mirrors GLSL rand4).
    • rand

      default double rand(double n)
      Single float random based on a seed.
    • rand

      default double rand(Vec2 p)
      2‑D random based on a vec2.
    • rand

      default Vec3 rand(Vec3 p)
      3‑D random based on a vec3.