FIntNoise
- Module
- Math
- Header
#include "Math/IntNoise.h"- Namespace
Mowo
Properties
| Type | Name | Description |
|---|---|---|
static constexpr int32_t | kOne | Default 65536. |
Public functions
| Returns | Name | Description |
|---|---|---|
int32_t | FromInt | |
int32_t | FromFloat | |
float | ToFloat | |
uint64_t | Mix64 | splitmix64 finaliser: the 64-bit mix every lattice hash is built from. |
uint64_t | Hash | |
int32_t | HashToSigned | Uniform value in [-1, 1) as Q16.16. |
int32_t | Fade | Smoothstep-5 (6t^5 - 15t^4 + 10t^3) on a Q16.16 fraction in [0, 1]. |
int32_t | Lerp | |
uint32_t | ISqrt64 | floor(sqrt(v)); the Q32.32 square of a Q16.16 distance gives the distance back in Q16.16. |
int32_t | Value2 | |
int32_t | Value3 | |
int32_t | Perlin2 | Gradient (Perlin) noise, 16 unit gradients; the result is scaled by sqrt(2) and clamped to [-1, 1]. |
int32_t | Perlin3 | Improved-Perlin 12-edge gradients; weights are 0 / +-1 so the dot products stay exact. |
int32_t | Fbm2 | fBm of Perlin2, normalised by the amplitude sum so the result stays in [-1, 1]. |
int32_t | Fbm3 | |
int32_t | Ridged2 | Ridged multifractal of Perlin2 in [0, 1]: sharp crests where the base noise crosses zero. |
FIntNoisePoint2 | Warp2 | Offsets (x, y) by two decorrelated Perlin2 fields; strength is the maximum offset in Q16.16 units. |
void | Worley2 | Cellular (Worley) noise: distances in Q16.16 cell units to the nearest (f1) and second nearest (f2) feature point, one jittered point per unit cell. |
Function details
FromInt
static constexpr int32_t FromInt(int32_t value)FromFloat
static constexpr int32_t FromFloat(float value)ToFloat
static constexpr float ToFloat(int32_t fixed)Mix64
static constexpr uint64_t Mix64(uint64_t z)splitmix64 finaliser: the 64-bit mix every lattice hash is built from.
Hash
static constexpr uint64_t Hash(uint64_t seed, int32_t x, int32_t y = 0, int32_t z = 0)HashToSigned
static constexpr int32_t HashToSigned(uint64_t h)Uniform value in [-1, 1) as Q16.16.
Fade
static constexpr int32_t Fade(int32_t t)Smoothstep-5 (6t^5 - 15t^4 + 10t^3) on a Q16.16 fraction in [0, 1].
Lerp
static constexpr int32_t Lerp(int32_t a, int32_t b, int32_t t)ISqrt64
static constexpr uint32_t ISqrt64(uint64_t v)floor(sqrt(v)); the Q32.32 square of a Q16.16 distance gives the distance back in Q16.16.
Value2
static constexpr int32_t Value2(uint64_t seed, int32_t x, int32_t y)Value3
static constexpr int32_t Value3(uint64_t seed, int32_t x, int32_t y, int32_t z)Perlin2
static constexpr int32_t Perlin2(uint64_t seed, int32_t x, int32_t y)Gradient (Perlin) noise, 16 unit gradients; the result is scaled by sqrt(2) and clamped to [-1, 1].
Perlin3
static constexpr int32_t Perlin3(uint64_t seed, int32_t x, int32_t y, int32_t z)Improved-Perlin 12-edge gradients; weights are 0 / +-1 so the dot products stay exact.
Fbm2
static constexpr int32_t Fbm2(uint64_t seed, int32_t x, int32_t y, int32_t octaves, int32_t gain = 32768)fBm of Perlin2, normalised by the amplitude sum so the result stays in [-1, 1]. gain is Q16.16 (32768 = 0.5), the frequency doubles each octave.
Fbm3
static constexpr int32_t Fbm3(uint64_t seed, int32_t x, int32_t y, int32_t z, int32_t octaves, int32_t gain = 32768)Ridged2
static constexpr int32_t Ridged2(uint64_t seed, int32_t x, int32_t y, int32_t octaves, int32_t gain = 32768)Ridged multifractal of Perlin2 in [0, 1]: sharp crests where the base noise crosses zero.
Warp2
static constexpr FIntNoisePoint2 Warp2(uint64_t seed, int32_t x, int32_t y, int32_t strength)Offsets (x, y) by two decorrelated Perlin2 fields; strength is the maximum offset in Q16.16 units.
Worley2
static constexpr void Worley2(uint64_t seed, int32_t x, int32_t y, int32_t& f1, int32_t& f2)Cellular (Worley) noise: distances in Q16.16 cell units to the nearest (f1) and second nearest (f2) feature point, one jittered point per unit cell.