Class OpenSimplex2S

java.lang.Object
org.openpatch.scratch.internal.OpenSimplex2S

public class OpenSimplex2S extends Object
K.jpg's OpenSimplex 2, smooth variant ("SuperSimplex")

More language ports, as well as legacy 2014 OpenSimplex, can be found here: 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 OpenSimplex2S/SuperSimplex noise, standard lattice orientation.
    static float
    noise2_ImproveX(long seed, double x, double y)
    2D OpenSimplex2S/SuperSimplex noise, with Y pointing down the main diagonal.
    static float
    noise3_Fallback(long seed, double x, double y, double z)
    3D OpenSimplex2S/SuperSimplex 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 OpenSimplex2S/SuperSimplex noise, with better visual isotropy in (X, Y).
    static float
    noise3_ImproveXZ(long seed, double x, double y, double z)
    3D OpenSimplex2S/SuperSimplex noise, with better visual isotropy in (X, Z).
    static float
    noise4_Fallback(long seed, double x, double y, double z, double w)
    4D SuperSimplex noise, fallback lattice orientation.
    static float
    noise4_ImproveXY_ImproveZW(long seed, double x, double y, double z, double w)
    4D SuperSimplex 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 SuperSimplex 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 SuperSimplex 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 SuperSimplex 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

    • OpenSimplex2S

      public OpenSimplex2S()
  • Method Details

    • noise2

      public static float noise2(long seed, double x, double y)
      2D OpenSimplex2S/SuperSimplex noise, standard lattice orientation.
      Parameters:
      seed - the seed
      x - the x coordinate
      y - the y coordinate
    • noise2_ImproveX

      public static float noise2_ImproveX(long seed, double x, double y)
      2D OpenSimplex2S/SuperSimplex 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 slight difference, but the option is here to make it easy.
      Parameters:
      seed - the seed
      x - the x coordinate
      y - the y coordinate
    • noise3_ImproveXY

      public static float noise3_ImproveXY(long seed, double x, double y, double z)
      3D OpenSimplex2S/SuperSimplex 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).
      Parameters:
      seed - the seed
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
    • noise3_ImproveXZ

      public static float noise3_ImproveXZ(long seed, double x, double y, double z)
      3D OpenSimplex2S/SuperSimplex 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.
      Parameters:
      seed - the seed
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
    • noise3_Fallback

      public static float noise3_Fallback(long seed, double x, double y, double z)
      3D OpenSimplex2S/SuperSimplex 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.
      Parameters:
      seed - the seed
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
    • noise4_ImproveXYZ_ImproveXY

      public static float noise4_ImproveXYZ_ImproveXY(long seed, double x, double y, double z, double w)
      4D SuperSimplex 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
      Parameters:
      seed - the seed
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
      w - the w coordinate
    • noise4_ImproveXYZ_ImproveXZ

      public static float noise4_ImproveXYZ_ImproveXZ(long seed, double x, double y, double z, double w)
      4D SuperSimplex 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
      Parameters:
      seed - the seed
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
      w - the w coordinate
    • noise4_ImproveXYZ

      public static float noise4_ImproveXYZ(long seed, double x, double y, double z, double w)
      4D SuperSimplex 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
      Parameters:
      seed - the seed
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
      w - the w coordinate
    • noise4_ImproveXY_ImproveZW

      public static float noise4_ImproveXY_ImproveZW(long seed, double x, double y, double z, double w)
      4D SuperSimplex 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.
      Parameters:
      seed - the seed
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
      w - the w coordinate
    • noise4_Fallback

      public static float noise4_Fallback(long seed, double x, double y, double z, double w)
      4D SuperSimplex noise, fallback lattice orientation.
      Parameters:
      seed - the seed
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
      w - the w coordinate