public class JitterNoise extends java.lang.Object implements Noise.Noise2D, Noise.Noise3D, Noise.Noise4D, Noise.Noise6D
SeededNoise
), or with the non-jittered but similar ClassicNoise
.
This noise can in theory be scaled up to arbitrary dimensions, but in practice uses unreasonably hefty amounts of
memory when dimensionality exceeds 10 or so, since it needs to hash Math.pow(2, dimensionality)
points per
sample of noise, which involves over a thousand points in 10 dimensions and over a million points in 20 dimensions.
For that reason, it's limited to 6D noise here, and also implements 2D, 3D, and 4D. Its performance is similar to
SeededNoise
in 2D, and slows down further on 3D, 4D, and especially 6D. However, due to the grid jitter,
its quality is improved substantially over vanilla Simplex Noise, and it appears more detailed with one octave than
Simplex does. This uses different gradient vectors than what was recommended in the "Improved
Perlin Noise" paper, since the ones this uses avoid 45-degree angular artifacts in all dimensions implemented.
WorldMapGenerator
that needs a
Noise3D implementation, and it tends to about as fast as SeededNoise
in 3D with less artifacts. JitterNoise
is a fair amount slower than ClassicNoise, but it has much better quality in 2D and may have somewhat-better quality
in higher dimensions as well. There's probably no reason to prefer JitterNoise over ClassicNoise for 6D output,
because they're practically indistinguishable other than ClassicNoise being much faster.Modifier and Type | Field and Description |
---|---|
static JitterNoise |
instance |
long |
seed |
Constructor and Description |
---|
JitterNoise() |
JitterNoise(long seed) |
Modifier and Type | Method and Description |
---|---|
double |
getNoise(double x,
double y) |
double |
getNoise(double x,
double y,
double z) |
double |
getNoise(double x,
double y,
double z,
double w) |
double |
getNoise(double x,
double y,
double z,
double w,
double u,
double v) |
double |
getNoiseWithSeed(double x,
double y,
double z,
double w,
double u,
double v,
long seed) |
double |
getNoiseWithSeed(double x,
double y,
double z,
double w,
long seed) |
double |
getNoiseWithSeed(double x,
double y,
double z,
long seed) |
double |
getNoiseWithSeed(double x,
double y,
long seed) |
protected static double |
gradCoord2D(long seed,
int x,
int y,
double xd,
double yd) |
protected static double |
gradCoord3D(long seed,
int x,
int y,
int z,
double xd,
double yd,
double zd) |
protected static double |
gradCoord4D(long seed,
int x,
int y,
int z,
int w,
double xd,
double yd,
double zd,
double wd) |
protected static double |
gradCoord6D(long seed,
int x,
int y,
int z,
int w,
int u,
int v,
double xd,
double yd,
double zd,
double wd,
double ud,
double vd) |
public static final JitterNoise instance
public long seed
protected static double gradCoord2D(long seed, int x, int y, double xd, double yd)
protected static double gradCoord3D(long seed, int x, int y, int z, double xd, double yd, double zd)
protected static double gradCoord4D(long seed, int x, int y, int z, int w, double xd, double yd, double zd, double wd)
protected static double gradCoord6D(long seed, int x, int y, int z, int w, int u, int v, double xd, double yd, double zd, double wd, double ud, double vd)
public double getNoise(double x, double y)
getNoise
in interface Noise.Noise2D
public double getNoiseWithSeed(double x, double y, long seed)
getNoiseWithSeed
in interface Noise.Noise2D
public double getNoise(double x, double y, double z)
getNoise
in interface Noise.Noise3D
public double getNoiseWithSeed(double x, double y, double z, long seed)
getNoiseWithSeed
in interface Noise.Noise3D
public double getNoise(double x, double y, double z, double w)
getNoise
in interface Noise.Noise4D
public double getNoiseWithSeed(double x, double y, double z, double w, long seed)
getNoiseWithSeed
in interface Noise.Noise4D
public double getNoise(double x, double y, double z, double w, double u, double v)
getNoise
in interface Noise.Noise6D
public double getNoiseWithSeed(double x, double y, double z, double w, double u, double v, long seed)
getNoiseWithSeed
in interface Noise.Noise6D
Copyright © Eben Howard 2012–2022. All rights reserved.