Interface INoise
- All Known Implementing Classes:
NoiseSimplex
public interface INoise
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondoubleEvaluates the noise.default doubleGenerates 3D Fractional Brownian motion (fBm) from the implementing noise.default doublemap(double value, double min1, double max1, double min2, double max2) Maps a value from one range to another.default doublenormalize(double v) Normalises a value from [-1,1] to [0,1].default doublepermute(double x) Permutation function used by the Simplex noise implementation.default doublerand(double n) Single float random based on a seed.default double2‑D random based on a vec2.default Vec33‑D random based on a vec3.default Vec22‑D random hash.default Vec33‑D random hash (used by GLSL rand3).default Vec44‑D random hash (mirrors GLSL rand4).default doubletaylorInvSqrt(double r) Taylor inverse square root approximation used in GLSL.
-
Field Details
-
MAX_FBM_ITERATIONS
static final int MAX_FBM_ITERATIONS- See Also:
-
-
Method Details
-
evaluate
Evaluates the noise.- Parameters:
p- The point at which the noise must be evaluated.- Returns:
- The noise value.
-
fbm
Generates 3D Fractional Brownian motion (fBm) from the implementing noise. Mirrors the GLSL gln_sfbm function from assets/shader/lib/noise/simplex.glsl with the fbm.glsl include block.- Parameters:
v- Point to sample fBm at.opts- Options for fBm generation (seeFbmOpts).- Returns:
- Value of fBm at point "v".
-
permute
default double permute(double x) Permutation function used by the Simplex noise implementation. Equivalent to GLSL: mod(((x * 34.0) + 1.0) * x, 289.0) -
taylorInvSqrt
default double taylorInvSqrt(double r) Taylor inverse square root approximation used in GLSL. Equivalent to: 1.79284291400159 - 0.85373472095314 * r -
map
default double map(double value, double min1, double max1, double min2, double max2) Maps a value from one range to another. -
normalize
default double normalize(double v) Normalises a value from [-1,1] to [0,1]. -
rand2
-
rand3
-
rand4
-
rand
default double rand(double n) Single float random based on a seed. -
rand
2‑D random based on a vec2. -
rand
-