Class OpenSimplex2

java.lang.Object
net.paulhertz.pixelaudio.OpenSimplex2

public class OpenSimplex2 extends Object
K.jpg's OpenSimplex 2, faster variant from https://github.com/KdotJPG/OpenSimplex2
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static float
    noise2(long seed, double x, double y)
    2D Simplex noise, standard lattice orientation.
    static float
    noise2_ImproveX(long seed, double x, double y)
    2D Simplex noise, with Y pointing down the main diagonal.
    static float
    noise3_Fallback(long seed, double x, double y, double z)
    3D OpenSimplex2 noise, fallback rotation option Use noise3_ImproveXY or noise3_ImproveXZ instead, wherever appropriate.
    static float
    noise3_ImproveXY(long seed, double x, double y, double z)
    3D OpenSimplex2 noise, with better visual isotropy in (X, Y).
    static float
    noise3_ImproveXZ(long seed, double x, double y, double z)
    3D OpenSimplex2 noise, with better visual isotropy in (X, Z).
    static float
    noise4_Fallback(long seed, double x, double y, double z, double w)
    4D OpenSimplex2 noise, fallback lattice orientation.
    static float
    noise4_ImproveXY_ImproveZW(long seed, double x, double y, double z, double w)
    4D OpenSimplex2 noise, with XY and ZW forming orthogonal triangular-based planes.
    static float
    noise4_ImproveXYZ(long seed, double x, double y, double z, double w)
    4D OpenSimplex2 noise, with XYZ oriented like noise3_Fallback and W for an extra degree of freedom.
    static float
    noise4_ImproveXYZ_ImproveXY(long seed, double x, double y, double z, double w)
    4D OpenSimplex2 noise, with XYZ oriented like noise3_ImproveXY and W for an extra degree of freedom.
    static float
    noise4_ImproveXYZ_ImproveXZ(long seed, double x, double y, double z, double w)
    4D OpenSimplex2 noise, with XYZ oriented like noise3_ImproveXZ and W for an extra degree of freedom.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OpenSimplex2

      public OpenSimplex2()
  • Method Details

    • noise2

      public static float noise2(long seed, double x, double y)
      2D Simplex noise, standard lattice orientation.
    • noise2_ImproveX

      public static float noise2_ImproveX(long seed, double x, double y)
      2D Simplex noise, with Y pointing down the main diagonal. Might be better for a 2D sandbox style game, where Y is vertical. Probably slightly less optimal for heightmaps or continent maps, unless your map is centered around an equator. It's a subtle difference, but the option is here to make it an easy choice.
    • noise3_ImproveXY

      public static float noise3_ImproveXY(long seed, double x, double y, double z)
      3D OpenSimplex2 noise, with better visual isotropy in (X, Y). Recommended for 3D terrain and time-varied animations. The Z coordinate should always be the "different" coordinate in whatever your use case is. If Y is vertical in world coordinates, call noise3_ImproveXZ(x, z, Y) or use noise3_XZBeforeY. If Z is vertical in world coordinates, call noise3_ImproveXZ(x, y, Z). For a time varied animation, call noise3_ImproveXY(x, y, T).
    • noise3_ImproveXZ

      public static float noise3_ImproveXZ(long seed, double x, double y, double z)
      3D OpenSimplex2 noise, with better visual isotropy in (X, Z). Recommended for 3D terrain and time-varied animations. The Y coordinate should always be the "different" coordinate in whatever your use case is. If Y is vertical in world coordinates, call noise3_ImproveXZ(x, Y, z). If Z is vertical in world coordinates, call noise3_ImproveXZ(x, Z, y) or use noise3_ImproveXY. For a time varied animation, call noise3_ImproveXZ(x, T, y) or use noise3_ImproveXY.
    • noise3_Fallback

      public static float noise3_Fallback(long seed, double x, double y, double z)
      3D OpenSimplex2 noise, fallback rotation option Use noise3_ImproveXY or noise3_ImproveXZ instead, wherever appropriate. They have less diagonal bias. This function's best use is as a fallback.
    • noise4_ImproveXYZ_ImproveXY

      public static float noise4_ImproveXYZ_ImproveXY(long seed, double x, double y, double z, double w)
      4D OpenSimplex2 noise, with XYZ oriented like noise3_ImproveXY and W for an extra degree of freedom. W repeats eventually. Recommended for time-varied animations which texture a 3D object (W=time) in a space where Z is vertical
    • noise4_ImproveXYZ_ImproveXZ

      public static float noise4_ImproveXYZ_ImproveXZ(long seed, double x, double y, double z, double w)
      4D OpenSimplex2 noise, with XYZ oriented like noise3_ImproveXZ and W for an extra degree of freedom. W repeats eventually. Recommended for time-varied animations which texture a 3D object (W=time) in a space where Y is vertical
    • noise4_ImproveXYZ

      public static float noise4_ImproveXYZ(long seed, double x, double y, double z, double w)
      4D OpenSimplex2 noise, with XYZ oriented like noise3_Fallback and W for an extra degree of freedom. W repeats eventually. Recommended for time-varied animations which texture a 3D object (W=time) where there isn't a clear distinction between horizontal and vertical
    • noise4_ImproveXY_ImproveZW

      public static float noise4_ImproveXY_ImproveZW(long seed, double x, double y, double z, double w)
      4D OpenSimplex2 noise, with XY and ZW forming orthogonal triangular-based planes. Recommended for 3D terrain, where X and Y (or Z and W) are horizontal. Recommended for noise(x, y, sin(time), cos(time)) trick.
    • noise4_Fallback

      public static float noise4_Fallback(long seed, double x, double y, double z, double w)
      4D OpenSimplex2 noise, fallback lattice orientation.