Class NoiseWrapper

java.lang.Object
com.github.yellowstonegames.grid.NoiseWrapper
All Implemented Interfaces:
com.github.yellowstonegames.core.ISerializersNeeded, INoise, Externalizable, Serializable
Direct Known Subclasses:
RadialNoiseWrapper

public class NoiseWrapper extends Object implements INoise, com.github.yellowstonegames.core.ISerializersNeeded
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface INoise

    INoise.Serializer
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    A less common way to layer octaves of noise, where most results are biased toward higher values, but "valleys" show up filled with much lower values.
    static final int
    Layered octaves of noise, where each octave has a different frequency and weight, and the results of earlier octaves affect the inputs to later octave calculations.
    static final int
    Layered octaves of noise with several noise calls per octave, and a complex set of connections between noise in the same octave.
    static final int
    "Standard" layered octaves of noise, where each octave has a different frequency and weight.
    boolean
     
    float
     
    int
     
    protected int
     
    static final int
    A way to layer octaves of noise so most values are biased toward low values but "ridges" of high values run across the noise.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
     
    NoiseWrapper(INoise toWrap, float frequency, int mode, int octaves)
     
    NoiseWrapper(INoise toWrap, float frequency, int mode, int octaves, boolean fractalSpiral)
     
    NoiseWrapper(INoise toWrap, long seed, float frequency, int mode, int octaves)
     
    NoiseWrapper(INoise toWrap, long seed, float frequency, int mode, int octaves, boolean fractalSpiral)
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    billow(float x, float y, float z, float w, float u, float v, long seed)
    Billow noise in 6D; this has large flat areas of fairly high values, with wiggly lines of low values running like folds throughout.
    float
    billow(float x, float y, float z, float w, float u, long seed)
    Billow noise in 5D; this has large flat areas of fairly high values, with wiggly lines of low values running like folds throughout.
    float
    billow(float x, float y, float z, float w, long seed)
    Billow noise in 4D; this has large flat areas of fairly high values, with wiggly lines of low values running like folds throughout.
    float
    billow(float x, float y, float z, long seed)
    Billow noise in 3D; this has large flat areas of fairly high values, with wiggly lines of low values running like folds throughout.
    float
    billow(float x, float y, long seed)
    Billow noise in 2D; this has large flat areas of fairly high values, with wiggly lines of low values running like folds throughout.
    Creates a copy of this INoise, which should be a deep copy for any mutable state but can be shallow for immutable types such as functions.
    boolean
     
    float
    exo(float x, float y, float z, float w, float u, float v, long seed)
    Exoplanet noise in 6D, meant to loosely imitate the battered surface of an alien world.
    float
    exo(float x, float y, float z, float w, float u, long seed)
    Exoplanet noise in 5D, meant to loosely imitate the battered surface of an alien world.
    float
    exo(float x, float y, float z, float w, long seed)
    Exoplanet noise in 4D, meant to loosely imitate the battered surface of an alien world.
    float
    exo(float x, float y, float z, long seed)
    Exoplanet noise in 3D, meant to loosely imitate the battered surface of an alien world.
    float
    exo(float x, float y, long seed)
    Exoplanet noise in 2D, meant to loosely imitate the battered surface of an alien world.
    float
    fbm(float x, float y, float z, float w, float u, float v, long seed)
    Fractal Brownian Motion noise in 6D; this starts fairly smooth, usually, and adds finer and finer detail with each additional octave.
    float
    fbm(float x, float y, float z, float w, float u, long seed)
    Fractal Brownian Motion noise in 5D; this starts fairly smooth, usually, and adds finer and finer detail with each additional octave.
    float
    fbm(float x, float y, float z, float w, long seed)
    Fractal Brownian Motion noise in 4D; this starts fairly smooth, usually, and adds finer and finer detail with each additional octave.
    float
    fbm(float x, float y, float z, long seed)
    Fractal Brownian Motion noise in 3D; this starts fairly smooth, usually, and adds finer and finer detail with each additional octave.
    float
    fbm(float x, float y, long seed)
    Fractal Brownian Motion noise in 2D; this starts fairly smooth, usually, and adds finer and finer detail with each additional octave.
    int
     
    int
     
    float
     
    int
    Gets the maximum dimension supported by this generator, such as 2 for a generator that only is defined for flat surfaces, or 7 for one that is defined up to the highest dimension this interface knows about (7D).
    int
    Gets the minimum dimension supported by this generator, such as 2 for a generator that only is defined for flat surfaces, or 3 for one that is only defined for 3D or higher-dimensional spaces.
    int
    float
    getNoise(float x, float y)
    Gets 2D noise with a default or pre-set seed.
    float
    getNoise(float x, float y, float z)
    Gets 3D noise with a default or pre-set seed.
    float
    getNoise(float x, float y, float z, float w)
    Gets 4D noise with a default or pre-set seed.
    float
    getNoise(float x, float y, float z, float w, float u)
    Gets 5D noise with a default or pre-set seed.
    float
    getNoise(float x, float y, float z, float w, float u, float v)
    Gets 6D noise with a default or pre-set seed.
    float
    getNoiseWithSeed(float x, float y, float z, float w, float u, float v, long seed)
    Gets 6D noise with a specific seed.
    float
    getNoiseWithSeed(float x, float y, float z, float w, float u, long seed)
    Gets 5D noise with a specific seed.
    float
    getNoiseWithSeed(float x, float y, float z, float w, long seed)
    Gets 4D noise with a specific seed.
    float
    getNoiseWithSeed(float x, float y, float z, long seed)
    Gets 3D noise with a specific seed.
    float
    getNoiseWithSeed(float x, float y, long seed)
    Gets 2D noise with a specific seed.
    int
    long
    Gets the current seed of the generator, as a long even if the seed is stored internally as an int.
     
    Returns a typically-four-character String constant that should uniquely identify this INoise as well as possible.
     
    boolean
    Returns true if this generator can be seeded with INoise.setSeed(long) during each call to obtain noise, or false if calling setSeed() is slow enough or allocates enough that alternative approaches should be used.
    int
     
    boolean
     
    float
    ridged(float x, float y, float z, float w, float u, float v, long seed)
    Ridged noise in 6D (sometimes called Ridged Multi-Fractal); this has large flat areas of low values, with wiggly lines of high values running like veins throughout.
    float
    ridged(float x, float y, float z, float w, float u, long seed)
    Ridged noise in 5D (sometimes called Ridged Multi-Fractal); this has large flat areas of low values, with wiggly lines of high values running like veins throughout.
    float
    ridged(float x, float y, float z, float w, long seed)
    Ridged noise in 4D (sometimes called Ridged Multi-Fractal); this has large flat areas of low values, with wiggly lines of high values running like veins throughout.
    float
    ridged(float x, float y, float z, long seed)
    Ridged noise in 3D (sometimes called Ridged Multi-Fractal); this has large flat areas of low values, with wiggly lines of high values running like veins throughout.
    float
    ridged(float x, float y, long seed)
    Ridged noise in 2D (sometimes called Ridged Multi-Fractal); this has large flat areas of low values, with wiggly lines of high values running like veins throughout.
    setFractalOctaves(int octaves)
     
    setFractalSpiral(boolean fractalSpiral)
     
    setFractalType(int mode)
     
    setFrequency(float frequency)
     
    setMode(int mode)
    setOctaves(int octaves)
    void
    setSeed(long seed)
    Sets the seed to the given long, if long seeds are supported, or (int)seed if only int seeds are supported.
    setWrapped(INoise wrapped)
     
    Given a serialized String produced by INoise.stringSerialize(), reassigns this INoise to have the described state from the given String.
    Produces a String that describes everything needed to recreate this INoise in full.
     
    float
    warp(float x, float y, float z, float w, float u, float v, long seed)
    Domain-warped noise in 6D; this is identical to fbm(float, float, float, float, float, float, long) with one octave, but with more it looks rounded and bubbly.
    float
    warp(float x, float y, float z, float w, float u, long seed)
    Domain-warped noise in 5D; this is identical to fbm(float, float, float, float, float, long) with one octave, but with more it looks rounded and bubbly.
    float
    warp(float x, float y, float z, float w, long seed)
    Domain-warped noise in 4D; this is identical to fbm(float, float, float, float, long) with one octave, but with more it looks rounded and bubbly.
    float
    warp(float x, float y, float z, long seed)
    Domain-warped noise in 3D; this is identical to fbm(float, float, float, long) with one octave, but with more it looks rounded and bubbly.
    float
    warp(float x, float y, long seed)
    Domain-warped noise in 2D; this is identical to fbm(float, float, long) with one octave, but with more it looks rounded and bubbly.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface INoise

    getNoise, getNoiseWithSeed, readExternal, writeExternal
  • Field Details

    • wrapped

      public INoise wrapped
    • frequency

      public float frequency
    • mode

      public int mode
    • octaves

      protected int octaves
    • fractalSpiral

      public boolean fractalSpiral
    • FBM

      public static final int FBM
      "Standard" layered octaves of noise, where each octave has a different frequency and weight. Tends to look cloudy with more octaves, and generally like a natural process.
      Meant to be used with setFractalType(int).
      See Also:
    • BILLOW

      public static final int BILLOW
      A less common way to layer octaves of noise, where most results are biased toward higher values, but "valleys" show up filled with much lower values.
      This works by finding "ridges" where the original noise produced values near 0.0, per octave, and producing outputs closer to -1.0 for original values closer to 0.0, but any original values further from 0.0 will produce outputs closer to 1.0. If a particular type of noise has a tendency to emit very mid-range output normally, using this fractal type will produce more low values, while if the original noise mostly emits extreme values (near 1.0 or -1.0), then this will produce more high ones.
      This probably has some good uses in 3D or higher noise, but it isn't used too frequently. It can be seen as the inverse of the RIDGED_MULTI fractal type.
      Meant to be used with setFractalType(int).
      See Also:
    • RIDGED_MULTI

      public static final int RIDGED_MULTI
      A way to layer octaves of noise so most values are biased toward low values but "ridges" of high values run across the noise. This can be a good way of highlighting the least-natural aspects of some kinds of noise; PerlinNoise has mostly ridges along 45-degree angles, SimplexNoise has many ridges along a triangular grid, and so on. FoamNoise and HoneyNoise do well with this mode, though, and look something like lightning or bubbling fluids, respectively. Some other INoise types based on Perlin or Simplex noise are meant to break up patterns in their ancestor, such as PerlueNoise, which gets rid of most "unnatural" artifacts from PerlinNoise.
      This works by finding "ridges" where the original noise produced values near 0.0, per octave, and producing outputs closer to 1.0 for original values closer to 0.0, but any original values further from 0.0 will produce outputs closer to -1.0. If a particular type of noise has a tendency to emit very mid-range output normally, using this fractal type will produce more high values, while if the original noise mostly emits extreme values (near 1.0 or -1.0), then this will produce more low ones.
      This is frequently used in terrain generation to produce mountain ridges. It can be seed as the inverse of the BILLOW fractal type.
      Meant to be used with setFractalType(int).
      See Also:
    • DOMAIN_WARP

      public static final int DOMAIN_WARP
      Layered octaves of noise, where each octave has a different frequency and weight, and the results of earlier octaves affect the inputs to later octave calculations. Tends to look cloudy but with swirling distortions, and generally like a natural process.
      Meant to be used with setFractalType(int).
      See Also:
    • EXO

      public static final int EXO
      Layered octaves of noise with several noise calls per octave, and a complex set of connections between noise in the same octave. Tends to have whorls and loops like a fingerprint, and looks reasonably natural (but more natural if the noise it uses has fewer artifacts). This is significantly slower than other modes, but looks more like high-octave noise even with few octaves. Some properties in this only appear with 2 or more octaves.
      See this blog post for more info. That post is also the namesake of this mode.
      Meant to be used with setFractalType(int).
      See Also:
  • Constructor Details

    • NoiseWrapper

      public NoiseWrapper()
    • NoiseWrapper

      public NoiseWrapper(INoise toWrap)
    • NoiseWrapper

      public NoiseWrapper(INoise toWrap, float frequency, int mode, int octaves)
    • NoiseWrapper

      public NoiseWrapper(INoise toWrap, float frequency, int mode, int octaves, boolean fractalSpiral)
    • NoiseWrapper

      public NoiseWrapper(INoise toWrap, long seed, float frequency, int mode, int octaves)
    • NoiseWrapper

      public NoiseWrapper(INoise toWrap, long seed, float frequency, int mode, int octaves, boolean fractalSpiral)
    • NoiseWrapper

      public NoiseWrapper(NoiseWrapper other)
  • Method Details

    • getWrapped

      public INoise getWrapped()
    • setWrapped

      public NoiseWrapper setWrapped(INoise wrapped)
    • getFrequency

      public float getFrequency()
    • setFrequency

      public NoiseWrapper setFrequency(float frequency)
    • getMode

      public int getMode()
      Returns:
      an int between 0 and 4, corresponding to FBM, BILLOW, RIDGED_MULTI, DOMAIN_WARP, or EXO
    • setMode

      public NoiseWrapper setMode(int mode)
      Parameters:
      mode - an int between 0 and 4, corresponding to FBM, BILLOW, RIDGED_MULTI, DOMAIN_WARP, or EXO
    • getFractalType

      public int getFractalType()
    • setFractalType

      public NoiseWrapper setFractalType(int mode)
      Parameters:
      mode - an int between 0 and 4, corresponding to FBM, BILLOW, RIDGED_MULTI, DOMAIN_WARP, or EXO
    • getOctaves

      public int getOctaves()
      Returns:
      how many octaves this uses to increase detail
    • setOctaves

      public NoiseWrapper setOctaves(int octaves)
      Parameters:
      octaves - how many octaves to use to increase detail; must be at least 1.
    • getFractalOctaves

      public int getFractalOctaves()
    • setFractalOctaves

      public NoiseWrapper setFractalOctaves(int octaves)
      Parameters:
      octaves - how many octaves to use to increase detail; must be at least 1.
    • isFractalSpiral

      public boolean isFractalSpiral()
    • setFractalSpiral

      public NoiseWrapper setFractalSpiral(boolean fractalSpiral)
    • getMinDimension

      public int getMinDimension()
      Description copied from interface: INoise
      Gets the minimum dimension supported by this generator, such as 2 for a generator that only is defined for flat surfaces, or 3 for one that is only defined for 3D or higher-dimensional spaces.
      Specified by:
      getMinDimension in interface INoise
      Returns:
      the minimum supported dimension, from 2 to 7 inclusive
    • getMaxDimension

      public int getMaxDimension()
      Description copied from interface: INoise
      Gets the maximum dimension supported by this generator, such as 2 for a generator that only is defined for flat surfaces, or 7 for one that is defined up to the highest dimension this interface knows about (7D).
      Specified by:
      getMaxDimension in interface INoise
      Returns:
      the maximum supported dimension, from 2 to 7 inclusive
    • hasEfficientSetSeed

      public boolean hasEfficientSetSeed()
      Description copied from interface: INoise
      Returns true if this generator can be seeded with INoise.setSeed(long) during each call to obtain noise, or false if calling setSeed() is slow enough or allocates enough that alternative approaches should be used. You can always call setSeed() on your own, but generators that don't have any seed won't do anything. Generators that return false for this method will generally behave differently when comparing how INoise.getNoiseWithSeed(float, float, long) changes the seed and how setSeed() does.
      Specified by:
      hasEfficientSetSeed in interface INoise
      Returns:
      whether INoise.setSeed(long) should be efficient to call in every INoise.getNoiseWithSeed(float, float, long) call
    • getTag

      public String getTag()
      Description copied from interface: INoise
      Returns a typically-four-character String constant that should uniquely identify this INoise as well as possible. If a duplicate tag is already registered and INoise.Serializer.register(INoise) attempts to register the same tag again, a message is printed to System.err. The default implementation returns the String (NO), which is essentially an invalid tag, meant to indicate that this was not fully implemented. Implementing this is required for any usage of Serializer.
      Specified by:
      getTag in interface INoise
      Returns:
      a short String constant that identifies this INoise type
    • stringSerialize

      public String stringSerialize()
      Description copied from interface: INoise
      Produces a String that describes everything needed to recreate this INoise in full. This String can be read back in by INoise.stringDeserialize(String) to reassign the described state to another INoise. The syntax here should always start and end with the ` character, which is used by INoise.stringDeserialize(String) to identify the portion of a String that can be read back. The ` character should not be otherwise used unless to serialize another INoise that this uses.
      If you use Base to produce String representations for numeric fields in an INoise, Base.BASE10 is strongly recommended; in most cases, you can just use string concatenation with the fields separated by the tilde character, "~". For printing a float field with Base to a StringBuilder sb, use Base.BASE10.appendGeneral(sb, field).
      The default implementation throws an UnsupportedOperationException only. INoise classes do not have to implement any serialization methods, but they aren't serializable by the methods in this class or in INoise.Serializer unless they do implement this, INoise.getTag(), INoise.stringDeserialize(String), and INoise.copy().
      Specified by:
      stringSerialize in interface INoise
      Returns:
      a String that describes this INoise for serialization
    • stringDeserialize

      public NoiseWrapper stringDeserialize(String data)
      Description copied from interface: INoise
      Given a serialized String produced by INoise.stringSerialize(), reassigns this INoise to have the described state from the given String. The serialized String must have been produced by the same class as this object is.
      Any class that implements INoise.stringSerialize() should also implement this method in a compatible way. Using base-10 is expected for most uses. Using Base.BASE10.readFloat(data, start, end) may be useful to parse only the part of data between start and end.
      The default implementation throws an UnsupportedOperationException only. INoise classes do not have to implement any serialization methods, but they aren't serializable by the methods in this class or in INoise.Serializer unless they do implement this, INoise.getTag(), INoise.stringSerialize(), and INoise.copy().
      Specified by:
      stringDeserialize in interface INoise
      Parameters:
      data - a serialized String, typically produced by INoise.stringSerialize()
      Returns:
      this INoise, after being modified (if possible)
    • copy

      public NoiseWrapper copy()
      Description copied from interface: INoise
      Creates a copy of this INoise, which should be a deep copy for any mutable state but can be shallow for immutable types such as functions. This almost always just calls a copy constructor.
      The default implementation throws an UnsupportedOperationException only. Implementors are strongly encouraged to implement this in general, and that is required to use an INoise class with INoise.Serializer.
      Specified by:
      copy in interface INoise
      Returns:
      a copy of this INoise
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface INoise
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getNoise

      public float getNoise(float x, float y)
      Description copied from interface: INoise
      Gets 2D noise with a default or pre-set seed.
      Specified by:
      getNoise in interface INoise
      Parameters:
      x - x position; can be any finite float
      y - y position; can be any finite float
      Returns:
      a noise value between -1.0f and 1.0f, both inclusive
    • getNoise

      public float getNoise(float x, float y, float z)
      Description copied from interface: INoise
      Gets 3D noise with a default or pre-set seed.
      Specified by:
      getNoise in interface INoise
      Parameters:
      x - x position; can be any finite float
      y - y position; can be any finite float
      z - z position; can be any finite float
      Returns:
      a noise value between -1.0f and 1.0f, both inclusive
    • getNoise

      public float getNoise(float x, float y, float z, float w)
      Description copied from interface: INoise
      Gets 4D noise with a default or pre-set seed.
      Specified by:
      getNoise in interface INoise
      Parameters:
      x - x position; can be any finite float
      y - y position; can be any finite float
      z - z position; can be any finite float
      w - w position; can be any finite float
      Returns:
      a noise value between -1.0f and 1.0f, both inclusive
    • getNoise

      public float getNoise(float x, float y, float z, float w, float u)
      Description copied from interface: INoise
      Gets 5D noise with a default or pre-set seed.
      Specified by:
      getNoise in interface INoise
      Parameters:
      x - x position; can be any finite float
      y - y position; can be any finite float
      z - z position; can be any finite float
      w - w position; can be any finite float
      u - u position; can be any finite float
      Returns:
      a noise value between -1.0f and 1.0f, both inclusive
    • getNoise

      public float getNoise(float x, float y, float z, float w, float u, float v)
      Description copied from interface: INoise
      Gets 6D noise with a default or pre-set seed.
      Specified by:
      getNoise in interface INoise
      Parameters:
      x - x position; can be any finite float
      y - y position; can be any finite float
      z - z position; can be any finite float
      w - w position; can be any finite float
      u - u position; can be any finite float
      v - v position; can be any finite float
      Returns:
      a noise value between -1.0f and 1.0f, both inclusive
    • getNoiseWithSeed

      public float getNoiseWithSeed(float x, float y, long seed)
      Description copied from interface: INoise
      Gets 2D noise with a specific seed. If the seed cannot be retrieved or changed per-call, then this falls back to changing the position instead of the seed; you can check if this will happen with INoise.hasEfficientSetSeed().
      Specified by:
      getNoiseWithSeed in interface INoise
      Parameters:
      x - x position; can be any finite float
      y - y position; can be any finite float
      seed - can be any long
      Returns:
      a noise value between -1.0f and 1.0f, both inclusive
    • getNoiseWithSeed

      public float getNoiseWithSeed(float x, float y, float z, long seed)
      Description copied from interface: INoise
      Gets 3D noise with a specific seed. If the seed cannot be retrieved or changed per-call, then this falls back to changing the position instead of the seed; you can check if this will happen with INoise.hasEfficientSetSeed().
      Specified by:
      getNoiseWithSeed in interface INoise
      Parameters:
      x - x position; can be any finite float
      y - y position; can be any finite float
      z - z position; can be any finite float
      seed - can be any long
      Returns:
      a noise value between -1.0f and 1.0f, both inclusive
    • getNoiseWithSeed

      public float getNoiseWithSeed(float x, float y, float z, float w, long seed)
      Description copied from interface: INoise
      Gets 4D noise with a specific seed. If the seed cannot be retrieved or changed per-call, then this falls back to changing the position instead of the seed; you can check if this will happen with INoise.hasEfficientSetSeed().
      Specified by:
      getNoiseWithSeed in interface INoise
      Parameters:
      x - x position; can be any finite float
      y - y position; can be any finite float
      z - z position; can be any finite float
      w - w position; can be any finite float
      seed - can be any long
      Returns:
      a noise value between -1.0f and 1.0f, both inclusive
    • getNoiseWithSeed

      public float getNoiseWithSeed(float x, float y, float z, float w, float u, long seed)
      Description copied from interface: INoise
      Gets 5D noise with a specific seed. If the seed cannot be retrieved or changed per-call, then this falls back to changing the position instead of the seed; you can check if this will happen with INoise.hasEfficientSetSeed().
      Specified by:
      getNoiseWithSeed in interface INoise
      Parameters:
      x - x position; can be any finite float
      y - y position; can be any finite float
      z - z position; can be any finite float
      w - w position; can be any finite float
      u - u position; can be any finite float
      seed - can be any long
      Returns:
      a noise value between -1.0f and 1.0f, both inclusive
    • getNoiseWithSeed

      public float getNoiseWithSeed(float x, float y, float z, float w, float u, float v, long seed)
      Description copied from interface: INoise
      Gets 6D noise with a specific seed. If the seed cannot be retrieved or changed per-call, then this falls back to changing the position instead of the seed; you can check if this will happen with INoise.hasEfficientSetSeed().
      Specified by:
      getNoiseWithSeed in interface INoise
      Parameters:
      x - x position; can be any finite float
      y - y position; can be any finite float
      z - z position; can be any finite float
      w - w position; can be any finite float
      u - u position; can be any finite float
      v - v position; can be any finite float
      seed - can be any long
      Returns:
      a noise value between -1.0f and 1.0f, both inclusive
    • fbm

      public float fbm(float x, float y, long seed)
      Fractal Brownian Motion noise in 2D; this starts fairly smooth, usually, and adds finer and finer detail with each additional octave. This is often considered the primary or default type of continuous noise. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • billow

      public float billow(float x, float y, long seed)
      Billow noise in 2D; this has large flat areas of fairly high values, with wiggly lines of low values running like folds throughout. Much like ridged(float, float, long) if it was inverted high-to-low. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • ridged

      public float ridged(float x, float y, long seed)
      Ridged noise in 2D (sometimes called Ridged Multi-Fractal); this has large flat areas of low values, with wiggly lines of high values running like veins throughout. Much like billow(float, float, long) if it was inverted high-to-low. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • warp

      public float warp(float x, float y, long seed)
      Domain-warped noise in 2D; this is identical to fbm(float, float, long) with one octave, but with more it looks rounded and bubbly. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • exo

      public float exo(float x, float y, long seed)
      Exoplanet noise in 2D, meant to loosely imitate the battered surface of an alien world. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • fbm

      public float fbm(float x, float y, float z, long seed)
      Fractal Brownian Motion noise in 3D; this starts fairly smooth, usually, and adds finer and finer detail with each additional octave. This is often considered the primary or default type of continuous noise. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      z - third dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • billow

      public float billow(float x, float y, float z, long seed)
      Billow noise in 3D; this has large flat areas of fairly high values, with wiggly lines of low values running like folds throughout. Much like ridged(float, float, float, long) if it was inverted high-to-low. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      z - third dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • ridged

      public float ridged(float x, float y, float z, long seed)
      Ridged noise in 3D (sometimes called Ridged Multi-Fractal); this has large flat areas of low values, with wiggly lines of high values running like veins throughout. Much like billow(float, float, float, long) if it was inverted high-to-low. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      z - third dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • warp

      public float warp(float x, float y, float z, long seed)
      Domain-warped noise in 3D; this is identical to fbm(float, float, float, long) with one octave, but with more it looks rounded and bubbly. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      z - third dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • exo

      public float exo(float x, float y, float z, long seed)
      Exoplanet noise in 3D, meant to loosely imitate the battered surface of an alien world. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      z - third dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • fbm

      public float fbm(float x, float y, float z, float w, long seed)
      Fractal Brownian Motion noise in 4D; this starts fairly smooth, usually, and adds finer and finer detail with each additional octave. This is often considered the primary or default type of continuous noise. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      z - third dimension parameter; not adjusted by frequency
      w - fourth dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • billow

      public float billow(float x, float y, float z, float w, long seed)
      Billow noise in 4D; this has large flat areas of fairly high values, with wiggly lines of low values running like folds throughout. Much like ridged(float, float, float, float, long) if it was inverted high-to-low. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      z - third dimension parameter; not adjusted by frequency
      w - fourth dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • ridged

      public float ridged(float x, float y, float z, float w, long seed)
      Ridged noise in 4D (sometimes called Ridged Multi-Fractal); this has large flat areas of low values, with wiggly lines of high values running like veins throughout. Much like billow(float, float, float, float, long) if it was inverted high-to-low. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      z - third dimension parameter; not adjusted by frequency
      w - fourth dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • warp

      public float warp(float x, float y, float z, float w, long seed)
      Domain-warped noise in 4D; this is identical to fbm(float, float, float, float, long) with one octave, but with more it looks rounded and bubbly. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      z - third dimension parameter; not adjusted by frequency
      w - fourth dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • exo

      public float exo(float x, float y, float z, float w, long seed)
      Exoplanet noise in 4D, meant to loosely imitate the battered surface of an alien world. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      z - third dimension parameter; not adjusted by frequency
      w - fourth dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • fbm

      public float fbm(float x, float y, float z, float w, float u, long seed)
      Fractal Brownian Motion noise in 5D; this starts fairly smooth, usually, and adds finer and finer detail with each additional octave. This is often considered the primary or default type of continuous noise. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      z - third dimension parameter; not adjusted by frequency
      w - fourth dimension parameter; not adjusted by frequency
      u - fifth dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • billow

      public float billow(float x, float y, float z, float w, float u, long seed)
      Billow noise in 5D; this has large flat areas of fairly high values, with wiggly lines of low values running like folds throughout. Much like ridged(float, float, float, float, float, long) if it was inverted high-to-low. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      z - third dimension parameter; not adjusted by frequency
      w - fourth dimension parameter; not adjusted by frequency
      u - fifth dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • ridged

      public float ridged(float x, float y, float z, float w, float u, long seed)
      Ridged noise in 5D (sometimes called Ridged Multi-Fractal); this has large flat areas of low values, with wiggly lines of high values running like veins throughout. Much like billow(float, float, float, float, float, long) if it was inverted high-to-low. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      z - third dimension parameter; not adjusted by frequency
      w - fourth dimension parameter; not adjusted by frequency
      u - fifth dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • warp

      public float warp(float x, float y, float z, float w, float u, long seed)
      Domain-warped noise in 5D; this is identical to fbm(float, float, float, float, float, long) with one octave, but with more it looks rounded and bubbly. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      z - third dimension parameter; not adjusted by frequency
      w - fourth dimension parameter; not adjusted by frequency
      u - fifth dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • exo

      public float exo(float x, float y, float z, float w, float u, long seed)
      Exoplanet noise in 5D, meant to loosely imitate the battered surface of an alien world. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      z - third dimension parameter; not adjusted by frequency
      w - fourth dimension parameter; not adjusted by frequency
      u - fifth dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • fbm

      public float fbm(float x, float y, float z, float w, float u, float v, long seed)
      Fractal Brownian Motion noise in 6D; this starts fairly smooth, usually, and adds finer and finer detail with each additional octave. This is often considered the primary or default type of continuous noise. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      z - third dimension parameter; not adjusted by frequency
      w - fourth dimension parameter; not adjusted by frequency
      u - fifth dimension parameter; not adjusted by frequency
      v - sixth dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • billow

      public float billow(float x, float y, float z, float w, float u, float v, long seed)
      Billow noise in 6D; this has large flat areas of fairly high values, with wiggly lines of low values running like folds throughout. Much like ridged(float, float, float, float, float, float, long) if it was inverted high-to-low. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      z - third dimension parameter; not adjusted by frequency
      w - fourth dimension parameter; not adjusted by frequency
      u - fifth dimension parameter; not adjusted by frequency
      v - sixth dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • ridged

      public float ridged(float x, float y, float z, float w, float u, float v, long seed)
      Ridged noise in 6D (sometimes called Ridged Multi-Fractal); this has large flat areas of low values, with wiggly lines of high values running like veins throughout. Much like billow(float, float, float, float, float, float, long) if it was inverted high-to-low. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      z - third dimension parameter; not adjusted by frequency
      w - fourth dimension parameter; not adjusted by frequency
      u - fifth dimension parameter; not adjusted by frequency
      v - sixth dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • warp

      public float warp(float x, float y, float z, float w, float u, float v, long seed)
      Domain-warped noise in 6D; this is identical to fbm(float, float, float, float, float, float, long) with one octave, but with more it looks rounded and bubbly. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      z - third dimension parameter; not adjusted by frequency
      w - fourth dimension parameter; not adjusted by frequency
      u - fifth dimension parameter; not adjusted by frequency
      v - sixth dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • exo

      public float exo(float x, float y, float z, float w, float u, float v, long seed)
      Exoplanet noise in 6D, meant to loosely imitate the battered surface of an alien world. Does not adjust coordinate parameters by frequency; you can do this yourself.
      Parameters:
      x - first dimension parameter; not adjusted by frequency
      y - second dimension parameter; not adjusted by frequency
      z - third dimension parameter; not adjusted by frequency
      w - fourth dimension parameter; not adjusted by frequency
      u - fifth dimension parameter; not adjusted by frequency
      v - sixth dimension parameter; not adjusted by frequency
      seed - any long; should be the same for noise that should be continuous
      Returns:
      a noise result between -1f and 1f
    • getSeed

      public long getSeed()
      Description copied from interface: INoise
      Gets the current seed of the generator, as a long even if the seed is stored internally as an int. This must be implemented, but if the generator doesn't have a seed that can be expressed as a long (potentially using BitConversion.floatToIntBits(float)), this can just return 0.
      Specified by:
      getSeed in interface INoise
      Returns:
      the current seed, as a long
    • setSeed

      public void setSeed(long seed)
      Description copied from interface: INoise
      Sets the seed to the given long, if long seeds are supported, or (int)seed if only int seeds are supported. If this generator cannot be seeded, this should do nothing, and should not throw an exception. If this operation allocates or is time-intensive, then INoise.hasEfficientSetSeed() should return false. That method is checked in INoise.getNoiseWithSeed(float, float, long), and if it returns false, the noise call will avoid calling setSeed(). You can always at least try to set the seed, even if it does nothing or is heavy on performance, and doing it a few times each frame should typically be fine for any generator. In the case this is called thousands of times each frame, check INoise.hasEfficientSetSeed().
      Specified by:
      setSeed in interface INoise
      Parameters:
      seed - a long or int seed, with no restrictions unless otherwise documented
    • getSerializersNeeded

      public List<Class<?>> getSerializersNeeded()
      Specified by:
      getSerializersNeeded in interface com.github.yellowstonegames.core.ISerializersNeeded