@Beta public class VastNoise extends FastNoise
FastNoise
by using a large buffer of random bytes, and choosing a byte
from the buffer purely by the current seed and position (a simpler calculation than a hash). This currently gives a
modest speed boost to FastNoise.SIMPLEX
, FastNoise.PERLIN
, FastNoise.CUBIC
, and FastNoise.HONEY
, a smaller speed boost to
FastNoise.FOAM
, and no change for FastNoise.VALUE
or FastNoise.WHITE_NOISE
. This class only uses the least-significant
20 bits of any seed in most cases; using unique non-negative seeds that are all less than 1000000 is one way to
ensure these bits are different. It should be interchangeable with FastNoise, but be aware that the first time this
class is imported, it will generate about a million random bytes using TangleRNG
. Generating a million bytes
really doesn't take more time than the blink of an eye, but it does use 1MB of RAM for the class (not allocated per
object, at least).
FastNoise.Float2, FastNoise.Float3
BILLOW, CELL_VALUE, CELLULAR, cellularDistanceFunction, cellularReturnType, CUBIC, CUBIC_FRACTAL, DISTANCE, DISTANCE_2, DISTANCE_2_ADD, DISTANCE_2_DIV, DISTANCE_2_MUL, DISTANCE_2_SUB, EUCLIDEAN, F2f, F3f, F4f, FBM, FOAM, FOAM_FRACTAL, fractalSpiral, fractalType, frequency, G2f, G3f, G4f, gain, grad2f, grad4f, grad5f, grad6f, gradientPerturbAmp, H2f, HERMITE, HONEY, HONEY_FRACTAL, instance, interpolation, lacunarity, LIMIT4, LINEAR, MANHATTAN, MUTANT, MUTANT_FRACTAL, mutation, NATURAL, NOISE_LOOKUP, noiseType, octaves, PERLIN, PERLIN_FRACTAL, pointHash, QUINTIC, RIDGED_MULTI, seed, sharpness, SIMPLEX, SIMPLEX_FRACTAL, VALUE, VALUE_FRACTAL, WHITE_NOISE
Constructor and Description |
---|
VastNoise()
A constructor that takes no parameters, and uses all default settings with a seed of 1337.
|
VastNoise(FastNoise other)
Copy constructor; copies all non-temporary fields from
other into this. |
VastNoise(int seed)
A constructor that takes only a parameter for the VastNoise's seed, which should produce different results for
any different seeds.
|
VastNoise(int seed,
float frequency)
A constructor that takes two parameters to specify the VastNoise from the start.
|
VastNoise(int seed,
float frequency,
int noiseType)
A constructor that takes a few parameters to specify the VastNoise from the start.
|
VastNoise(int seed,
float frequency,
int noiseType,
int octaves)
A constructor that takes several parameters to specify the VastNoise from the start.
|
VastNoise(int seed,
float frequency,
int noiseType,
int octaves,
float lacunarity,
float gain)
A constructor that takes a lot of parameters to specify the VastNoise from the start.
|
Modifier and Type | Method and Description |
---|---|
protected int |
hash256(int x,
int y,
int s) |
protected int |
hash256(int x,
int y,
int z,
int s) |
protected int |
hash256(int x,
int y,
int z,
int w,
int s) |
protected int |
hash256(int x,
int y,
int z,
int w,
int u,
int s) |
protected int |
hash256(int x,
int y,
int z,
int w,
int u,
int v,
int s) |
protected int |
hash32(int x,
int y,
int z,
int s) |
protected float |
valueNoise(int seed,
float x,
float y)
Produces noise from 0 to 1, instead of the normal -1 to 1.
|
protected float |
valueNoise(int seed,
float x,
float y,
float z)
Produces noise from 0 to 1, instead of the normal -1 to 1.
|
protected float |
valueNoise(int seed,
float x,
float y,
float z,
float w) |
protected float |
valueNoise(int seed,
float x,
float y,
float z,
float w,
float u) |
protected float |
valueNoise(int seed,
float x,
float y,
float z,
float w,
float u,
float v) |
cubicLerp, dotf, getCellular, getCellular, getCellularDistanceFunction, getCellularReturnType, getConfiguredNoise, getConfiguredNoise, getConfiguredNoise, getConfiguredNoise, getConfiguredNoise, getCubic, getCubic, getCubic, getCubicFractal, getCubicFractal, getCubicFractal, getFoam, getFoam, getFoam, getFoam, getFoam, getFoamFractal, getFoamFractal, getFoamFractal, getFoamFractal, getFoamSharpness, getFractalGain, getFractalLacunarity, getFractalOctaves, getFractalType, getFrequency, getGradientPerturbAmp, getHoney, getHoney, getHoney, getHoney, getHoney, getHoneyFractal, getHoneyFractal, getHoneyFractal, getHoneyFractal, getInterpolation, getMutation, getNoise, getNoise, getNoise, getNoise, getNoise, getNoiseType, getNoiseWithSeed, getNoiseWithSeed, getNoiseWithSeed, getNoiseWithSeed, getNoiseWithSeed, getNoiseWithSeed, getNoiseWithSeed, getNoiseWithSeed, getNoiseWithSeed, getNoiseWithSeed, getPerlin, getPerlin, getPerlin, getPerlin, getPerlin, getPerlinFractal, getPerlinFractal, getPointHash, getSeed, getSharpness, getSimplex, getSimplex, getSimplex, getSimplex, getSimplex, getSimplexFractal, getSimplexFractal, getSimplexFractal, getSimplexFractal, getSimplexFractal, getValue, getValue, getValue, getValue, getValue, getValueFractal, getValueFractal, getValueFractal, getValueFractal, getValueFractal, getWhiteNoise, getWhiteNoise, getWhiteNoise, getWhiteNoise, getWhiteNoise, gradCoord2D, gradCoord3D, gradCoord4D, gradCoord5D, gradCoord6D, gradientPerturb2, gradientPerturb3, gradientPerturbFractal2, gradientPerturbFractal3, hermiteInterpolator, isFractalSpiral, layered2D, layered2D, layered2D, layered2D, layered3D, layered3D, layered3D, layered3D, quinticInterpolator, ridged2D, ridged2D, ridged2D, ridged3D, ridged3D, ridged3D, rotateM7D, rotateU5D, rotateU6D, rotateU7D, rotateV6D, rotateV7D, rotateW4D, rotateW5D, rotateW6D, rotateW7D, rotateX2D, rotateX3D, rotateX4D, rotateX5D, rotateX6D, rotateX7D, rotateY2D, rotateY3D, rotateY4D, rotateY5D, rotateY6D, rotateY7D, rotateZ3D, rotateZ4D, rotateZ5D, rotateZ6D, rotateZ7D, setCellularDistanceFunction, setCellularNoiseLookup, setCellularReturnType, setFoamSharpness, setFractalGain, setFractalLacunarity, setFractalOctaves, setFractalSpiral, setFractalType, setFrequency, setGradientPerturbAmp, setInterpolation, setMutation, setNoiseType, setPointHash, setSeed, setSharpness, singleFoam, singleFoam, singleFoam, singleFoam, singleFoam, singleFoam, singleHoney, singleHoney, singleHoney, singleHoney, singleHoney, singleSimplex, singleSimplex, singleSimplex, singleSimplex, singleSimplex, singleValue, singleValue, singleValue, singleValue, singleValue, singleValue, valueNoise
public VastNoise()
new VastNoise()
, 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 call FastNoise.setFractalOctaves(int)
later to benefit from the
fractal noiseType), and normal lacunarity and gain (when unspecified, they are 2f and 0.5f).public VastNoise(int seed)
new VastNoise(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 call
FastNoise.setFractalOctaves(int)
later to benefit from the fractal noiseType), and normal lacunarity and gain
(when unspecified, they are 2f and 0.5f).seed
- the int seed for the noise, which should significantly affect the produced noisepublic VastNoise(int seed, float frequency)
new VastNoise(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 call FastNoise.setFractalOctaves(int)
later to benefit from the
fractal noiseType), and normal lacunarity and gain (when unspecified, they are 2f and 0.5f).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)public VastNoise(int seed, float frequency, int noiseType)
new VastNoise(1337, 0.02f, VastNoise.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 call
FastNoise.setFractalOctaves(int)
later), and normal lacunarity and gain (when unspecified, they are 2f and 0.5f).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 (see FastNoise.setNoiseType(int)
)public VastNoise(int seed, float frequency, int noiseType, int octaves)
new VastNoise(1337, 0.02f, VastNoise.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).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 (see FastNoise.setNoiseType(int)
)octaves
- how many octaves of noise to use when the noiseType is one of the _FRACTAL typespublic VastNoise(int seed, float frequency, int noiseType, int octaves, float lacunarity, float gain)
new VastNoise(1337, 0.02f, VastNoise.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).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 (see FastNoise.setNoiseType(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)public VastNoise(FastNoise other)
other
into this. This uses the same reference to
an IPointHash
set with FastNoise.setPointHash(IPointHash)
and to another VastNoise set with
FastNoise.setCellularNoiseLookup(FastNoise)
, but otherwise everything it copies is a primitive.other
- another FastNoise or VastNoise, which must not be nullprotected int hash256(int x, int y, int z, int w, int s)
protected int hash256(int x, int y, int z, int w, int u, int s)
protected int hash256(int x, int y, int z, int w, int u, int v, int s)
protected float valueNoise(int seed, float x, float y)
FastNoise
valueNoise
in class FastNoise
protected float valueNoise(int seed, float x, float y, float z)
FastNoise
valueNoise
in class FastNoise
protected float valueNoise(int seed, float x, float y, float z, float w)
valueNoise
in class FastNoise
protected float valueNoise(int seed, float x, float y, float z, float w, float u)
valueNoise
in class FastNoise
protected float valueNoise(int seed, float x, float y, float z, float w, float u, float v)
valueNoise
in class FastNoise
Copyright © Eben Howard 2012–2022. All rights reserved.