Class Noise
java.lang.Object
com.github.yellowstonegames.grid.Noise
- All Implemented Interfaces:
INoise, Externalizable, Serializable
A wide range of noise functions that can all be called from one configurable object. Originally from Jordan Peck's
FastNoise library (these functions are sometimes, but not always, very fast for noise that doesn't use the GPU).
This also allows a lot of configuration, and the API is large. This file is over 10,000 lines long (including Java
source, comments, and blank lines), and navigating it is a challenge. If you are reading the source here, the newer
approach for noise code added more recently is to implement
Some key parts to keep in mind when using this class:
INoise, like this, but to only implement one
noise algorithm per INoise class, and to use NoiseWrapper to handle most of what this class does to produce
a wider variety of noise "flavors." You can still use this class like any other INoise, including modifying its
output with a NoiseAdjustment or even using a Noise in a NoiseWrapper.
Some key parts to keep in mind when using this class:
- The noise type, set with
setNoiseType(int), controls what algorithm this uses to generate noise, and affects most of the other options. Choose a "_FRACTAL" noise type likeSIMPLEX_FRACTAL(the default) if you want to use any of the fractal options, like octaves, lacunarity, gain, or fractal type. - The frequency, set with
setFrequency(float), affects how quickly significant changes in output can occur over a given span of input values. It defaults to1f/32f, though you should try setting this to1fif results look strange. - If your noise type is one of the fractal varieties (
VALUE_FRACTAL,PERLIN_FRACTAL,SIMPLEX_FRACTAL,CUBIC_FRACTAL,FOAM_FRACTAL,HONEY_FRACTAL,MUTANT_FRACTAL, orTAFFY_FRACTAL):- Fractal noise can set a fractal type with
setFractalType(int), which defaults toFBM(layering noise with different frequencies and strengths), and can also be set toRIDGED_MULTI(which produces strong lines or curves of high values) orBILLOW(which is like RIDGED_MULTI but produces lines or curves of low values). The noise type affects how the other fractal options work, and has a very strong effect on the appearance of the noise when it changes. - Octaves, set with
setFractalOctaves(int), are how many "layers" of noise this will calculate on each call to get fractal noise. Each octave has its frequency changed based on lacunarity (set withsetFractalLacunarity(float)), and contributes a different amount to the resulting value, based on gain (set withsetFractalGain(float)). Generally, more octaves result in more detail and slower generation times.SIMPLEX_FRACTALandPERLIN_FRACTALonly really look like noise when they use more than one octave. - Lacunarity may occasionally need adjustment, but usually you're fine with setting it to 2.0 or 0.5, with the appearance informing the decision. I think lacunarity means something related to the width of a crescent, and refers to the exponential shape of a graph of frequency as octaves are added. It defaults to 2.0, and some usage works better by setting it to 0.5 (rarely).
- Gain usually only needs changing if lacunarity is changed, but they can be adjusted independently. You
probably will get the best results if gain is equal to
1f / lacunarity, or close to that. This means the default is 0.5, meant to match a lacunarity of 2.0. If you change lacunarity to 0.5, then this should be 2.0. You can move gain out-of-sync with lacunarity, but this can have strange outcomes.
- Fractal noise can set a fractal type with
- In some cases, you may want unusual or symmetrical artifacts in noise; you can make this happen with
setPointHash(IPointHash), giving it aFlawedPointHashor an IPointHash you made, and setting noise type toCUBIC_FRACTAL(orCUBIC). The point hash is only used by cubic noise. - The
CELLULARnoise type has lots of extra configuration, and not all of it is well-documented, but experimenting with settings likesetCellularReturnType(int)andsetCellularDistanceFunction(int)is a good way to see if it can do what you want. - The
setMutation(float)method allows you to configureMUTANT,MUTANT_FRACTAL,TAFFY, andTAFFY_FRACTALnoise in a way that's more precise than changing a seed. Small changes to mutation cause small changes in the resulting noise, while large changes are similar to editing the seed. Mutation acts like any other positional component, like x or y, and as such is affected by the frequency. The two MUTANT types of noise are extremely similar toFOAMandFOAM_FRACTAL, just with an extra dimension added for mutation. The two TAFFY types of noise are considerably faster than FOAM in high dimensions, but are visibly lower-quality in low dimensions. - If you are using
FOAM,MUTANT,CUBIC,TAFFY, or their _FRACTAL versions, you can adjust how sharply the noise transitions between light and dark values by usingsetSharpness(float). Higher sharpness may be especially useful with more octaves, because most types of noise slide toward producing mostly central values with more octaves, and higher sharpness helps counter that "graying out." - You will probably need to adjust the frequency for your particular use case. The default used by
instanceis1.0f/32.0for0.03125f, but world map generation often uses a frequency of 1 or around 1, and some types of noise (especiallyFOAM,MUTANT,TAFFY, and their _FRACTAL versions) need higher frequencies to look comparable to other noise types.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface INoise
INoise.Serializer -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final floatstatic final floatstatic final floatstatic final floatstatic final floatstatic final intA 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 intMeant to be used withsetCellularReturnType(int).static final intSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.static final com.github.tommyettinger.ds.IntObjectMap<String> static final intSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.static final com.github.tommyettinger.ds.IntObjectMap<String> protected intprotected intstatic final intSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.static final intSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.static final intMeant to be used withsetCellularReturnType(int).static final intMeant to be used withsetCellularReturnType(int).static final intMeant to be used withsetCellularReturnType(int).static final intMeant to be used withsetCellularReturnType(int).static final intMeant to be used withsetCellularReturnType(int).static final intMeant to be used withsetCellularReturnType(int).static final intMeant to be used withsetCellularReturnType(int).static final intLayered 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 intMeasures distances "as the crow flies." All points at an equal distance from the origin form a circle.static final floatstatic final floatstatic final floatstatic final floatstatic final floatstatic final int"Standard" layered octaves of noise, where each octave has a different frequency and weight.static final intSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.static final intSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.static final com.github.tommyettinger.ds.IntObjectMap<String> protected booleanprotected intprotected floatstatic final floatstatic final floatstatic final floatstatic final floatstatic final floatprotected floatprotected floatstatic final floatstatic final intCubic interpolation via Hermite spline, more commonly known as "smoothstep".static final intSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.static final intSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.static final NoiseA publicly available Noise object with seed 1337, frequency 1.0f/32.0f, 1 octave of Simplex noise using SIMPLEX_FRACTAL noiseType, 2f lacunarity and 0.5f gain.protected intstatic final com.github.tommyettinger.ds.IntObjectMap<String> protected floatstatic final floatstatic final floatstatic final floatstatic final floatstatic final floatstatic final intSimple linear interpolation.static final intMeasures distances on a grid, as if allowing only orthogonal movement (with no diagonals).static final floatstatic final floatstatic final floatstatic final floatstatic final floatstatic final intSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.static final intSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.protected floatstatic final intMeasures distances with an approximation of Euclidean distance that's not 100% accurate.static final intMeant to be used withsetCellularReturnType(int).static final com.github.tommyettinger.ds.IntObjectMap<String> protected intprotected intstatic final intSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.static final intSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.protected IPointHashstatic final intQuintic interpolation, sometimes known as "smootherstep".static final intA way to layer octaves of noise so most values are biased toward low values but "ridges" of high values run across the noise.static final floatstatic final floatstatic final floatstatic final floatstatic final floatprotected intprotected floatprotected floatShould always be equal to(1f / sharpness).static final intSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.static final intSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.static final intSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.static final intSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.static final intSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.static final intSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.static final intSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat. -
Constructor Summary
ConstructorsConstructorDescriptionNoise()A constructor that takes no parameters, and uses all default settings with a seed of 1337.Noise(int seed) A constructor that takes only a parameter for the Noise's seed, which should produce different results for any different seeds.Noise(int seed, float frequency) A constructor that takes two parameters to specify the Noise from the start.Noise(int seed, float frequency, int noiseType) A constructor that takes a few parameters to specify the Noise from the start.Noise(int seed, float frequency, int noiseType, int octaves) A constructor that takes several parameters to specify the Noise from the start.Noise(int seed, float frequency, int noiseType, int octaves, float lacunarity, float gain) A constructor that takes a lot of parameters to specify the Noise from the start.Copy constructor; copies all non-temporary fields fromotherinto this. -
Method Summary
Modifier and TypeMethodDescriptionstatic floatcalculateEqualizeAdjustment(float add) Gets the value to optimally use formulinequalize(float, float, float), given the value that will be used asaddthere.copy()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.protected static floatcubicLerp(float a, float b, float c, float d, float t) static floatequalize(float x, float add, float mul) Given inputs asxin the range -1.0 to 1.0 that are too biased towards 0.0, this "squashes" the range softly to widen it and spread it away from 0.0 without increasing bias anywhere else.booleanprotected static intfastRound(float f) floatgetCellular(float x, float y) floatgetCellular(float x, float y, float z) intintGets the return type from cellular noise calculations, corresponding to a constant from this class:CELL_VALUE(0),NOISE_LOOKUP(1),DISTANCE(2),DISTANCE_2(3),DISTANCE_2_ADD(4),DISTANCE_2_SUB(5),DISTANCE_2_MUL(6), orDISTANCE_2_DIV(7).floatgetConfiguredNoise(float x, float y) After being configured with the setters in this class, such assetNoiseType(int),setFrequency(float),setFractalOctaves(int), andsetFractalType(int), among others, you can call this method to get the particular variety of noise you specified, in 2D.floatgetConfiguredNoise(float x, float y, float z) After being configured with the setters in this class, such assetNoiseType(int),setFrequency(float),setFractalOctaves(int), andsetFractalType(int), among others, you can call this method to get the particular variety of noise you specified, in 3D.floatgetConfiguredNoise(float x, float y, float z, float w) After being configured with the setters in this class, such assetNoiseType(int),setFrequency(float),setFractalOctaves(int), andsetFractalType(int), among others, you can call this method to get the particular variety of noise you specified, in 4D.floatgetConfiguredNoise(float x, float y, float z, float w, float u) After being configured with the setters in this class, such assetNoiseType(int),setFrequency(float),setFractalOctaves(int), andsetFractalType(int), among others, you can call this method to get the particular variety of noise you specified, in 5D.floatgetConfiguredNoise(float x, float y, float z, float w, float u, float v) After being configured with the setters in this class, such assetNoiseType(int),setFrequency(float),setFractalOctaves(int), andsetFractalType(int), among others, you can call this method to get the particular variety of noise you specified, in 6D.floatgetCubic(float x, float y) floatgetCubic(float x, float y, float z) floatgetCubic(float x, float y, float z, float w) floatgetCubicFractal(float x, float y) floatgetCubicFractal(float x, float y, float z) floatgetCubicFractal(float x, float y, float z, float w) floatgetFoam(float x, float y) floatgetFoam(float x, float y, float z) floatgetFoam(float x, float y, float z, float w) floatgetFoam(float x, float y, float z, float w, float u) floatgetFoam(float x, float y, float z, float w, float u, float v) floatgetFoamFractal(float x, float y) floatgetFoamFractal(float x, float y, float z) floatgetFoamFractal(float x, float y, float z, float w, float u) floatgetFoamFractal(float x, float y, float z, float w, float u, float v) floatGets the "sharpness" for theFOAM,FOAM_FRACTAL,MUTANT,MUTANT_FRACTAL,CUBIC,CUBIC_FRACTAL,TAFFY, andTAFFY_FRACTALnoise types, which is usually around 0.25f to 2.0f, and defaults to 1.0f.floatSets the octave gain for all fractal noise types.floatGets the octave lacunarity for all fractal noise types.intGets the octave count for all fractal noise types.intGets the method for combining octaves in all fractal noise types, allowing an int argument corresponding to one of the following constants from this class:FBM(0),BILLOW(1),RIDGED_MULTI(2), orDOMAIN_WARP(3).floatGets the frequency for all noise types.floatGets the maximum perturb distance from original location when usinggradientPerturb2(float[]),gradientPerturb3(float[]),gradientPerturbFractal2(float[]), orgradientPerturbFractal3(float[]); the default is 1.0.floatgetHoney(float x, float y) floatgetHoney(float x, float y, float z) floatgetHoney(float x, float y, float z, float w) floatgetHoney(float x, float y, float z, float w, float u) floatgetHoney(float x, float y, float z, float w, float u, float v) floatgetHoneyFractal(float x, float y) floatgetHoneyFractal(float x, float y, float z) floatgetHoneyFractal(float x, float y, float z, float w, float u) floatgetHoneyFractal(float x, float y, float z, float w, float u, float v) intGets the constant corresponding to the interpolation method used to smooth between noise values.intGets 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).intGets 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.floatGets the mutation value used byMUTANT,MUTANT_FRACTAL,TAFFY, andTAFFY_FRACTALnoise types, which allows making small changes to the result when the mutation values are slightly different.doublegetNoise(double x, double y) doublegetNoise(double x, double y, double z) doublegetNoise(double x, double y, double z, double w) doublegetNoise(double x, double y, double z, double w, double u) doublegetNoise(double x, double y, double z, double w, double u, double v) floatgetNoise(float x, float y) Gets 2D noise with a default or pre-set seed.floatgetNoise(float x, float y, float z) Gets 3D noise with a default or pre-set seed.floatgetNoise(float x, float y, float z, float w) Gets 4D noise with a default or pre-set seed.floatgetNoise(float x, float y, float z, float w, float u) Gets 5D noise with a default or pre-set seed.floatgetNoise(float x, float y, float z, float w, float u, float v) Gets 6D noise with a default or pre-set seed.intGets the default type of noise returned bygetConfiguredNoise(float, float), using one of the following constants in this class:VALUE(0),VALUE_FRACTAL(1),PERLIN(2),PERLIN_FRACTAL(3),SIMPLEX(4),SIMPLEX_FRACTAL(5),CELLULAR(6),CELLULAR_FRACTAL(7),CUBIC(8),CUBIC_FRACTAL(9),FOAM(10),FOAM_FRACTAL(11),HONEY(12),HONEY_FRACTAL(13),MUTANT(14),MUTANT_FRACTAL(15),TAFFY(16),TAFFY_FRACTAL(17), orWHITE_NOISE(18).doublegetNoiseWithSeed(double x, double y, double z, double w, double u, double v, long seed) doublegetNoiseWithSeed(double x, double y, double z, double w, double u, long seed) doublegetNoiseWithSeed(double x, double y, double z, double w, long seed) doublegetNoiseWithSeed(double x, double y, double z, long seed) doublegetNoiseWithSeed(double x, double y, long seed) floatgetNoiseWithSeed(float x, float y, float z, float w, float u, float v, int seed) floatgetNoiseWithSeed(float x, float y, float z, float w, float u, float v, long seed) Gets 6D noise with a specific seed.floatgetNoiseWithSeed(float x, float y, float z, float w, float u, int seed) floatgetNoiseWithSeed(float x, float y, float z, float w, float u, long seed) Gets 5D noise with a specific seed.floatgetNoiseWithSeed(float x, float y, float z, float w, int seed) floatgetNoiseWithSeed(float x, float y, float z, float w, long seed) Gets 4D noise with a specific seed.floatgetNoiseWithSeed(float x, float y, float z, int seed) floatgetNoiseWithSeed(float x, float y, float z, long seed) Gets 3D noise with a specific seed.floatgetNoiseWithSeed(float x, float y, int seed) floatgetNoiseWithSeed(float x, float y, long seed) Gets 2D noise with a specific seed.floatgetPerlin(float x, float y) floatgetPerlin(float x, float y, float z) floatgetPerlin(float x, float y, float z, float w) floatgetPerlin(float x, float y, float z, float w, float u) floatgetPerlin(float x, float y, float z, float w, float u, float v) floatgetPerlinFractal(float x, float y) floatgetPerlinFractal(float x, float y, float z) Gets the current point hash, which is only used forCUBICandCUBIC_FRACTALnoise types.longgetSeed()Gets the current seed of the generator, as a long even if the seed is stored internally as an int.floatGets the "sharpness" for theFOAM,FOAM_FRACTAL,MUTANT,MUTANT_FRACTAL,CUBIC,CUBIC_FRACTAL,TAFFY, andTAFFY_FRACTALnoise types, which is usually around 0.25f to 2.0f, and defaults to 1.0f.floatgetSimplex(float x, float y) floatgetSimplex(float x, float y, float z) floatgetSimplex(float x, float y, float z, float w) floatgetSimplex(float x, float y, float z, float w, float u) floatgetSimplex(float x, float y, float z, float w, float u, float v) floatgetSimplexFractal(float x, float y) floatgetSimplexFractal(float x, float y, float z) floatgetSimplexFractal(float x, float y, float z, float w) floatgetSimplexFractal(float x, float y, float z, float w, float u) floatgetSimplexFractal(float x, float y, float z, float w, float u, float v) floatgetTaffy(float x, float y) floatgetTaffy(float x, float y, float z) floatgetTaffy(float x, float y, float z, float w) floatgetTaffy(float x, float y, float z, float w, float u) floatgetTaffy(float x, float y, float z, float w, float u, float v) floatgetTaffyFractal(float x, float y) floatgetTaffyFractal(float x, float y, float z) floatgetTaffyFractal(float x, float y, float z, float w) floatgetTaffyFractal(float x, float y, float z, float w, float u) floatgetTaffyFractal(float x, float y, float z, float w, float u, float v) getTag()Returns a typically-four-character String constant that should uniquely identify this INoise as well as possible.floatgetValue(float x, float y) floatgetValue(float x, float y, float z) floatgetValue(float x, float y, float z, float w) floatgetValue(float x, float y, float z, float w, float u) floatgetValue(float x, float y, float z, float w, float u, float v) floatgetValueFractal(float x, float y) floatgetValueFractal(float x, float y, float z) floatgetValueFractal(float x, float y, float z, float w) floatgetValueFractal(float x, float y, float z, float w, float u) floatgetValueFractal(float x, float y, float z, float w, float u, float v) floatgetWhiteNoise(float x, float y) floatgetWhiteNoise(float x, float y, float z) floatgetWhiteNoise(float x, float y, float z, float w) floatgetWhiteNoise(float x, float y, float z, float w, float u) floatgetWhiteNoise(float x, float y, float z, float w, float u, float v) protected floatgradCoord2D(int seed, int x, int y, float xd, float yd) protected floatgradCoord3D(int seed, int x, int y, int z, float xd, float yd, float zd) protected floatgradCoord4D(int seed, int x, int y, int z, int w, float xd, float yd, float zd, float wd) protected floatgradCoord5D(int seed, int x, int y, int z, int w, int u, float xd, float yd, float zd, float wd, float ud) protected floatgradCoord6D(int seed, int x, int y, int z, int w, int u, int v, float xd, float yd, float zd, float wd, float ud, float vd) voidgradientPerturb2(float[] v2) voidgradientPerturb3(float[] v3) voidgradientPerturbFractal2(float[] v2) voidgradientPerturbFractal3(float[] v3) booleanReturns true if this generator can be seeded withINoise.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.protected static floathermiteInterpolator(float t) booleanReturns true if this uses a spiraling rotation as octaves are added to fractal noise.floatlayered2D(float x, float y, int seed, int octaves) Generates FBM simplex noise with the given amount of octaves and default frequency (0.03125), lacunarity (2) and gain (0.5) in 2D.floatlayered2D(float x, float y, int seed, int octaves, float frequency) Generates FBM simplex noise with the given amount of octaves, given frequency, default lacunarity (2) and default gain (0.5) in 2D.floatlayered2D(float x, float y, int seed, int octaves, float frequency, float lacunarity) Generates FBM simplex noise with the given amount of octaves and specified lacunarity (the amount of frequency change between octaves) and gain (1.0f / lacunarity) in 2D.floatlayered2D(float x, float y, int seed, int octaves, float frequency, float lacunarity, float gain) Generates FBM simplex noise with the given amount of octaves and specified lacunarity (the amount of frequency change between octaves) and gain (loosely, how much to emphasize lower-frequency octaves) in 2D.floatlayered3D(float x, float y, float z, int seed, int octaves) Generates FBM simplex noise with the given amount of octaves and default frequency (0.03125), lacunarity (2) and gain (0.5) in 3D.floatlayered3D(float x, float y, float z, int seed, int octaves, float frequency) Generates FBM simplex noise with the given amount of octaves, given frequency, and default lacunarity (2) and gain (0.5) in 3D.floatlayered3D(float x, float y, float z, int seed, int octaves, float frequency, float lacunarity) Generates FBM simplex noise with the given amount of octaves, given frequency, and specified lacunarity (the amount of frequency change between octaves) and gain (1.0f / lacunarity) in 3D.floatlayered3D(float x, float y, float z, int seed, int octaves, float frequency, float lacunarity, float gain) Generates FBM simplex noise with the given amount of octaves, given frequency, given lacunarity (the amount of frequency change between octaves) and gain (loosely, how much to emphasize lower-frequency octaves) in 3D.voidprotected static floatquinticInterpolator(float t) floatridged2D(float x, float y, int seed, int octaves) Generates ridged-multi simplex noise with the given amount of octaves and default frequency (0.03125), lacunarity (2) and gain (0.5).floatridged2D(float x, float y, int seed, int octaves, float frequency) Generates ridged-multi simplex noise with the given amount of octaves and default frequency (0.03125), lacunarity (2) and gain (0.5).floatridged2D(float x, float y, int seed, int octaves, float frequency, float lacunarity) Generates ridged-multi simplex noise with the given amount of octaves and specified lacunarity (the amount of frequency change between octaves); gain is not used.floatridged3D(float x, float y, float z, int seed, int octaves) Generates ridged-multi simplex noise with the given amount of octaves and default frequency (0.03125), lacunarity (2) and gain (0.5).floatridged3D(float x, float y, float z, int seed, int octaves, float frequency) Generates ridged-multi simplex noise with the given amount of octaves, specified frequency, and the default lacunarity (2) and gain (0.5).floatridged3D(float x, float y, float z, int seed, int octaves, float frequency, float lacunarity) Generates ridged-multi simplex noise with the given amount of octaves and specified lacunarity (the amount of frequency change between octaves); gain is not used.protected static floatrotateM7D(float x, float y, float z, float w, float u, float v, float m) protected static floatrotateU5D(float x, float y, float z, float w, float u) protected static floatrotateU6D(float x, float y, float z, float w, float u, float v) protected static floatrotateU7D(float x, float y, float z, float w, float u, float v, float m) protected static floatrotateV6D(float x, float y, float z, float w, float u, float v) protected static floatrotateV7D(float x, float y, float z, float w, float u, float v, float m) protected static floatrotateW4D(float x, float y, float z, float w) protected static floatrotateW5D(float x, float y, float z, float w, float u) protected static floatrotateW6D(float x, float y, float z, float w, float u, float v) protected static floatrotateW7D(float x, float y, float z, float w, float u, float v, float m) protected static floatrotateX2D(float x, float y) protected static floatrotateX3D(float x, float y, float z) protected static floatrotateX4D(float x, float y, float z, float w) protected static floatrotateX5D(float x, float y, float z, float w, float u) protected static floatrotateX6D(float x, float y, float z, float w, float u, float v) protected static floatrotateX7D(float x, float y, float z, float w, float u, float v, float m) protected static floatrotateY2D(float x, float y) protected static floatrotateY3D(float x, float y, float z) protected static floatrotateY4D(float x, float y, float z, float w) protected static floatrotateY5D(float x, float y, float z, float w, float u) protected static floatrotateY6D(float x, float y, float z, float w, float u, float v) protected static floatrotateY7D(float x, float y, float z, float w, float u, float v, float m) protected static floatrotateZ3D(float x, float y, float z) protected static floatrotateZ4D(float x, float y, float z, float w) protected static floatrotateZ5D(float x, float y, float z, float w, float u) protected static floatrotateZ6D(float x, float y, float z, float w, float u, float v) protected static floatrotateZ7D(float x, float y, float z, float w, float u, float v, float m) voidsetCellularDistanceFunction(int cellularDistanceFunction) voidsetCellularNoiseLookup(Noise noise) A no-op method that is here for compatibility with earlier versions.voidsetCellularReturnType(int cellularReturnType) Sets the return type from cellular noise calculations, allowing an int argument corresponding to one of the following constants from this class:CELL_VALUE(0),NOISE_LOOKUP(1),DISTANCE(2),DISTANCE_2(3),DISTANCE_2_ADD(4),DISTANCE_2_SUB(5),DISTANCE_2_MUL(6), orDISTANCE_2_DIV(7).voidsetFoamSharpness(float sharpness) Only used withFOAM,FOAM_FRACTAL,MUTANT,MUTANT_FRACTAL,CUBIC,CUBIC_FRACTAL,TAFFY, andTAFFY_FRACTALnoise types, this affects how often the noise will produce very high and very low results (more often with high sharpness values), as opposed to mid-range (more often with low sharpness values).voidsetFractalGain(float gain) Sets the octave gain for all fractal noise types.voidsetFractalLacunarity(float lacunarity) Sets the octave lacunarity for all fractal noise types.voidsetFractalOctaves(int octaves) Sets the octave count for all fractal noise types.voidsetFractalSpiral(boolean fractalSpiral) Sets the fractal spiral mode on or off; if on, this uses a spiraling rotation as octaves are added to fractal noise.voidsetFractalType(int fractalType) Sets the method for combining octaves in all fractal noise types, allowing an int argument corresponding to one of the following constants from this class:FBM(0),BILLOW(1),RIDGED_MULTI(2), orDOMAIN_WARP(3).voidsetFrequency(float frequency) Sets the frequency for all noise types.voidsetGradientPerturbAmp(float gradientPerturbAmp) Sets the maximum perturb distance from original location when usinggradientPerturb2(float[]),gradientPerturb3(float[]),gradientPerturbFractal2(float[]), orgradientPerturbFractal3(float[]); the default is 1.0.voidsetInterpolation(int interpolation) voidsetMutation(float mutation) Sets the mutation value used byMUTANT,MUTANT_FRACTAL,TAFFY, andTAFFY_FRACTALnoise types, which can be any finite float.voidsetNoiseType(int noiseType) Sets the default type of noise returned bygetConfiguredNoise(float, float), using one of the following constants in this class:VALUE(0),VALUE_FRACTAL(1),PERLIN(2),PERLIN_FRACTAL(3),SIMPLEX(4),SIMPLEX_FRACTAL(5),CELLULAR(6),CELLULAR_FRACTAL(7),CUBIC(8),CUBIC_FRACTAL(9),FOAM(10),FOAM_FRACTAL(11),HONEY(12),HONEY_FRACTAL(13),MUTANT(14),MUTANT_FRACTAL(15),TAFFY(16),TAFFY_FRACTAL(17), orWHITE_NOISE(18).voidsetPointHash(IPointHash hash) Sets the point hash, typically to one with intentional flaws, as found inFlawedPointHashtypes.voidsetSeed(int seed) Sets the seed used for all noise types, as a long.voidsetSeed(long seed) Sets the seed to the given long, if long seeds are supported, or(int)seedif only int seeds are supported.voidsetSharpness(float sharpness) Only used withFOAM,FOAM_FRACTAL,MUTANT,MUTANT_FRACTAL,CUBIC,CUBIC_FRACTAL,TAFFY, andTAFFY_FRACTALnoise types, this affects how often the noise will produce very high and very low results (more often with high sharpness values), as opposed to mid-range (more often with low sharpness values).protected floatsingleCellular(int seed, float x, float y) protected floatsingleCellular(int seed, float x, float y, float z) protected floatsingleCellular2Edge(int seed, float x, float y) protected floatsingleCellular2Edge(int seed, float x, float y, float z) protected floatsingleCellularFractalBillow(float x, float y) protected floatsingleCellularFractalBillow(float x, float y, float z) protected floatsingleCellularFractalDomainWarp(float x, float y) protected floatsingleCellularFractalDomainWarp(float x, float y, float z) protected floatsingleCellularFractalFBM(float x, float y) protected floatsingleCellularFractalFBM(float x, float y, float z) protected floatsingleCellularFractalRidgedMulti(float x, float y) protected floatsingleCellularFractalRidgedMulti(float x, float y, float z) protected floatsingleCellularMerging(int seed, float x, float y) protected floatsingleCellularMerging(int seed, float x, float y, float z) protected floatsingleCubic(int seed, float x, float y) protected floatsingleCubic(int seed, float x, float y, float z) protected floatsingleCubic(int seed, float x, float y, float z, float w) protected floatsingleCubicFractalBillow(float x, float y) protected floatsingleCubicFractalBillow(float x, float y, float z) protected floatsingleCubicFractalBillow(float x, float y, float z, float w) protected floatsingleCubicFractalDomainWarp(float x, float y) protected floatsingleCubicFractalDomainWarp(float x, float y, float z) protected floatsingleCubicFractalDomainWarp(float x, float y, float z, float w) protected floatsingleCubicFractalFBM(float x, float y) protected floatsingleCubicFractalFBM(float x, float y, float z) protected floatsingleCubicFractalFBM(float x, float y, float z, float w) protected floatsingleCubicFractalRidgedMulti(float x, float y) protected floatsingleCubicFractalRidgedMulti(float x, float y, float z) protected floatsingleCubicFractalRidgedMulti(float x, float y, float z, float w) floatsingleFoam(int seed, float x, float y) floatsingleFoam(int seed, float x, float y, float z) floatsingleFoam(int seed, float x, float y, float z, float w) floatsingleFoam(int seed, float x, float y, float z, float w, float u) floatsingleFoam(int seed, float x, float y, float z, float w, float u, float v) floatsingleFoam(int seed, float x, float y, float z, float w, float u, float v, float m) protected floatsingleFoamFractalBillow(float x, float y) protected floatsingleFoamFractalBillow(float x, float y, float z) protected floatsingleFoamFractalBillow(float x, float y, float z, float w) protected floatsingleFoamFractalBillow(float x, float y, float z, float w, float u) protected floatsingleFoamFractalBillow(float x, float y, float z, float w, float u, float v) protected floatsingleFoamFractalBillow(float x, float y, float z, float w, float u, float v, float m) protected floatsingleFoamFractalDomainWarp(float x, float y) protected floatsingleFoamFractalDomainWarp(float x, float y, float z) protected floatsingleFoamFractalDomainWarp(float x, float y, float z, float w) protected floatsingleFoamFractalDomainWarp(float x, float y, float z, float w, float u) protected floatsingleFoamFractalDomainWarp(float x, float y, float z, float w, float u, float v) protected floatsingleFoamFractalDomainWarp(float x, float y, float z, float w, float u, float v, float m) protected floatsingleFoamFractalFBM(float x, float y) protected floatsingleFoamFractalFBM(float x, float y, float z) protected floatsingleFoamFractalFBM(float x, float y, float z, float w) protected floatsingleFoamFractalFBM(float x, float y, float z, float w, float u) protected floatsingleFoamFractalFBM(float x, float y, float z, float w, float u, float v) protected floatsingleFoamFractalFBM(float x, float y, float z, float w, float u, float v, float m) protected floatsingleFoamFractalRidgedMulti(float x, float y) protected floatsingleFoamFractalRidgedMulti(float x, float y, float z) protected floatsingleFoamFractalRidgedMulti(float x, float y, float z, float w) protected floatsingleFoamFractalRidgedMulti(float x, float y, float z, float w, float u) protected floatsingleFoamFractalRidgedMulti(float x, float y, float z, float w, float u, float v) protected floatsingleFoamFractalRidgedMulti(float x, float y, float z, float w, float u, float v, float m) floatsingleHoney(int seed, float x, float y) floatsingleHoney(int seed, float x, float y, float z) floatsingleHoney(int seed, float x, float y, float z, float w) floatsingleHoney(int seed, float x, float y, float z, float w, float u) floatsingleHoney(int seed, float x, float y, float z, float w, float u, float v) protected floatsingleHoneyFractalBillow(float x, float y) protected floatsingleHoneyFractalBillow(float x, float y, float z) protected floatsingleHoneyFractalBillow(float x, float y, float z, float w) protected floatsingleHoneyFractalBillow(float x, float y, float z, float w, float u) protected floatsingleHoneyFractalBillow(float x, float y, float z, float w, float u, float v) protected floatsingleHoneyFractalDomainWarp(float x, float y) protected floatsingleHoneyFractalDomainWarp(float x, float y, float z) protected floatsingleHoneyFractalDomainWarp(float x, float y, float z, float w) protected floatsingleHoneyFractalDomainWarp(float x, float y, float z, float w, float u) protected floatsingleHoneyFractalDomainWarp(float x, float y, float z, float w, float u, float v) protected floatsingleHoneyFractalFBM(float x, float y) protected floatsingleHoneyFractalFBM(float x, float y, float z) protected floatsingleHoneyFractalFBM(float x, float y, float z, float w) protected floatsingleHoneyFractalFBM(float x, float y, float z, float w, float u) protected floatsingleHoneyFractalFBM(float x, float y, float z, float w, float u, float v) protected floatsingleHoneyFractalRidgedMulti(float x, float y) protected floatsingleHoneyFractalRidgedMulti(float x, float y, float z) protected floatsingleHoneyFractalRidgedMulti(float x, float y, float z, float w) protected floatsingleHoneyFractalRidgedMulti(float x, float y, float z, float w, float u) protected floatsingleHoneyFractalRidgedMulti(float x, float y, float z, float w, float u, float v) protected floatsinglePerlin(int seed, float x, float y) protected floatsinglePerlin(int seed, float x, float y, float z) protected floatsinglePerlin(int seed, float x, float y, float z, float w) protected floatsinglePerlin(int seed, float x, float y, float z, float w, float u) protected floatsinglePerlin(int seed, float x, float y, float z, float w, float u, float v) protected floatsinglePerlinFractalBillow(float x, float y) protected floatsinglePerlinFractalBillow(float x, float y, float z) protected floatsinglePerlinFractalBillow(float x, float y, float z, float w) protected floatsinglePerlinFractalBillow(float x, float y, float z, float w, float u) protected floatsinglePerlinFractalBillow(float x, float y, float z, float w, float u, float v) protected floatsinglePerlinFractalDomainWarp(float x, float y) protected floatsinglePerlinFractalDomainWarp(float x, float y, float z) protected floatsinglePerlinFractalDomainWarp(float x, float y, float z, float w) protected floatsinglePerlinFractalDomainWarp(float x, float y, float z, float w, float u) protected floatsinglePerlinFractalDomainWarp(float x, float y, float z, float w, float u, float v) protected floatsinglePerlinFractalFBM(float x, float y) protected floatsinglePerlinFractalFBM(float x, float y, float z) protected floatsinglePerlinFractalFBM(float x, float y, float z, float w) protected floatsinglePerlinFractalFBM(float x, float y, float z, float w, float u) protected floatsinglePerlinFractalFBM(float x, float y, float z, float w, float u, float v) protected floatsinglePerlinFractalRidgedMulti(float x, float y) protected floatsinglePerlinFractalRidgedMulti(float x, float y, float z) protected floatsinglePerlinFractalRidgedMulti(float x, float y, float z, float w) protected floatsinglePerlinFractalRidgedMulti(float x, float y, float z, float w, float u) protected floatsinglePerlinFractalRidgedMulti(float x, float y, float z, float w, float u, float v) floatsingleSimplex(int seed, float x, float y) floatsingleSimplex(int seed, float x, float y, float z) floatsingleSimplex(int seed, float x, float y, float z, float w) floatsingleSimplex(int seed, float x, float y, float z, float w, float u) floatsingleSimplex(int seed, float x, float y, float z, float w, float u, float v) protected floatsingleSimplexFractalBillow(float x, float y) protected floatsingleSimplexFractalBillow(float x, float y, float z) protected floatsingleSimplexFractalBillow(float x, float y, float z, float w) protected floatsingleSimplexFractalBillow(float x, float y, float z, float w, float u) protected floatsingleSimplexFractalBillow(float x, float y, float z, float w, float u, float v) protected floatsingleSimplexFractalDomainWarp(float x, float y) protected floatsingleSimplexFractalDomainWarp(float x, float y, float z) protected floatsingleSimplexFractalDomainWarp(float x, float y, float z, float w) protected floatsingleSimplexFractalDomainWarp(float x, float y, float z, float w, float u) protected floatsingleSimplexFractalDomainWarp(float x, float y, float z, float w, float u, float v) protected floatsingleSimplexFractalFBM(float x, float y) protected floatsingleSimplexFractalFBM(float x, float y, float z) protected floatsingleSimplexFractalFBM(float x, float y, float z, float w) protected floatsingleSimplexFractalFBM(float x, float y, float z, float w, float u) protected floatsingleSimplexFractalFBM(float x, float y, float z, float w, float u, float v) protected floatsingleSimplexFractalRidgedMulti(float x, float y) protected floatsingleSimplexFractalRidgedMulti(float x, float y, float z) protected floatsingleSimplexFractalRidgedMulti(float x, float y, float z, float w) protected floatsingleSimplexFractalRidgedMulti(float x, float y, float z, float w, float u) protected floatsingleSimplexFractalRidgedMulti(float x, float y, float z, float w, float u, float v) floatsingleTaffy(int seed, float x, float y) floatsingleTaffy(int seed, float x, float y, float z) floatsingleTaffy(int seed, float x, float y, float z, float w) floatsingleTaffy(int seed, float x, float y, float z, float w, float u) floatsingleTaffy(int seed, float x, float y, float z, float w, float u, float v) floatsingleTaffy(int seed, float x, float y, float z, float w, float u, float v, float m) protected floatsingleTaffyFractalBillow(float x, float y) protected floatsingleTaffyFractalBillow(float x, float y, float z) protected floatsingleTaffyFractalBillow(float x, float y, float z, float w) protected floatsingleTaffyFractalBillow(float x, float y, float z, float w, float u) protected floatsingleTaffyFractalBillow(float x, float y, float z, float w, float u, float v) protected floatsingleTaffyFractalBillow(float x, float y, float z, float w, float u, float v, float m) protected floatsingleTaffyFractalDomainWarp(float x, float y, float z) protected floatsingleTaffyFractalDomainWarp(float x, float y, float z, float w) protected floatsingleTaffyFractalDomainWarp(float x, float y, float z, float w, float u) protected floatsingleTaffyFractalDomainWarp(float x, float y, float z, float w, float u, float v) protected floatsingleTaffyFractalDomainWarp(float x, float y, float z, float w, float u, float v, float m) protected floatsingleTaffyFractalFBM(float x, float y) protected floatsingleTaffyFractalFBM(float x, float y, float z) protected floatsingleTaffyFractalFBM(float x, float y, float z, float w) protected floatsingleTaffyFractalFBM(float x, float y, float z, float w, float u) protected floatsingleTaffyFractalFBM(float x, float y, float z, float w, float u, float v) protected floatsingleTaffyFractalFBM(float x, float y, float z, float w, float u, float v, float m) protected floatsingleTaffyFractalRidgedMulti(float x, float y) protected floatsingleTaffyFractalRidgedMulti(float x, float y, float z) protected floatsingleTaffyFractalRidgedMulti(float x, float y, float z, float w) protected floatsingleTaffyFractalRidgedMulti(float x, float y, float z, float w, float u) protected floatsingleTaffyFractalRidgedMulti(float x, float y, float z, float w, float u, float v) protected floatsingleTaffyFractalRidgedMulti(float x, float y, float z, float w, float u, float v, float m) floatsingleTaffyVarargs(int seed, float... coordinates) floatsingleValue(int seed, float x, float y) floatsingleValue(int seed, float x, float y, float z) floatsingleValue(int seed, float x, float y, float z, float w) floatsingleValue(int seed, float x, float y, float z, float w, float u) floatsingleValue(int seed, float x, float y, float z, float w, float u, float v) protected floatsingleValueFractalBillow(float x, float y) protected floatsingleValueFractalBillow(float x, float y, float z) protected floatsingleValueFractalBillow(float x, float y, float z, float w) protected floatsingleValueFractalBillow(float x, float y, float z, float w, float u) protected floatsingleValueFractalBillow(float x, float y, float z, float w, float u, float v) protected floatsingleValueFractalDomainWarp(float x, float y) protected floatsingleValueFractalDomainWarp(float x, float y, float z) protected floatsingleValueFractalDomainWarp(float x, float y, float z, float w) protected floatsingleValueFractalDomainWarp(float x, float y, float z, float w, float u) protected floatsingleValueFractalDomainWarp(float x, float y, float z, float w, float u, float v) protected floatsingleValueFractalFBM(float x, float y) protected floatsingleValueFractalFBM(float x, float y, float z) protected floatsingleValueFractalFBM(float x, float y, float z, float w) protected floatsingleValueFractalFBM(float x, float y, float z, float w, float u) protected floatsingleValueFractalFBM(float x, float y, float z, float w, float u, float v) protected floatsingleValueFractalRidgedMulti(float x, float y) protected floatsingleValueFractalRidgedMulti(float x, float y, float z) protected floatsingleValueFractalRidgedMulti(float x, float y, float z, float w) protected floatsingleValueFractalRidgedMulti(float x, float y, float z, float w, float u) protected floatsingleValueFractalRidgedMulti(float x, float y, float z, float w, float u, float v) stringDeserialize(String data) Reads in a String that was produced bystringSerialize()and produces a copy of the Noise that was stored into it.Writes all fields of this Noise (except for thegetPointHash(), which must be stored separately) to a String and returns it.floatswitchCellular(int seed, float x, float y) protected floatswitchCellular(int seed, float x, float y, float z) toString()protected floattrillNoise(int seed, float x, float y) protected floattrillNoise(int seed, float x, float y, float z) protected floattrillNoise(int seed, float x, float y, float z, float w) protected floattrillNoise(int seed, float x, float y, float z, float w, float u) protected floattrillNoise(int seed, float x, float y, float z, float w, float u, float v) protected floattrillNoise(int seed, float x, float y, float z, float w, float u, float v, float m) protected floattrillNoise(int seed, float x, float y, float z, float w, float u, float v, float m, float n) protected floatvalueNoise(int seed, float x, float y) Produces noise from 0 to 1, instead of the normal -1 to 1.protected floatvalueNoise(int seed, float x, float y, float z) Produces noise from 0 to 1, instead of the normal -1 to 1.protected floatvalueNoise(int seed, float x, float y, float z, float w) protected floatvalueNoise(int seed, float x, float y, float z, float w, float u) protected floatvalueNoise(int seed, float x, float y, float z, float w, float u, float v) protected floatvalueNoise(int seed, float x, float y, float z, float w, float u, float v, float m) static floatwobbleTight(int seed, float value) A smooth 1D noise function that produces results between 0.0 and 1.0, and is optimized for usage on GWT.Methods inherited from class Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface INoise
getNoise, getNoiseWithSeed, readExternal, writeExternal
-
Field Details
-
VALUE
public static final int VALUESimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.
Noise sample at left, FFT at right.
This is meant to be used withsetNoiseType(int).- See Also:
-
VALUE_FRACTAL
public static final int VALUE_FRACTALSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.
Noise sample at left, FFT at right.
This is meant to be used withsetNoiseType(int).- See Also:
-
PERLIN
public static final int PERLINSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.
Noise sample at left, FFT at right.
This is meant to be used withsetNoiseType(int).- See Also:
-
PERLIN_FRACTAL
public static final int PERLIN_FRACTALSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.
Noise sample at left, FFT at right.
This is meant to be used withsetNoiseType(int).- See Also:
-
SIMPLEX
public static final int SIMPLEXSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.
Noise sample at left, FFT at right.
This is meant to be used withsetNoiseType(int).- See Also:
-
SIMPLEX_FRACTAL
public static final int SIMPLEX_FRACTALSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.
Noise sample at left, FFT at right.
This is meant to be used withsetNoiseType(int).- See Also:
-
CELLULAR
public static final int CELLULARSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.
Noise sample at left, FFT at right.
This is meant to be used withsetNoiseType(int).- See Also:
-
CELLULAR_FRACTAL
public static final int CELLULAR_FRACTALSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.
Noise sample at left, FFT at right.
This is meant to be used withsetNoiseType(int).- See Also:
-
CUBIC
public static final int CUBICSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.
Noise sample at left, FFT at right.
This is meant to be used withsetNoiseType(int).- See Also:
-
CUBIC_FRACTAL
public static final int CUBIC_FRACTALSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.
Noise sample at left, FFT at right.
This is meant to be used withsetNoiseType(int).- See Also:
-
FOAM
public static final int FOAMSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.
Noise sample at left, FFT at right.
This is meant to be used withsetNoiseType(int).- See Also:
-
FOAM_FRACTAL
public static final int FOAM_FRACTALSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.
Noise sample at left, FFT at right.
This is meant to be used withsetNoiseType(int).- See Also:
-
HONEY
public static final int HONEYSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.
Noise sample at left, FFT at right.
This is meant to be used withsetNoiseType(int).- See Also:
-
HONEY_FRACTAL
public static final int HONEY_FRACTALSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.
Noise sample at left, FFT at right.
This is meant to be used withsetNoiseType(int).- See Also:
-
MUTANT
public static final int MUTANTSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.
Noise sample at left, FFT at right.
This is meant to be used withsetNoiseType(int).- See Also:
-
MUTANT_FRACTAL
public static final int MUTANT_FRACTALSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.
Noise sample at left, FFT at right.
This is meant to be used withsetNoiseType(int).- See Also:
-
TAFFY
public static final int TAFFYSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.
Noise sample at left, FFT at right.
This is meant to be used withsetNoiseType(int).- See Also:
-
TAFFY_FRACTAL
public static final int TAFFY_FRACTALSimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.
Noise sample at left, FFT at right.
This is meant to be used withsetNoiseType(int).- See Also:
-
WHITE_NOISE
public static final int WHITE_NOISESimple, very fast but very low-quality noise that forms a grid of squares, with their values blending at shared edges somewhat.
Noise sample at left, FFT at right.
This is meant to be used withsetNoiseType(int).- See Also:
-
NOISE_TYPES
-
LINEAR
public static final int LINEARSimple linear interpolation. May result in artificial-looking noise. Meant to be used withsetInterpolation(int).- See Also:
-
HERMITE
public static final int HERMITECubic interpolation via Hermite spline, more commonly known as "smoothstep". Can be very natural-looking, but can also have problems in higher dimensions (including 3D when used with normals) with seams appearing. Meant to be used withsetInterpolation(int).- See Also:
-
QUINTIC
public static final int QUINTICQuintic interpolation, sometimes known as "smootherstep". This has somewhat steeper transitions thanHERMITE, but doesn't have any issues with seams. Meant to be used withsetInterpolation(int).- See Also:
-
INTERPOLATIONS
-
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 withsetFractalType(int).- See Also:
-
BILLOW
public static final int BILLOWA 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 probably has some good uses in 3D or higher noise, but it isn't used too frequently.
Meant to be used withsetFractalType(int).- See Also:
-
RIDGED_MULTI
public static final int RIDGED_MULTIA 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;PERLIN_FRACTALhas mostly ridges along 45-degree angles,SIMPLEX_FRACTALhas many ridges along a triangular grid, and so on.FOAM_FRACTALandHONEY_FRACTALdo well with this mode, though, and look something like lightning or bubbling fluids, respectively. Using FOAM or HONEY will have this look natural, but PERLIN in particular will look unnatural if the grid is visible.
Meant to be used withsetFractalType(int).- See Also:
-
DOMAIN_WARP
public static final int DOMAIN_WARPLayered 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 withsetFractalType(int).- See Also:
-
FRACTAL_TYPES
-
EUCLIDEAN
public static final int EUCLIDEANMeasures distances "as the crow flies." All points at an equal distance from the origin form a circle. Used only withCELLULARnoise. Meant to be used withsetCellularDistanceFunction(int).- See Also:
-
MANHATTAN
public static final int MANHATTANMeasures distances on a grid, as if allowing only orthogonal movement (with no diagonals). All points at an equal distance from the origin form a diamond shape. Used only withCELLULARnoise. Meant to be used withsetCellularDistanceFunction(int).- See Also:
-
NATURAL
public static final int NATURALMeasures distances with an approximation of Euclidean distance that's not 100% accurate. All points at an equal distance from the origin form a rough octagon. Used only withCELLULARnoise. Meant to be used withsetCellularDistanceFunction(int).- See Also:
-
CELLULAR_DISTANCE_METRICS
-
CELL_VALUE
-
NOISE_LOOKUP
public static final int NOISE_LOOKUPMeant to be used withsetCellularReturnType(int). Note that this does not allow configuring an extra Noise value to use for lookup (anymore); it always uses 3 octaves ofSIMPLEX_FRACTALwithFBM.- See Also:
-
DISTANCE
-
DISTANCE_2
-
DISTANCE_2_ADD
-
DISTANCE_2_SUB
-
DISTANCE_2_MUL
-
DISTANCE_2_DIV
-
DISTANCE_VALUE
-
CELLULAR_RETURN_TYPES
-
seed
protected int seed- See Also:
-
frequency
protected float frequency- See Also:
-
interpolation
protected int interpolation- See Also:
-
noiseType
protected int noiseType- See Also:
-
octaves
protected int octaves- See Also:
-
lacunarity
protected float lacunarity- See Also:
-
gain
protected float gain- See Also:
-
fractalType
protected int fractalType- See Also:
-
cellularDistanceFunction
protected int cellularDistanceFunction- See Also:
-
cellularReturnType
protected int cellularReturnType- See Also:
-
gradientPerturbAmp
protected float gradientPerturbAmp- See Also:
-
sharpness
protected float sharpness- See Also:
-
sharpnessInverse
protected float sharpnessInverseShould always be equal to(1f / sharpness). This is used by noise type TAFFY as part of a faster calculation to redistribute values toward or away from the center (which there is 0). -
mutation
protected float mutation- See Also:
-
fractalSpiral
protected boolean fractalSpiral- See Also:
-
pointHash
- See Also:
-
instance
A publicly available Noise object with seed 1337, frequency 1.0f/32.0f, 1 octave of Simplex noise using SIMPLEX_FRACTAL noiseType, 2f lacunarity and 0.5f gain. It's encouraged to use methods that temporarily configure this variable, likegetNoiseWithSeed(float, float, int)rather than changing its settings and using a method that needs that lasting configuration, likegetConfiguredNoise(float, float). If you want to use lasting settings, you should create your own new Noise object. -
SCALE2
public static final float SCALE2- See Also:
-
ADD2
public static final float ADD2- See Also:
-
MUL2
public static final float MUL2- See Also:
-
SCALE3
public static final float SCALE3- See Also:
-
ADD3
public static final float ADD3- See Also:
-
MUL3
public static final float MUL3- See Also:
-
SCALE4
public static final float SCALE4- See Also:
-
ADD4
public static final float ADD4- See Also:
-
MUL4
public static final float MUL4- See Also:
-
SCALE5
public static final float SCALE5- See Also:
-
ADD5
public static final float ADD5- See Also:
-
MUL5
public static final float MUL5- See Also:
-
SCALE6
public static final float SCALE6- See Also:
-
ADD6
public static final float ADD6- See Also:
-
MUL6
public static final float MUL6- See Also:
-
F2
public static final float F2- See Also:
-
G2
public static final float G2- See Also:
-
H2
public static final float H2- See Also:
-
LIMIT2
public static final float LIMIT2- See Also:
-
F3
public static final float F3- See Also:
-
G3
public static final float G3- See Also:
-
LIMIT3
public static final float LIMIT3- See Also:
-
F4
public static final float F4 -
G4
public static final float G4 -
LIMIT4
public static final float LIMIT4- See Also:
-
F5
public static final float F5 -
G5
public static final float G5 -
LIMIT5
public static final float LIMIT5- See Also:
-
F6
public static final float F6 -
G6
public static final float G6 -
LIMIT6
public static final float LIMIT6- See Also:
-
-
Constructor Details
-
Noise
public Noise()A constructor that takes no parameters, and uses all default settings with a seed of 1337. An example call to this would benew Noise(), which makes noise with the seed 1337, a default frequency of 1.0f/32.0f, 1 octave of Simplex noise (since this doesn't specify octave count, it always uses 1 even for the SIMPLEX_FRACTAL noiseType this uses, but you can callsetFractalOctaves(int)later to benefit from the fractal noiseType), and normal lacunarity and gain (when unspecified, they are 2f and 0.5f). -
Noise
public Noise(int seed) A constructor that takes only a parameter for the Noise's seed, which should produce different results for any different seeds. An example call to this would benew Noise(1337), which makes noise with the seed 1337, a default frequency of 1.0f/32.0f, 1 octave of Simplex noise (since this doesn't specify octave count, it always uses 1 even for the SIMPLEX_FRACTAL noiseType this uses, but you can callsetFractalOctaves(int)later to benefit from the fractal noiseType), and normal lacunarity and gain (when unspecified, they are 2f and 0.5f).- Parameters:
seed- the int seed for the noise, which should significantly affect the produced noise
-
Noise
public Noise(int seed, float frequency) A constructor that takes two parameters to specify the Noise from the start. An example call to this would benew Noise(1337, 0.02f), which makes noise with the seed 1337, a lower frequency, 1 octave of Simplex noise (since this doesn't specify octave count, it always uses 1 even for the SIMPLEX_FRACTAL noiseType this uses, but you can callsetFractalOctaves(int)later to benefit from the fractal noiseType), and normal lacunarity and gain (when unspecified, they are 2f and 0.5f).- Parameters:
seed- the int seed for the noise, which should significantly affect the produced noisefrequency- the multiplier for all dimensions, which is usually fairly small (1.0f/32.0f is the default)
-
Noise
public Noise(int seed, float frequency, int noiseType) A constructor that takes a few parameters to specify the Noise from the start. An example call to this would benew Noise(1337, 0.02f, Noise.SIMPLEX), which makes noise with the seed 1337, a lower frequency, 1 octave of Simplex noise (since this doesn't specify octave count, it always uses 1 even for noiseTypes like SIMPLEX_FRACTAL, but using a fractal noiseType can make sense if you callsetFractalOctaves(int)later), and normal lacunarity and gain (when unspecified, they are 2f and 0.5f).- Parameters:
seed- the int seed for the noise, which should significantly affect the produced noisefrequency- the multiplier for all dimensions, which is usually fairly small (1.0f/32.0f is the default)noiseType- the noiseType, which should be a constant from this class (seesetNoiseType(int))
-
Noise
public Noise(int seed, float frequency, int noiseType, int octaves) A constructor that takes several parameters to specify the Noise from the start. An example call to this would benew Noise(1337, 0.02f, Noise.SIMPLEX_FRACTAL, 4), which makes noise with the seed 1337, a lower frequency, 4 octaves of Simplex noise, and normal lacunarity and gain (when unspecified, they are 2f and 0.5f).- Parameters:
seed- the int seed for the noise, which should significantly affect the produced noisefrequency- the multiplier for all dimensions, which is usually fairly small (1.0f/32.0f is the default)noiseType- the noiseType, which should be a constant from this class (seesetNoiseType(int))octaves- how many octaves of noise to use when the noiseType is one of the _FRACTAL types
-
Noise
public Noise(int seed, float frequency, int noiseType, int octaves, float lacunarity, float gain) A constructor that takes a lot of parameters to specify the Noise from the start. An example call to this would benew Noise(1337, 0.02f, Noise.SIMPLEX_FRACTAL, 4, 0.5f, 2f), which makes noise with a lower frequency, 4 octaves of Simplex noise, and the "inverse" effect on how those octaves work (which makes the extra added octaves be more significant to the final result and also have a lower frequency, while normally added octaves have a higher frequency and tend to have a minor effect on the large-scale shape of the noise).- Parameters:
seed- the int seed for the noise, which should significantly affect the produced noisefrequency- the multiplier for all dimensions, which is usually fairly small (1.0f/32.0f is the default)noiseType- the noiseType, which should be a constant from this class (seesetNoiseType(int))octaves- how many octaves of noise to use when the noiseType is one of the _FRACTAL typeslacunarity- typically 2.0, or 0.5 to change how extra octaves work (inverse mode)gain- typically 0.5, or 2.0 to change how extra octaves work (inverse mode)
-
Noise
Copy constructor; copies all non-temporary fields fromotherinto this. This uses the same reference to anIPointHashset withsetPointHash(IPointHash), but otherwise everything it copies is a primitive value.- Parameters:
other- another Noise, which must not be null
-
-
Method Details
-
getTag
Description copied from interface:INoiseReturns a typically-four-character String constant that should uniquely identify this INoise as well as possible. If a duplicate tag is already registered andINoise.Serializer.register(INoise)attempts to register the same tag again, a message is printed toSystem.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. -
appendPretty
-
toPrettyString
-
prettyPrint
public void prettyPrint() -
stringSerialize
Writes all fields of this Noise (except for thegetPointHash(), which must be stored separately) to a String and returns it. The result of this method can be used bystringDeserialize(String), though if you need a particular IPointHash value, you need to set it yourself on the result of that method.- Specified by:
stringSerializein interfaceINoise- Returns:
- a String that stores the data of this Noise object; can be read by
stringDeserialize(String)
-
stringDeserialize
Reads in a String that was produced bystringSerialize()and produces a copy of the Noise that was stored into it. Note that neither this method nor stringSerialize changesgetPointHash()from its default value, so if you need a different value for that, you need to set it yourself on the result of this.- Specified by:
stringDeserializein interfaceINoise- Parameters:
data- a String produced bystringSerialize()- Returns:
- a new Noise object matching the data stored in the given String
-
copy
Description copied from interface:INoiseCreates 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 anUnsupportedOperationExceptiononly. Implementors are strongly encouraged to implement this in general, and that is required to use an INoise class withINoise.Serializer. -
getSeed
public long getSeed()Description copied from interface:INoiseGets 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 usingBitConversion.floatToIntBits(float)), this can just return0. -
setSeed
public void setSeed(int seed) Sets the seed used for all noise types, as a long. If this is not called, defaults to 1337L.- Parameters:
seed- a seed as a long
-
setFrequency
public void setFrequency(float frequency) Sets the frequency for all noise types. If this is not called, it defaults to 0.03125f (or 1f/32f). This setter validates the frequency, and won't set it to a float less than 0.0001f, which is small enough that floating-point precision could be an issue. Lots of things may expect this to be higher than the default; try setting frequency to1.0fif you experience issues.- Parameters:
frequency- the frequency for all noise types, as a positive non-zero float
-
getFrequency
public float getFrequency()Gets the frequency for all noise types. The default is 0.03125f, or 1f/32f.- Returns:
- the frequency for all noise types, which should be a positive non-zero float
-
setInterpolation
public void setInterpolation(int interpolation) Changes the interpolation method used to smooth between noise values, using one of the following constants from this class (lowest to highest quality):LINEAR(0),HERMITE(1), orQUINTIC(2). If this is not called, it defaults to HERMITE. This is used in Value, Perlin, and Position Perturbing, and because it is used in Value, that makes it also apply to Foam, Honey, and Mutant.- Parameters:
interpolation- an int (0, 1, or 2) corresponding to a constant from this class for an interpolation type
-
getInterpolation
public int getInterpolation()Gets the constant corresponding to the interpolation method used to smooth between noise values. This is always one of the constantsLINEAR(0),HERMITE(1), orQUINTIC(2). If this is not called, it defaults to HERMITE. This is used in Value, Perlin, and Position Perturbing, and because it is used in Value, that makes it also apply to Foam, Honey, and Mutant.- Returns:
- an int (0, 1, or 2) corresponding to a constant from this class for an interpolation type
-
setNoiseType
public void setNoiseType(int noiseType) Sets the default type of noise returned bygetConfiguredNoise(float, float), using one of the following constants in this class:VALUE(0),VALUE_FRACTAL(1),PERLIN(2),PERLIN_FRACTAL(3),SIMPLEX(4),SIMPLEX_FRACTAL(5),CELLULAR(6),CELLULAR_FRACTAL(7),CUBIC(8),CUBIC_FRACTAL(9),FOAM(10),FOAM_FRACTAL(11),HONEY(12),HONEY_FRACTAL(13),MUTANT(14),MUTANT_FRACTAL(15),TAFFY(16),TAFFY_FRACTAL(17), orWHITE_NOISE(18). If this isn't called, getConfiguredNoise() will default to SIMPLEX_FRACTAL. Note that if you have a fractal noise type, you can get the corresponding non-fractal noise type by subtracting 1 from the constant this returns. The reverse is not always true, because White Noise has no fractal version.- Parameters:
noiseType- an int from 0 to 17 corresponding to a constant from this class for a noise type
-
getNoiseType
public int getNoiseType()Gets the default type of noise returned bygetConfiguredNoise(float, float), using one of the following constants in this class:VALUE(0),VALUE_FRACTAL(1),PERLIN(2),PERLIN_FRACTAL(3),SIMPLEX(4),SIMPLEX_FRACTAL(5),CELLULAR(6),CELLULAR_FRACTAL(7),CUBIC(8),CUBIC_FRACTAL(9),FOAM(10),FOAM_FRACTAL(11),HONEY(12),HONEY_FRACTAL(13),MUTANT(14),MUTANT_FRACTAL(15),TAFFY(16),TAFFY_FRACTAL(17), orWHITE_NOISE(18). The default is SIMPLEX_FRACTAL. Note that if you have a fractal noise type, you can get the corresponding non-fractal noise type by subtracting 1 from the constant this returns. The reverse is not always true, because White Noise has no fractal version.- Returns:
- the noise type as a code, from 0 to 17 inclusive
-
setFractalOctaves
public void setFractalOctaves(int octaves) Sets the octave count for all fractal noise types. If this isn't called, it will default to 1.- Parameters:
octaves- the number of octaves to use for fractal noise types, as a positive non-zero int
-
getFractalOctaves
public int getFractalOctaves()Gets the octave count for all fractal noise types. The default is 1.- Returns:
- the number of octaves to use for fractal noise types, as a positive non-zero int
-
setFractalLacunarity
public void setFractalLacunarity(float lacunarity) Sets the octave lacunarity for all fractal noise types. Lacunarity is a multiplicative change to frequency between octaves. If this isn't called, it defaults to 2.- Parameters:
lacunarity- a non-0 float that will be used for the lacunarity of fractal noise types; commonly 2.0 or 0.5
-
getFractalLacunarity
public float getFractalLacunarity()Gets the octave lacunarity for all fractal noise types. Lacunarity is a multiplicative change to frequency between octaves. If this wasn't changed, it defaults to 2.- Returns:
- a float that will be used for the lacunarity of fractal noise types; commonly 2.0 or 0.5
-
setFractalGain
public void setFractalGain(float gain) Sets the octave gain for all fractal noise types. If this isn't called, it defaults to 0.5.- Parameters:
gain- the gain between octaves, as a float
-
getFractalGain
public float getFractalGain()Sets the octave gain for all fractal noise types. This is typically related togetFractalLacunarity(), with gain falling as lacunarity rises. If this wasn't changed, it defaults to 0.5.- Returns:
- the gain between octaves, as a float
-
setFractalType
public void setFractalType(int fractalType) Sets the method for combining octaves in all fractal noise types, allowing an int argument corresponding to one of the following constants from this class:FBM(0),BILLOW(1),RIDGED_MULTI(2), orDOMAIN_WARP(3). If this hasn't been called, it will use FBM.- Parameters:
fractalType- an int (0, 1, 2, or 3) that corresponds to a constant likeFBMorRIDGED_MULTI
-
getFractalType
public int getFractalType()Gets the method for combining octaves in all fractal noise types, allowing an int argument corresponding to one of the following constants from this class:FBM(0),BILLOW(1),RIDGED_MULTI(2), orDOMAIN_WARP(3). The default is FBM.- Returns:
- the fractal type as a code; 0, 1, 2, or 3
-
setCellularDistanceFunction
public void setCellularDistanceFunction(int cellularDistanceFunction) Sets the distance function used in cellular noise calculations, allowing an int argument corresponding to one of the following constants from this class:EUCLIDEAN(0),MANHATTAN(1), orNATURAL(2). If this hasn't been called, it will use EUCLIDEAN.- Parameters:
cellularDistanceFunction- an int that can be 0, 1, or 2, corresponding to a constant from this class
-
getCellularDistanceFunction
public int getCellularDistanceFunction()Gets the distance function used in cellular noise calculations, as an int constant from this class:EUCLIDEAN(0),MANHATTAN(1), orNATURAL(2). If this wasn't changed, it will use EUCLIDEAN.- Returns:
- an int that can be 0, 1, or 2, corresponding to a constant from this class
-
setCellularReturnType
public void setCellularReturnType(int cellularReturnType) Sets the return type from cellular noise calculations, allowing an int argument corresponding to one of the following constants from this class:CELL_VALUE(0),NOISE_LOOKUP(1),DISTANCE(2),DISTANCE_2(3),DISTANCE_2_ADD(4),DISTANCE_2_SUB(5),DISTANCE_2_MUL(6), orDISTANCE_2_DIV(7). If this isn't called, it will use CELL_VALUE.- Parameters:
cellularReturnType- a constant from this class (see above JavaDoc)
-
getCellularReturnType
public int getCellularReturnType()Gets the return type from cellular noise calculations, corresponding to a constant from this class:CELL_VALUE(0),NOISE_LOOKUP(1),DISTANCE(2),DISTANCE_2(3),DISTANCE_2_ADD(4),DISTANCE_2_SUB(5),DISTANCE_2_MUL(6), orDISTANCE_2_DIV(7). If this wasn't changed, it will use CELL_VALUE.- Returns:
- a constant from this class representing a type of cellular noise calculation
-
setCellularNoiseLookup
A no-op method that is here for compatibility with earlier versions.- Parameters:
noise- ignored
-
setGradientPerturbAmp
public void setGradientPerturbAmp(float gradientPerturbAmp) Sets the maximum perturb distance from original location when usinggradientPerturb2(float[]),gradientPerturb3(float[]),gradientPerturbFractal2(float[]), orgradientPerturbFractal3(float[]); the default is 1.0.- Parameters:
gradientPerturbAmp- the maximum perturb distance from the original location when using relevant methods
-
getGradientPerturbAmp
public float getGradientPerturbAmp()Gets the maximum perturb distance from original location when usinggradientPerturb2(float[]),gradientPerturb3(float[]),gradientPerturbFractal2(float[]), orgradientPerturbFractal3(float[]); the default is 1.0.- Returns:
- the maximum perturb distance from the original location when using relevant methods
-
getFoamSharpness
public float getFoamSharpness()Gets the "sharpness" for theFOAM,FOAM_FRACTAL,MUTANT,MUTANT_FRACTAL,CUBIC,CUBIC_FRACTAL,TAFFY, andTAFFY_FRACTALnoise types, which is usually around 0.25f to 2.0f, and defaults to 1.0f. High values produce extreme results more often, and low values produce mid-range values more often.
This is equivalent togetSharpness().- Returns:
- the current "sharpness" for some noise types (Foam, Mutant, Cubic)
-
setFoamSharpness
public void setFoamSharpness(float sharpness) Only used withFOAM,FOAM_FRACTAL,MUTANT,MUTANT_FRACTAL,CUBIC,CUBIC_FRACTAL,TAFFY, andTAFFY_FRACTALnoise types, this affects how often the noise will produce very high and very low results (more often with high sharpness values), as opposed to mid-range (more often with low sharpness values).
This defaults to 1.0f if not set. It is equivalent tosetSharpness(float).- Parameters:
sharpness- higher results (above 1) tend to produce extremes, lower results (below 1) produce mid-range
-
getSharpness
public float getSharpness()Gets the "sharpness" for theFOAM,FOAM_FRACTAL,MUTANT,MUTANT_FRACTAL,CUBIC,CUBIC_FRACTAL,TAFFY, andTAFFY_FRACTALnoise types, which is usually around 0.25f to 2.0f, and defaults to 1.0f. High values produce extreme results more often, and low values produce mid-range values more often.
This is equivalent togetFoamSharpness().- Returns:
- the current "sharpness" for some noise types (Foam, Mutant, Cubic)
-
setSharpness
public void setSharpness(float sharpness) Only used withFOAM,FOAM_FRACTAL,MUTANT,MUTANT_FRACTAL,CUBIC,CUBIC_FRACTAL,TAFFY, andTAFFY_FRACTALnoise types, this affects how often the noise will produce very high and very low results (more often with high sharpness values), as opposed to mid-range (more often with low sharpness values).
This defaults to 1.0f if not set. It is equivalent tosetFoamSharpness(float).- Parameters:
sharpness- higher results (above 1) tend to produce extremes, lower results (below 1) produce mid-range
-
getMutation
public float getMutation()Gets the mutation value used byMUTANT,MUTANT_FRACTAL,TAFFY, andTAFFY_FRACTALnoise types, which allows making small changes to the result when the mutation values are slightly different.- Returns:
- the current mutation value, which can be any finite float
-
setMutation
public void setMutation(float mutation) Sets the mutation value used byMUTANT,MUTANT_FRACTAL,TAFFY, andTAFFY_FRACTALnoise types, which can be any finite float. Small changes to the mutation value cause small changes in the result, unlike changes to the seed.- Parameters:
mutation- the mutation value to use, which can be any finite float
-
isFractalSpiral
public boolean isFractalSpiral()Returns true if this uses a spiraling rotation as octaves are added to fractal noise. This mode affects all fractal types when there are 2 or more octaves. It changesVALUE_FRACTAL,CUBIC_FRACTAL,PERLIN_FRACTAL,SIMPLEX_FRACTAL, andHONEY_FRACTALnoise types, but none of the others because those show no real improvement with this on. This mode defaults to false if not set.- Returns:
- true if using fractal spiral mode, false otherwise
-
setFractalSpiral
public void setFractalSpiral(boolean fractalSpiral) Sets the fractal spiral mode on or off; if on, this uses a spiraling rotation as octaves are added to fractal noise. This mode affects all fractal types when there are 2 or more octaves. It changesVALUE_FRACTAL,CUBIC_FRACTAL,PERLIN_FRACTAL,SIMPLEX_FRACTAL, andHONEY_FRACTALnoise types, but none of the others because those show no real improvement with this on. This mode defaults to false if not set.- Parameters:
fractalSpiral- true to set fractal spiral mode on, false to set it off
-
setPointHash
Sets the point hash, typically to one with intentional flaws, as found inFlawedPointHashtypes. Only matters forCUBICandCUBIC_FRACTALnoise types.- Parameters:
hash- a non-null IPointHash implementation
-
getPointHash
Gets the current point hash, which is only used forCUBICandCUBIC_FRACTALnoise types. This is anIntPointHashby default.- Returns:
- an IPointHash implementation, typically an
IntPointHashif not otherwise specified
-
getMinDimension
public int getMinDimension()Description copied from interface:INoiseGets 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:
getMinDimensionin interfaceINoise- Returns:
- the minimum supported dimension, from 2 to 7 inclusive
-
getMaxDimension
public int getMaxDimension()Description copied from interface:INoiseGets 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:
getMaxDimensionin interfaceINoise- Returns:
- the maximum supported dimension, from 2 to 7 inclusive
-
hasEfficientSetSeed
public boolean hasEfficientSetSeed()Description copied from interface:INoiseReturns true if this generator can be seeded withINoise.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 howINoise.getNoiseWithSeed(float, float, long)changes the seed and how setSeed() does.- Specified by:
hasEfficientSetSeedin interfaceINoise- Returns:
- whether
INoise.setSeed(long)should be efficient to call in everyINoise.getNoiseWithSeed(float, float, long)call
-
setSeed
public void setSeed(long seed) Description copied from interface:INoiseSets the seed to the given long, if long seeds are supported, or(int)seedif 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, thenINoise.hasEfficientSetSeed()should return false. That method is checked inINoise.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, checkINoise.hasEfficientSetSeed(). -
getNoise
public double getNoise(double x, double y) -
getNoise
public double getNoise(double x, double y, double z) -
getNoise
public double getNoise(double x, double y, double z, double w) -
getNoise
public double getNoise(double x, double y, double z, double w, double u) -
getNoise
public double getNoise(double x, double y, double z, double w, double u, double v) -
getNoiseWithSeed
public double getNoiseWithSeed(double x, double y, long seed) -
getNoiseWithSeed
public double getNoiseWithSeed(double x, double y, double z, long seed) -
getNoiseWithSeed
public double getNoiseWithSeed(double x, double y, double z, double w, long seed) -
getNoiseWithSeed
public double getNoiseWithSeed(double x, double y, double z, double w, double u, long seed) -
getNoiseWithSeed
public double getNoiseWithSeed(double x, double y, double z, double w, double u, double v, long seed) -
getNoise
public float getNoise(float x, float y) Description copied from interface:INoiseGets 2D noise with a default or pre-set seed. -
getNoise
public float getNoise(float x, float y, float z) Description copied from interface:INoiseGets 3D noise with a default or pre-set seed. -
getNoise
public float getNoise(float x, float y, float z, float w) Description copied from interface:INoiseGets 4D noise with a default or pre-set seed. -
getNoise
public float getNoise(float x, float y, float z, float w, float u) Description copied from interface:INoiseGets 5D noise with a default or pre-set seed.- Specified by:
getNoisein interfaceINoise- Parameters:
x- x position; can be any finite floaty- y position; can be any finite floatz- z position; can be any finite floatw- w position; can be any finite floatu- 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:INoiseGets 6D noise with a default or pre-set seed.- Specified by:
getNoisein interfaceINoise- Parameters:
x- x position; can be any finite floaty- y position; can be any finite floatz- z position; can be any finite floatw- w position; can be any finite floatu- u position; can be any finite floatv- 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, int seed) -
getNoiseWithSeed
public float getNoiseWithSeed(float x, float y, float z, int seed) -
getNoiseWithSeed
public float getNoiseWithSeed(float x, float y, float z, float w, int seed) -
getNoiseWithSeed
public float getNoiseWithSeed(float x, float y, float z, float w, float u, int seed) -
getNoiseWithSeed
public float getNoiseWithSeed(float x, float y, float z, float w, float u, float v, int seed) -
getNoiseWithSeed
public float getNoiseWithSeed(float x, float y, long seed) Description copied from interface:INoiseGets 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 withINoise.hasEfficientSetSeed().- Specified by:
getNoiseWithSeedin interfaceINoise- Parameters:
x- x position; can be any finite floaty- y position; can be any finite floatseed- 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:INoiseGets 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 withINoise.hasEfficientSetSeed().- Specified by:
getNoiseWithSeedin interfaceINoise- Parameters:
x- x position; can be any finite floaty- y position; can be any finite floatz- z position; can be any finite floatseed- 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:INoiseGets 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 withINoise.hasEfficientSetSeed().- Specified by:
getNoiseWithSeedin interfaceINoise- Parameters:
x- x position; can be any finite floaty- y position; can be any finite floatz- z position; can be any finite floatw- w position; can be any finite floatseed- 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:INoiseGets 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 withINoise.hasEfficientSetSeed().- Specified by:
getNoiseWithSeedin interfaceINoise- Parameters:
x- x position; can be any finite floaty- y position; can be any finite floatz- z position; can be any finite floatw- w position; can be any finite floatu- u position; can be any finite floatseed- 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:INoiseGets 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 withINoise.hasEfficientSetSeed().- Specified by:
getNoiseWithSeedin interfaceINoise- Parameters:
x- x position; can be any finite floaty- y position; can be any finite floatz- z position; can be any finite floatw- w position; can be any finite floatu- u position; can be any finite floatv- v position; can be any finite floatseed- can be any long- Returns:
- a noise value between -1.0f and 1.0f, both inclusive
-
fastRound
protected static int fastRound(float f) -
hermiteInterpolator
protected static float hermiteInterpolator(float t) -
quinticInterpolator
protected static float quinticInterpolator(float t) -
cubicLerp
protected static float cubicLerp(float a, float b, float c, float d, float t) -
gradCoord2D
protected float gradCoord2D(int seed, int x, int y, float xd, float yd) -
gradCoord3D
protected float gradCoord3D(int seed, int x, int y, int z, float xd, float yd, float zd) -
gradCoord4D
protected float gradCoord4D(int seed, int x, int y, int z, int w, float xd, float yd, float zd, float wd) -
gradCoord5D
protected float gradCoord5D(int seed, int x, int y, int z, int w, int u, float xd, float yd, float zd, float wd, float ud) -
gradCoord6D
protected float gradCoord6D(int seed, int x, int y, int z, int w, int u, int v, float xd, float yd, float zd, float wd, float ud, float vd) -
equalize
public static float equalize(float x, float add, float mul) Given inputs asxin the range -1.0 to 1.0 that are too biased towards 0.0, this "squashes" the range softly to widen it and spread it away from 0.0 without increasing bias anywhere else. Typically this is called internally by the Perlin noise code to distribute it in a specific (more backwards-compatible) way, using constants such asADD2andMUL2for 2D noise, or ADD3 and MUL3 for 3D noise, etc.
This starts with a common sigmoid function,x / sqrt(add + x * x), but instead of approaching -1 and 1 but never reaching them, this multiplies the result so the line crosses -1 when x is -1, and crosses 1 when x is 1. It has a smooth derivative, if that matters to you.- Parameters:
x- a float between -1 and 1add- if greater than 1, this will have nearly no effect; the lower this goes below 1, the more this will separate results near the center of the range. This must be greater than or equal to 0.0mul- typically the result of callingcalculateEqualizeAdjustment(float)onadd- Returns:
- a float with a slightly different distribution from
x, but still between -1 and 1
-
calculateEqualizeAdjustment
public static float calculateEqualizeAdjustment(float add) Gets the value to optimally use formulinequalize(float, float, float), given the value that will be used asaddthere. If mul is calculated in some other way, inputs in the -1 to 1 range won't have outputs in the -1 to 1 range from equalize().
This is mathematically the same as using1f / equalize(1f, add, 1f), but has a faster implementation.- Parameters:
add- the value that will be used asaddin a call toequalize(float, float, float)- Returns:
- the value to use as
mulinequalize(float, float, float)
-
rotateX2D
protected static float rotateX2D(float x, float y) -
rotateY2D
protected static float rotateY2D(float x, float y) -
rotateX3D
protected static float rotateX3D(float x, float y, float z) -
rotateY3D
protected static float rotateY3D(float x, float y, float z) -
rotateZ3D
protected static float rotateZ3D(float x, float y, float z) -
rotateX4D
protected static float rotateX4D(float x, float y, float z, float w) -
rotateY4D
protected static float rotateY4D(float x, float y, float z, float w) -
rotateZ4D
protected static float rotateZ4D(float x, float y, float z, float w) -
rotateW4D
protected static float rotateW4D(float x, float y, float z, float w) -
rotateX5D
protected static float rotateX5D(float x, float y, float z, float w, float u) -
rotateY5D
protected static float rotateY5D(float x, float y, float z, float w, float u) -
rotateZ5D
protected static float rotateZ5D(float x, float y, float z, float w, float u) -
rotateW5D
protected static float rotateW5D(float x, float y, float z, float w, float u) -
rotateU5D
protected static float rotateU5D(float x, float y, float z, float w, float u) -
rotateX6D
protected static float rotateX6D(float x, float y, float z, float w, float u, float v) -
rotateY6D
protected static float rotateY6D(float x, float y, float z, float w, float u, float v) -
rotateZ6D
protected static float rotateZ6D(float x, float y, float z, float w, float u, float v) -
rotateW6D
protected static float rotateW6D(float x, float y, float z, float w, float u, float v) -
rotateU6D
protected static float rotateU6D(float x, float y, float z, float w, float u, float v) -
rotateV6D
protected static float rotateV6D(float x, float y, float z, float w, float u, float v) -
rotateX7D
protected static float rotateX7D(float x, float y, float z, float w, float u, float v, float m) -
rotateY7D
protected static float rotateY7D(float x, float y, float z, float w, float u, float v, float m) -
rotateZ7D
protected static float rotateZ7D(float x, float y, float z, float w, float u, float v, float m) -
rotateW7D
protected static float rotateW7D(float x, float y, float z, float w, float u, float v, float m) -
rotateU7D
protected static float rotateU7D(float x, float y, float z, float w, float u, float v, float m) -
rotateV7D
protected static float rotateV7D(float x, float y, float z, float w, float u, float v, float m) -
rotateM7D
protected static float rotateM7D(float x, float y, float z, float w, float u, float v, float m) -
getConfiguredNoise
public float getConfiguredNoise(float x, float y) After being configured with the setters in this class, such assetNoiseType(int),setFrequency(float),setFractalOctaves(int), andsetFractalType(int), among others, you can call this method to get the particular variety of noise you specified, in 2D.- Parameters:
x- x position, as a float; the range this should have depends ongetFrequency()y- y position, as a float; the range this should have depends ongetFrequency()- Returns:
- noise as a float from -1f to 1f
-
getConfiguredNoise
public float getConfiguredNoise(float x, float y, float z) After being configured with the setters in this class, such assetNoiseType(int),setFrequency(float),setFractalOctaves(int), andsetFractalType(int), among others, you can call this method to get the particular variety of noise you specified, in 3D.- Parameters:
x- x position, as a float; the range this should have depends ongetFrequency()y- y position, as a float; the range this should have depends ongetFrequency()z- z position, as a float; the range this should have depends ongetFrequency()- Returns:
- noise as a float from -1f to 1f
-
getConfiguredNoise
public float getConfiguredNoise(float x, float y, float z, float w) After being configured with the setters in this class, such assetNoiseType(int),setFrequency(float),setFractalOctaves(int), andsetFractalType(int), among others, you can call this method to get the particular variety of noise you specified, in 4D.- Parameters:
x- x position, as a float; the range this should have depends ongetFrequency()y- y position, as a float; the range this should have depends ongetFrequency()z- z position, as a float; the range this should have depends ongetFrequency()w- w position, as a float; the range this should have depends ongetFrequency()- Returns:
- noise as a float from -1f to 1f
-
getConfiguredNoise
public float getConfiguredNoise(float x, float y, float z, float w, float u) After being configured with the setters in this class, such assetNoiseType(int),setFrequency(float),setFractalOctaves(int), andsetFractalType(int), among others, you can call this method to get the particular variety of noise you specified, in 5D.- Parameters:
x- x position, as a float; the range this should have depends ongetFrequency()y- y position, as a float; the range this should have depends ongetFrequency()z- z position, as a float; the range this should have depends ongetFrequency()w- w position, as a float; the range this should have depends ongetFrequency()u- u position, as a float; the range this should have depends ongetFrequency()- Returns:
- noise as a float from -1f to 1f
-
getConfiguredNoise
public float getConfiguredNoise(float x, float y, float z, float w, float u, float v) After being configured with the setters in this class, such assetNoiseType(int),setFrequency(float),setFractalOctaves(int), andsetFractalType(int), among others, you can call this method to get the particular variety of noise you specified, in 6D.- Parameters:
x- x position, as a float; the range this should have depends ongetFrequency()y- y position, as a float; the range this should have depends ongetFrequency()z- z position, as a float; the range this should have depends ongetFrequency()w- w position, as a float; the range this should have depends ongetFrequency()u- u position, as a float; the range this should have depends ongetFrequency()v- v position, as a float; the range this should have depends ongetFrequency()- Returns:
- noise as a float from -1f to 1f
-
getWhiteNoise
public float getWhiteNoise(float x, float y) -
getWhiteNoise
public float getWhiteNoise(float x, float y, float z) -
getWhiteNoise
public float getWhiteNoise(float x, float y, float z, float w) -
getWhiteNoise
public float getWhiteNoise(float x, float y, float z, float w, float u) -
getWhiteNoise
public float getWhiteNoise(float x, float y, float z, float w, float u, float v) -
wobbleTight
public static float wobbleTight(int seed, float value) A smooth 1D noise function that produces results between 0.0 and 1.0, and is optimized for usage on GWT. This uses cubic interpolation between random peak or valley points.- Parameters:
seed- an int seed that will determine the pattern of peaks and valleys this will generate as value changes; this should not change between callsvalue- a float that typically changes slowly, by less than 2.0, with direction changes at integer inputs- Returns:
- a pseudo-random float between 0f and 1f (both inclusive), smoothly changing with value
-
getValueFractal
public float getValueFractal(float x, float y) -
singleValueFractalFBM
protected float singleValueFractalFBM(float x, float y) -
singleValueFractalDomainWarp
protected float singleValueFractalDomainWarp(float x, float y) -
singleValueFractalBillow
protected float singleValueFractalBillow(float x, float y) -
singleValueFractalRidgedMulti
protected float singleValueFractalRidgedMulti(float x, float y) -
getValue
public float getValue(float x, float y) -
singleValue
public float singleValue(int seed, float x, float y) -
valueNoise
protected float valueNoise(int seed, float x, float y) Produces noise from 0 to 1, instead of the normal -1 to 1.- Parameters:
seed-x-y-- Returns:
- noise from 0 to 1.
-
getValueFractal
public float getValueFractal(float x, float y, float z) -
singleValueFractalFBM
protected float singleValueFractalFBM(float x, float y, float z) -
singleValueFractalDomainWarp
protected float singleValueFractalDomainWarp(float x, float y, float z) -
singleValueFractalBillow
protected float singleValueFractalBillow(float x, float y, float z) -
singleValueFractalRidgedMulti
protected float singleValueFractalRidgedMulti(float x, float y, float z) -
getValue
public float getValue(float x, float y, float z) -
singleValue
public float singleValue(int seed, float x, float y, float z) -
valueNoise
protected float valueNoise(int seed, float x, float y, float z) Produces noise from 0 to 1, instead of the normal -1 to 1.- Parameters:
seed-x-y-z-- Returns:
- noise from 0 to 1.
-
getValueFractal
public float getValueFractal(float x, float y, float z, float w) -
singleValueFractalFBM
protected float singleValueFractalFBM(float x, float y, float z, float w) -
singleValueFractalDomainWarp
protected float singleValueFractalDomainWarp(float x, float y, float z, float w) -
singleValueFractalBillow
protected float singleValueFractalBillow(float x, float y, float z, float w) -
singleValueFractalRidgedMulti
protected float singleValueFractalRidgedMulti(float x, float y, float z, float w) -
getValue
public float getValue(float x, float y, float z, float w) -
singleValue
public float singleValue(int seed, float x, float y, float z, float w) -
valueNoise
protected float valueNoise(int seed, float x, float y, float z, float w) -
getValueFractal
public float getValueFractal(float x, float y, float z, float w, float u) -
singleValueFractalFBM
protected float singleValueFractalFBM(float x, float y, float z, float w, float u) -
singleValueFractalDomainWarp
protected float singleValueFractalDomainWarp(float x, float y, float z, float w, float u) -
singleValueFractalBillow
protected float singleValueFractalBillow(float x, float y, float z, float w, float u) -
singleValueFractalRidgedMulti
protected float singleValueFractalRidgedMulti(float x, float y, float z, float w, float u) -
getValue
public float getValue(float x, float y, float z, float w, float u) -
singleValue
public float singleValue(int seed, float x, float y, float z, float w, float u) -
valueNoise
protected float valueNoise(int seed, float x, float y, float z, float w, float u) -
getValueFractal
public float getValueFractal(float x, float y, float z, float w, float u, float v) -
singleValueFractalFBM
protected float singleValueFractalFBM(float x, float y, float z, float w, float u, float v) -
singleValueFractalDomainWarp
protected float singleValueFractalDomainWarp(float x, float y, float z, float w, float u, float v) -
singleValueFractalBillow
protected float singleValueFractalBillow(float x, float y, float z, float w, float u, float v) -
singleValueFractalRidgedMulti
protected float singleValueFractalRidgedMulti(float x, float y, float z, float w, float u, float v) -
getValue
public float getValue(float x, float y, float z, float w, float u, float v) -
singleValue
public float singleValue(int seed, float x, float y, float z, float w, float u, float v) -
valueNoise
protected float valueNoise(int seed, float x, float y, float z, float w, float u, float v) -
valueNoise
protected float valueNoise(int seed, float x, float y, float z, float w, float u, float v, float m) -
getFoam
public float getFoam(float x, float y) -
singleFoam
public float singleFoam(int seed, float x, float y) -
getFoamFractal
public float getFoamFractal(float x, float y) -
singleFoamFractalFBM
protected float singleFoamFractalFBM(float x, float y) -
singleFoamFractalDomainWarp
protected float singleFoamFractalDomainWarp(float x, float y) -
singleFoamFractalBillow
protected float singleFoamFractalBillow(float x, float y) -
singleFoamFractalRidgedMulti
protected float singleFoamFractalRidgedMulti(float x, float y) -
getFoamFractal
public float getFoamFractal(float x, float y, float z) -
singleFoamFractalFBM
protected float singleFoamFractalFBM(float x, float y, float z) -
singleFoamFractalDomainWarp
protected float singleFoamFractalDomainWarp(float x, float y, float z) -
singleFoamFractalBillow
protected float singleFoamFractalBillow(float x, float y, float z) -
singleFoamFractalRidgedMulti
protected float singleFoamFractalRidgedMulti(float x, float y, float z) -
getFoam
public float getFoam(float x, float y, float z) -
singleFoam
public float singleFoam(int seed, float x, float y, float z) -
singleFoamFractalFBM
protected float singleFoamFractalFBM(float x, float y, float z, float w) -
singleFoamFractalDomainWarp
protected float singleFoamFractalDomainWarp(float x, float y, float z, float w) -
singleFoamFractalBillow
protected float singleFoamFractalBillow(float x, float y, float z, float w) -
singleFoamFractalRidgedMulti
protected float singleFoamFractalRidgedMulti(float x, float y, float z, float w) -
getFoam
public float getFoam(float x, float y, float z, float w) -
singleFoam
public float singleFoam(int seed, float x, float y, float z, float w) -
getFoamFractal
public float getFoamFractal(float x, float y, float z, float w, float u) -
singleFoamFractalFBM
protected float singleFoamFractalFBM(float x, float y, float z, float w, float u) -
singleFoamFractalDomainWarp
protected float singleFoamFractalDomainWarp(float x, float y, float z, float w, float u) -
singleFoamFractalBillow
protected float singleFoamFractalBillow(float x, float y, float z, float w, float u) -
singleFoamFractalRidgedMulti
protected float singleFoamFractalRidgedMulti(float x, float y, float z, float w, float u) -
getFoam
public float getFoam(float x, float y, float z, float w, float u) -
singleFoam
public float singleFoam(int seed, float x, float y, float z, float w, float u) -
getFoamFractal
public float getFoamFractal(float x, float y, float z, float w, float u, float v) -
singleFoamFractalFBM
protected float singleFoamFractalFBM(float x, float y, float z, float w, float u, float v) -
singleFoamFractalDomainWarp
protected float singleFoamFractalDomainWarp(float x, float y, float z, float w, float u, float v) -
singleFoamFractalBillow
protected float singleFoamFractalBillow(float x, float y, float z, float w, float u, float v) -
singleFoamFractalRidgedMulti
protected float singleFoamFractalRidgedMulti(float x, float y, float z, float w, float u, float v) -
getFoam
public float getFoam(float x, float y, float z, float w, float u, float v) -
singleFoam
public float singleFoam(int seed, float x, float y, float z, float w, float u, float v) -
singleFoamFractalFBM
protected float singleFoamFractalFBM(float x, float y, float z, float w, float u, float v, float m) -
singleFoamFractalDomainWarp
protected float singleFoamFractalDomainWarp(float x, float y, float z, float w, float u, float v, float m) -
singleFoamFractalBillow
protected float singleFoamFractalBillow(float x, float y, float z, float w, float u, float v, float m) -
singleFoamFractalRidgedMulti
protected float singleFoamFractalRidgedMulti(float x, float y, float z, float w, float u, float v, float m) -
singleFoam
public float singleFoam(int seed, float x, float y, float z, float w, float u, float v, float m) -
getTaffy
public float getTaffy(float x, float y) -
trillNoise
protected float trillNoise(int seed, float x, float y) -
trillNoise
protected float trillNoise(int seed, float x, float y, float z) -
trillNoise
protected float trillNoise(int seed, float x, float y, float z, float w) -
trillNoise
protected float trillNoise(int seed, float x, float y, float z, float w, float u) -
trillNoise
protected float trillNoise(int seed, float x, float y, float z, float w, float u, float v) -
trillNoise
protected float trillNoise(int seed, float x, float y, float z, float w, float u, float v, float m) -
trillNoise
protected float trillNoise(int seed, float x, float y, float z, float w, float u, float v, float m, float n) -
singleTaffyVarargs
public float singleTaffyVarargs(int seed, float... coordinates) -
singleTaffy
public float singleTaffy(int seed, float x, float y) -
getTaffyFractal
public float getTaffyFractal(float x, float y) -
singleTaffyFractalFBM
protected float singleTaffyFractalFBM(float x, float y) -
singleTaffyFractalBillow
protected float singleTaffyFractalBillow(float x, float y) -
singleTaffyFractalRidgedMulti
protected float singleTaffyFractalRidgedMulti(float x, float y) -
getTaffyFractal
public float getTaffyFractal(float x, float y, float z) -
singleTaffyFractalFBM
protected float singleTaffyFractalFBM(float x, float y, float z) -
singleTaffyFractalDomainWarp
protected float singleTaffyFractalDomainWarp(float x, float y, float z) -
singleTaffyFractalBillow
protected float singleTaffyFractalBillow(float x, float y, float z) -
singleTaffyFractalRidgedMulti
protected float singleTaffyFractalRidgedMulti(float x, float y, float z) -
getTaffy
public float getTaffy(float x, float y, float z) -
singleTaffy
public float singleTaffy(int seed, float x, float y, float z) -
singleTaffyFractalFBM
protected float singleTaffyFractalFBM(float x, float y, float z, float w) -
singleTaffyFractalDomainWarp
protected float singleTaffyFractalDomainWarp(float x, float y, float z, float w) -
singleTaffyFractalBillow
protected float singleTaffyFractalBillow(float x, float y, float z, float w) -
singleTaffyFractalRidgedMulti
protected float singleTaffyFractalRidgedMulti(float x, float y, float z, float w) -
getTaffyFractal
public float getTaffyFractal(float x, float y, float z, float w) -
getTaffy
public float getTaffy(float x, float y, float z, float w) -
singleTaffy
public float singleTaffy(int seed, float x, float y, float z, float w) -
getTaffyFractal
public float getTaffyFractal(float x, float y, float z, float w, float u) -
singleTaffyFractalFBM
protected float singleTaffyFractalFBM(float x, float y, float z, float w, float u) -
singleTaffyFractalDomainWarp
protected float singleTaffyFractalDomainWarp(float x, float y, float z, float w, float u) -
singleTaffyFractalBillow
protected float singleTaffyFractalBillow(float x, float y, float z, float w, float u) -
singleTaffyFractalRidgedMulti
protected float singleTaffyFractalRidgedMulti(float x, float y, float z, float w, float u) -
getTaffy
public float getTaffy(float x, float y, float z, float w, float u) -
singleTaffy
public float singleTaffy(int seed, float x, float y, float z, float w, float u) -
getTaffyFractal
public float getTaffyFractal(float x, float y, float z, float w, float u, float v) -
singleTaffyFractalFBM
protected float singleTaffyFractalFBM(float x, float y, float z, float w, float u, float v) -
singleTaffyFractalDomainWarp
protected float singleTaffyFractalDomainWarp(float x, float y, float z, float w, float u, float v) -
singleTaffyFractalBillow
protected float singleTaffyFractalBillow(float x, float y, float z, float w, float u, float v) -
singleTaffyFractalRidgedMulti
protected float singleTaffyFractalRidgedMulti(float x, float y, float z, float w, float u, float v) -
getTaffy
public float getTaffy(float x, float y, float z, float w, float u, float v) -
singleTaffy
public float singleTaffy(int seed, float x, float y, float z, float w, float u, float v) -
singleTaffyFractalFBM
protected float singleTaffyFractalFBM(float x, float y, float z, float w, float u, float v, float m) -
singleTaffyFractalDomainWarp
protected float singleTaffyFractalDomainWarp(float x, float y, float z, float w, float u, float v, float m) -
singleTaffyFractalBillow
protected float singleTaffyFractalBillow(float x, float y, float z, float w, float u, float v, float m) -
singleTaffyFractalRidgedMulti
protected float singleTaffyFractalRidgedMulti(float x, float y, float z, float w, float u, float v, float m) -
singleTaffy
public float singleTaffy(int seed, float x, float y, float z, float w, float u, float v, float m) -
getPerlinFractal
public float getPerlinFractal(float x, float y) -
singlePerlinFractalFBM
protected float singlePerlinFractalFBM(float x, float y) -
singlePerlinFractalDomainWarp
protected float singlePerlinFractalDomainWarp(float x, float y) -
singlePerlinFractalBillow
protected float singlePerlinFractalBillow(float x, float y) -
singlePerlinFractalRidgedMulti
protected float singlePerlinFractalRidgedMulti(float x, float y) -
getPerlin
public float getPerlin(float x, float y) -
singlePerlin
protected float singlePerlin(int seed, float x, float y) -
getPerlinFractal
public float getPerlinFractal(float x, float y, float z) -
singlePerlinFractalFBM
protected float singlePerlinFractalFBM(float x, float y, float z) -
singlePerlinFractalDomainWarp
protected float singlePerlinFractalDomainWarp(float x, float y, float z) -
singlePerlinFractalBillow
protected float singlePerlinFractalBillow(float x, float y, float z) -
singlePerlinFractalRidgedMulti
protected float singlePerlinFractalRidgedMulti(float x, float y, float z) -
getPerlin
public float getPerlin(float x, float y, float z) -
singlePerlin
protected float singlePerlin(int seed, float x, float y, float z) -
getPerlin
public float getPerlin(float x, float y, float z, float w) -
singlePerlin
protected float singlePerlin(int seed, float x, float y, float z, float w) -
singlePerlinFractalFBM
protected float singlePerlinFractalFBM(float x, float y, float z, float w) -
singlePerlinFractalDomainWarp
protected float singlePerlinFractalDomainWarp(float x, float y, float z, float w) -
singlePerlinFractalBillow
protected float singlePerlinFractalBillow(float x, float y, float z, float w) -
singlePerlinFractalRidgedMulti
protected float singlePerlinFractalRidgedMulti(float x, float y, float z, float w) -
getPerlin
public float getPerlin(float x, float y, float z, float w, float u) -
singlePerlin
protected float singlePerlin(int seed, float x, float y, float z, float w, float u) -
singlePerlinFractalFBM
protected float singlePerlinFractalFBM(float x, float y, float z, float w, float u) -
singlePerlinFractalDomainWarp
protected float singlePerlinFractalDomainWarp(float x, float y, float z, float w, float u) -
singlePerlinFractalBillow
protected float singlePerlinFractalBillow(float x, float y, float z, float w, float u) -
singlePerlinFractalRidgedMulti
protected float singlePerlinFractalRidgedMulti(float x, float y, float z, float w, float u) -
getPerlin
public float getPerlin(float x, float y, float z, float w, float u, float v) -
singlePerlin
protected float singlePerlin(int seed, float x, float y, float z, float w, float u, float v) -
singlePerlinFractalFBM
protected float singlePerlinFractalFBM(float x, float y, float z, float w, float u, float v) -
singlePerlinFractalDomainWarp
protected float singlePerlinFractalDomainWarp(float x, float y, float z, float w, float u, float v) -
singlePerlinFractalBillow
protected float singlePerlinFractalBillow(float x, float y, float z, float w, float u, float v) -
singlePerlinFractalRidgedMulti
protected float singlePerlinFractalRidgedMulti(float x, float y, float z, float w, float u, float v) -
getSimplexFractal
public float getSimplexFractal(float x, float y) -
layered2D
public float layered2D(float x, float y, int seed, int octaves) Generates FBM simplex noise with the given amount of octaves and default frequency (0.03125), lacunarity (2) and gain (0.5) in 2D.- Parameters:
x-y-seed-octaves-- Returns:
- noise as a float between -1f and 1f
-
layered2D
public float layered2D(float x, float y, int seed, int octaves, float frequency) Generates FBM simplex noise with the given amount of octaves, given frequency, default lacunarity (2) and default gain (0.5) in 2D.- Parameters:
x-y-seed-octaves-- Returns:
- noise as a float between -1f and 1f
-
layered2D
public float layered2D(float x, float y, int seed, int octaves, float frequency, float lacunarity) Generates FBM simplex noise with the given amount of octaves and specified lacunarity (the amount of frequency change between octaves) and gain (1.0f / lacunarity) in 2D.- Parameters:
x-y-seed-octaves-- Returns:
- noise as a float between -1f and 1f
-
layered2D
public float layered2D(float x, float y, int seed, int octaves, float frequency, float lacunarity, float gain) Generates FBM simplex noise with the given amount of octaves and specified lacunarity (the amount of frequency change between octaves) and gain (loosely, how much to emphasize lower-frequency octaves) in 2D.- Parameters:
x-y-seed-octaves-- Returns:
- noise as a float between -1f and 1f
-
ridged2D
public float ridged2D(float x, float y, int seed, int octaves) Generates ridged-multi simplex noise with the given amount of octaves and default frequency (0.03125), lacunarity (2) and gain (0.5).- Parameters:
x-y-seed-octaves-- Returns:
- noise as a float between -1f and 1f
-
ridged2D
public float ridged2D(float x, float y, int seed, int octaves, float frequency) Generates ridged-multi simplex noise with the given amount of octaves and default frequency (0.03125), lacunarity (2) and gain (0.5).- Parameters:
x-y-seed-octaves-- Returns:
- noise as a float between -1f and 1f
-
ridged2D
public float ridged2D(float x, float y, int seed, int octaves, float frequency, float lacunarity) Generates ridged-multi simplex noise with the given amount of octaves and specified lacunarity (the amount of frequency change between octaves); gain is not used.- Parameters:
x-y-seed- any intoctaves- how many "layers of detail" to generate; at least 1, but note this slows down with many octavesfrequency- often about1f / 32f, but generally adjusted for the use caselacunarity- whenoctavesis 2 or more, this affects the change between layers- Returns:
- noise as a float between -1f and 1f
-
singleSimplexFractalFBM
protected float singleSimplexFractalFBM(float x, float y) -
singleSimplexFractalDomainWarp
protected float singleSimplexFractalDomainWarp(float x, float y) -
singleSimplexFractalBillow
protected float singleSimplexFractalBillow(float x, float y) -
singleSimplexFractalRidgedMulti
protected float singleSimplexFractalRidgedMulti(float x, float y) -
getSimplex
public float getSimplex(float x, float y) -
singleSimplex
public float singleSimplex(int seed, float x, float y) -
getSimplexFractal
public float getSimplexFractal(float x, float y, float z) -
layered3D
public float layered3D(float x, float y, float z, int seed, int octaves) Generates FBM simplex noise with the given amount of octaves and default frequency (0.03125), lacunarity (2) and gain (0.5) in 3D.- Parameters:
x-y-z-seed-octaves-- Returns:
- noise as a float between -1f and 1f
-
layered3D
public float layered3D(float x, float y, float z, int seed, int octaves, float frequency) Generates FBM simplex noise with the given amount of octaves, given frequency, and default lacunarity (2) and gain (0.5) in 3D.- Parameters:
x-y-z-seed-octaves-- Returns:
- noise as a float between -1f and 1f
-
layered3D
public float layered3D(float x, float y, float z, int seed, int octaves, float frequency, float lacunarity) Generates FBM simplex noise with the given amount of octaves, given frequency, and specified lacunarity (the amount of frequency change between octaves) and gain (1.0f / lacunarity) in 3D.- Parameters:
x-y-z-seed-octaves-frequency-lacunarity-- Returns:
- noise as a float between -1f and 1f
-
layered3D
public float layered3D(float x, float y, float z, int seed, int octaves, float frequency, float lacunarity, float gain) Generates FBM simplex noise with the given amount of octaves, given frequency, given lacunarity (the amount of frequency change between octaves) and gain (loosely, how much to emphasize lower-frequency octaves) in 3D.- Parameters:
x-y-z-seed-octaves-frequency-lacunarity-gain-- Returns:
- noise as a float between -1f and 1f
-
ridged3D
public float ridged3D(float x, float y, float z, int seed, int octaves) Generates ridged-multi simplex noise with the given amount of octaves and default frequency (0.03125), lacunarity (2) and gain (0.5).- Parameters:
x-y-z-seed-octaves-- Returns:
- noise as a float between -1f and 1f
-
ridged3D
public float ridged3D(float x, float y, float z, int seed, int octaves, float frequency) Generates ridged-multi simplex noise with the given amount of octaves, specified frequency, and the default lacunarity (2) and gain (0.5).- Parameters:
x-y-z-seed-octaves-- Returns:
- noise as a float between -1f and 1f
-
ridged3D
public float ridged3D(float x, float y, float z, int seed, int octaves, float frequency, float lacunarity) Generates ridged-multi simplex noise with the given amount of octaves and specified lacunarity (the amount of frequency change between octaves); gain is not used.- Parameters:
x-y-z-seed- any intoctaves- how many "layers of detail" to generate; at least 1, but note this slows down with many octavesfrequency- often about1f / 32f, but generally adjusted for the use caselacunarity- whenoctavesis 2 or more, this affects the change between layers- Returns:
- noise as a float between -1f and 1f
-
singleSimplexFractalFBM
protected float singleSimplexFractalFBM(float x, float y, float z) -
singleSimplexFractalDomainWarp
protected float singleSimplexFractalDomainWarp(float x, float y, float z) -
singleSimplexFractalBillow
protected float singleSimplexFractalBillow(float x, float y, float z) -
singleSimplexFractalRidgedMulti
protected float singleSimplexFractalRidgedMulti(float x, float y, float z) -
getSimplex
public float getSimplex(float x, float y, float z) -
singleSimplex
public float singleSimplex(int seed, float x, float y, float z) -
getSimplexFractal
public float getSimplexFractal(float x, float y, float z, float w) -
singleSimplexFractalFBM
protected float singleSimplexFractalFBM(float x, float y, float z, float w) -
singleSimplexFractalDomainWarp
protected float singleSimplexFractalDomainWarp(float x, float y, float z, float w) -
singleSimplexFractalRidgedMulti
protected float singleSimplexFractalRidgedMulti(float x, float y, float z, float w) -
singleSimplexFractalBillow
protected float singleSimplexFractalBillow(float x, float y, float z, float w) -
getSimplex
public float getSimplex(float x, float y, float z, float w) -
singleSimplex
public float singleSimplex(int seed, float x, float y, float z, float w) -
getSimplex
public float getSimplex(float x, float y, float z, float w, float u) -
getSimplexFractal
public float getSimplexFractal(float x, float y, float z, float w, float u) -
singleSimplexFractalFBM
protected float singleSimplexFractalFBM(float x, float y, float z, float w, float u) -
singleSimplexFractalDomainWarp
protected float singleSimplexFractalDomainWarp(float x, float y, float z, float w, float u) -
singleSimplexFractalRidgedMulti
protected float singleSimplexFractalRidgedMulti(float x, float y, float z, float w, float u) -
singleSimplexFractalBillow
protected float singleSimplexFractalBillow(float x, float y, float z, float w, float u) -
singleSimplex
public float singleSimplex(int seed, float x, float y, float z, float w, float u) -
getSimplex
public float getSimplex(float x, float y, float z, float w, float u, float v) -
getSimplexFractal
public float getSimplexFractal(float x, float y, float z, float w, float u, float v) -
singleSimplexFractalFBM
protected float singleSimplexFractalFBM(float x, float y, float z, float w, float u, float v) -
singleSimplexFractalDomainWarp
protected float singleSimplexFractalDomainWarp(float x, float y, float z, float w, float u, float v) -
singleSimplexFractalRidgedMulti
protected float singleSimplexFractalRidgedMulti(float x, float y, float z, float w, float u, float v) -
singleSimplexFractalBillow
protected float singleSimplexFractalBillow(float x, float y, float z, float w, float u, float v) -
singleSimplex
public float singleSimplex(int seed, float x, float y, float z, float w, float u, float v) -
getCubicFractal
public float getCubicFractal(float x, float y) -
singleCubicFractalFBM
protected float singleCubicFractalFBM(float x, float y) -
singleCubicFractalDomainWarp
protected float singleCubicFractalDomainWarp(float x, float y) -
singleCubicFractalBillow
protected float singleCubicFractalBillow(float x, float y) -
singleCubicFractalRidgedMulti
protected float singleCubicFractalRidgedMulti(float x, float y) -
getCubic
public float getCubic(float x, float y) -
singleCubic
protected float singleCubic(int seed, float x, float y) -
getCubicFractal
public float getCubicFractal(float x, float y, float z) -
singleCubicFractalFBM
protected float singleCubicFractalFBM(float x, float y, float z) -
singleCubicFractalDomainWarp
protected float singleCubicFractalDomainWarp(float x, float y, float z) -
singleCubicFractalBillow
protected float singleCubicFractalBillow(float x, float y, float z) -
singleCubicFractalRidgedMulti
protected float singleCubicFractalRidgedMulti(float x, float y, float z) -
getCubic
public float getCubic(float x, float y, float z) -
singleCubic
protected float singleCubic(int seed, float x, float y, float z) -
getCubicFractal
public float getCubicFractal(float x, float y, float z, float w) -
singleCubicFractalFBM
protected float singleCubicFractalFBM(float x, float y, float z, float w) -
singleCubicFractalDomainWarp
protected float singleCubicFractalDomainWarp(float x, float y, float z, float w) -
singleCubicFractalBillow
protected float singleCubicFractalBillow(float x, float y, float z, float w) -
singleCubicFractalRidgedMulti
protected float singleCubicFractalRidgedMulti(float x, float y, float z, float w) -
getCubic
public float getCubic(float x, float y, float z, float w) -
singleCubic
protected float singleCubic(int seed, float x, float y, float z, float w) -
getCellular
public float getCellular(float x, float y) -
switchCellular
public float switchCellular(int seed, float x, float y) -
singleCellular
protected float singleCellular(int seed, float x, float y) -
singleCellularMerging
protected float singleCellularMerging(int seed, float x, float y) -
singleCellular2Edge
protected float singleCellular2Edge(int seed, float x, float y) -
singleCellularFractalFBM
protected float singleCellularFractalFBM(float x, float y) -
singleCellularFractalDomainWarp
protected float singleCellularFractalDomainWarp(float x, float y) -
singleCellularFractalBillow
protected float singleCellularFractalBillow(float x, float y) -
singleCellularFractalRidgedMulti
protected float singleCellularFractalRidgedMulti(float x, float y) -
getCellular
public float getCellular(float x, float y, float z) -
switchCellular
protected float switchCellular(int seed, float x, float y, float z) -
singleCellular
protected float singleCellular(int seed, float x, float y, float z) -
singleCellularMerging
protected float singleCellularMerging(int seed, float x, float y, float z) -
singleCellular2Edge
protected float singleCellular2Edge(int seed, float x, float y, float z) -
singleCellularFractalFBM
protected float singleCellularFractalFBM(float x, float y, float z) -
singleCellularFractalDomainWarp
protected float singleCellularFractalDomainWarp(float x, float y, float z) -
singleCellularFractalBillow
protected float singleCellularFractalBillow(float x, float y, float z) -
singleCellularFractalRidgedMulti
protected float singleCellularFractalRidgedMulti(float x, float y, float z) -
getHoney
public float getHoney(float x, float y) -
singleHoney
public float singleHoney(int seed, float x, float y) -
getHoneyFractal
public float getHoneyFractal(float x, float y) -
singleHoneyFractalFBM
protected float singleHoneyFractalFBM(float x, float y) -
singleHoneyFractalDomainWarp
protected float singleHoneyFractalDomainWarp(float x, float y) -
singleHoneyFractalBillow
protected float singleHoneyFractalBillow(float x, float y) -
singleHoneyFractalRidgedMulti
protected float singleHoneyFractalRidgedMulti(float x, float y) -
getHoneyFractal
public float getHoneyFractal(float x, float y, float z) -
singleHoneyFractalFBM
protected float singleHoneyFractalFBM(float x, float y, float z) -
singleHoneyFractalDomainWarp
protected float singleHoneyFractalDomainWarp(float x, float y, float z) -
singleHoneyFractalBillow
protected float singleHoneyFractalBillow(float x, float y, float z) -
singleHoneyFractalRidgedMulti
protected float singleHoneyFractalRidgedMulti(float x, float y, float z) -
getHoney
public float getHoney(float x, float y, float z) -
singleHoney
public float singleHoney(int seed, float x, float y, float z) -
singleHoneyFractalFBM
protected float singleHoneyFractalFBM(float x, float y, float z, float w) -
singleHoneyFractalDomainWarp
protected float singleHoneyFractalDomainWarp(float x, float y, float z, float w) -
singleHoneyFractalBillow
protected float singleHoneyFractalBillow(float x, float y, float z, float w) -
singleHoneyFractalRidgedMulti
protected float singleHoneyFractalRidgedMulti(float x, float y, float z, float w) -
getHoney
public float getHoney(float x, float y, float z, float w) -
singleHoney
public float singleHoney(int seed, float x, float y, float z, float w) -
getHoneyFractal
public float getHoneyFractal(float x, float y, float z, float w, float u) -
singleHoneyFractalFBM
protected float singleHoneyFractalFBM(float x, float y, float z, float w, float u) -
singleHoneyFractalDomainWarp
protected float singleHoneyFractalDomainWarp(float x, float y, float z, float w, float u) -
singleHoneyFractalBillow
protected float singleHoneyFractalBillow(float x, float y, float z, float w, float u) -
singleHoneyFractalRidgedMulti
protected float singleHoneyFractalRidgedMulti(float x, float y, float z, float w, float u) -
getHoney
public float getHoney(float x, float y, float z, float w, float u) -
singleHoney
public float singleHoney(int seed, float x, float y, float z, float w, float u) -
getHoneyFractal
public float getHoneyFractal(float x, float y, float z, float w, float u, float v) -
singleHoneyFractalFBM
protected float singleHoneyFractalFBM(float x, float y, float z, float w, float u, float v) -
singleHoneyFractalDomainWarp
protected float singleHoneyFractalDomainWarp(float x, float y, float z, float w, float u, float v) -
singleHoneyFractalBillow
protected float singleHoneyFractalBillow(float x, float y, float z, float w, float u, float v) -
singleHoneyFractalRidgedMulti
protected float singleHoneyFractalRidgedMulti(float x, float y, float z, float w, float u, float v) -
getHoney
public float getHoney(float x, float y, float z, float w, float u, float v) -
singleHoney
public float singleHoney(int seed, float x, float y, float z, float w, float u, float v) -
gradientPerturb2
public void gradientPerturb2(float[] v2) -
gradientPerturbFractal2
public void gradientPerturbFractal2(float[] v2) -
gradientPerturb3
public void gradientPerturb3(float[] v3) -
gradientPerturbFractal3
public void gradientPerturbFractal3(float[] v3) -
equals
-
toString
-