Deterministic 2D noise helpers for pixel textures and masks. 更多...
#include <NoiseField.h>
Public 成员函数 | |
| float | hash01 (int ix, int iy) const |
| Lattice hash mapped to [0, 1]. | |
| float | whiteNoise (int ix, int iy) const |
| White noise at integer lattice point (alias of hash01). | |
| float | valueNoise (float x, float y) const |
| Smooth value noise. | |
| float | perlinNoise (float x, float y) const |
| Classic 2D Perlin gradient noise, remapped to [0, 1]. | |
| float | simplexNoise (float x, float y) const |
| 2D Simplex noise remapped to [0, 1]. Same family as noisecreater SampleNoiseA (Ashima-style corners + radial falloff). | |
| float | worleyF1 (float x, float y, float jitter=1.f, WorleyMetric metric=WorleyMetric::Euclidean) const |
| Worley / cellular F1 distance (cell size 1). | |
| float | worleyF2 (float x, float y, float jitter=1.f, WorleyMetric metric=WorleyMetric::Euclidean) const |
| Worley F2 (second-nearest) distance. | |
| float | worleyNoise (float x, float y, float jitter=1.f, WorleyMetric metric=WorleyMetric::Euclidean) const |
Texture-friendly Worley: clamp(1 - F1, 0, 1). Matches NoiseCreator's 1 - minDist cellular look. | |
| float | worleyEdge (float x, float y, float jitter=1.f, WorleyMetric metric=WorleyMetric::Euclidean) const |
| Worley F2 - F1 edge distance (cell borders). | |
| float | worleyCombine (float x, float y, float jitter=1.f, WorleyMetric metric=WorleyMetric::Euclidean) const |
| (F1 + F2) * 0.5 remapped via clamp(1 - d, 0, 1). | |
| float | worleySmooth (float x, float y, float smoothness=0.25f, float jitter=1.f) const |
| Smooth-min Worley (metaball / soft cellular). | |
| float | fbm (float x, float y, int octaves=4, float lacunarity=2.f, float gain=0.5f) const |
| Value-noise fBm. | |
| float | fbmPerlin (float x, float y, int octaves=4, float lacunarity=2.f, float gain=0.5f) const |
| Perlin fBm with uncorrelated octave offsets. | |
| float | fbmSimplex (float x, float y, int octaves=4, float lacunarity=2.f, float gain=0.5f) const |
| Simplex fBm with uncorrelated octave offsets. | |
| float | fbmRotated (float x, float y, int octaves=4, float lacunarity=2.f, float gain=0.5f) const |
| Rotated value-noise fBm (axial-bias reduction). Each octave applies a fixed 2D rotation like noisecreater smoke / domain-warp fBm. | |
| float | ridged (float x, float y, int octaves=4, float lacunarity=2.f, float gain=0.5f) const |
| Ridged multifractal on value noise. | |
| float | ridgedPerlin (float x, float y, int octaves=4, float lacunarity=2.f, float gain=0.5f) const |
| Ridged multifractal on Perlin. | |
| float | billow (float x, float y, int octaves=4, float lacunarity=2.f, float gain=0.5f) const |
Billow / turbulence (absolute value-noise fBm), remapped to [0, 1]. Matches noisecreater SampleNoiseB noise_sum_abs shape. | |
| float | billowPerlin (float x, float y, int octaves=4, float lacunarity=2.f, float gain=0.5f) const |
| Billow built from Perlin octaves. | |
| float | swiss (float x, float y, int octaves=4, float lacunarity=2.f, float gain=0.5f, float warpStrength=0.15f) const |
| Musgrave Swiss turbulence: each octave warps by the running sum. Good for eroded / alpine terrain. Result remapped to [0, 1]. | |
| float | hybrid (float x, float y, int octaves=4, float lacunarity=2.f, float gain=0.5f, float offset=0.7f) const |
| Musgrave hybrid multifractal. | |
| float | jordan (float x, float y, int octaves=4, float lacunarity=2.f, float gain=0.5f, float warpStrength=0.35f) const |
| Musgrave Jordan turbulence: warp by value-noise derivatives. Completes the Swiss / Hybrid / Jordan Musgrave trio. Result in [0, 1]. | |
| float | gabor (float x, float y, float dirX=0.f, float dirY=0.f, float frequency=6.2831853f) const |
| Gabor / Voronoi-mix wavelet (noisecreater gavoronoi 3×3), remapped to [0, 1]. | |
| float | gaborFbm (float x, float y, int octaves=4, float dirX=0.f, float dirY=0.f) const |
| Absolute-Gabor fBm remapped to [0, 1] (noisecreater Gabor swirl layers). | |
| float | perlinWorley (float x, float y, int octaves=3, float jitter=1.f) const |
| Perlin–Worley hybrid for cloud / soft cellular shapes. Result is worleyNoise * fbmPerlin (NoiseCreator Cloud / Perlin-Worley). | |
| float | valueDx (float x, float y, float eps=1e-3f) const |
∂/∂x of value noise via central differences (slope / erosion helper). Not remapped to [0, 1]; magnitude depends on eps. | |
| float | valueDy (float x, float y, float eps=1e-3f) const |
| ∂/∂y of value noise via central differences. | |
| float | valueSlope (float x, float y, float eps=1e-3f) const |
| Gradient magnitude of value noise. | |
| float | isoLine (float x, float y, int levels=8, float width=0.04f) const |
| Contour / isoline mask of value noise in [0, 1] (1 on lines). | |
| float | banding (float x, float y, int bands=5) const |
| Quantized banding of value noise in [0, 1]. | |
| float | fbmColor (float x, float y, int channel, int octaves=4, float lacunarity=2.f, float gain=0.5f) const |
| Decorrelated fBm channel for RGB-style color noise (channel 0/1/2). Same shape as fbm with fixed per-channel lattice offsets. | |
| float | warp (float x, float y, float amp, int octaves=3) const |
| Single-pass domain warp of value fBm. | |
| float | warpDeep (float x, float y, float amp, int octaves=3) const |
| Two-pass iq-style domain warp (q then r), then sample fBm. Matches noisecreater DomainWarp / Smoke nested fBm pattern. | |
| float | curlNoiseX (float x, float y, float eps=1e-3f) const |
| Divergence-free curl X of value-noise potential (finite differences). Pair with curlNoiseY for particle / fluid advection. | |
| float | curlNoiseY (float x, float y, float eps=1e-3f) const |
| Divergence-free curl Y of value-noise potential (finite differences). | |
| float | hexDistance (float x, float y) const |
| Distance to nearest hex edge (noisecreater hexDist field), typically [0, ~1]. Pointy-top lattice; scale inputs to control cell size. | |
| float | hexValue (float x, float y) const |
| Hash of the nearest hex cell, in [0, 1]. | |
| float | hexEdge (float x, float y, float width=0.05f, float soft=0.02f) const |
| Hex edge line mask in [0, 1] (1 on edge). Matches noisecreater hexNoise edge band. | |
| float | gyroid (float x, float y, float z) const |
| Minimal gyroid field at (x, y, z): dot(sin(p), cos(p.yzx)), remapped to [0, 1]. | |
| float | gyroidFbm (float x, float y, float z, int octaves=4) const |
| Absolute-gyroid fBm (noisecreater gyroid fbm), remapped to [0, 1]. | |
Public 属性 | |
| uint32_t | seed = 1 |
| int | periodX = 0 |
| int | periodY = 0 |
详细描述
Deterministic 2D noise helpers for pixel textures and masks.
Covers the common NoiseCreator / noisecreater.com / Musgrave set: white, value, Perlin, Simplex, Worley (F1/F2/edge/smooth + metrics), fBm / ridged / billow / swiss / hybrid / jordan, Gabor, Perlin–Worley, hex, gyroid, curl, value derivatives / isoline / banding, color-channel fBm, and single- or multi-pass domain warp.
When periodX/periodY > 0, lattice indices wrap for seamless tiling. Continuous samplers return values in [0, 1] unless noted.
在文件 NoiseField.h 第 24 行定义.
成员函数说明
◆ banding()
| float eve::procgen::NoiseField::banding | ( | float | x, |
| float | y, | ||
| int | bands = 5 |
||
| ) | const |
Quantized banding of value noise in [0, 1].
- 参数
-
bands Number of discrete steps (≥ 1).
在文件 NoiseField.cpp 第 577 行定义.
引用了 n, step, valueNoise(), x , 以及 y.
◆ billow()
| float eve::procgen::NoiseField::billow | ( | float | x, |
| float | y, | ||
| int | octaves = 4, |
||
| float | lacunarity = 2.f, |
||
| float | gain = 0.5f |
||
| ) | const |
Billow / turbulence (absolute value-noise fBm), remapped to [0, 1]. Matches noisecreater SampleNoiseB noise_sum_abs shape.
在文件 NoiseField.cpp 第 344 行定义.
引用了 gain, valueNoise(), x , 以及 y.
◆ billowPerlin()
| float eve::procgen::NoiseField::billowPerlin | ( | float | x, |
| float | y, | ||
| int | octaves = 4, |
||
| float | lacunarity = 2.f, |
||
| float | gain = 0.5f |
||
| ) | const |
Billow built from Perlin octaves.
在文件 NoiseField.cpp 第 356 行定义.
◆ curlNoiseX()
| float eve::procgen::NoiseField::curlNoiseX | ( | float | x, |
| float | y, | ||
| float | eps = 1e-3f |
||
| ) | const |
Divergence-free curl X of value-noise potential (finite differences). Pair with curlNoiseY for particle / fluid advection.
在文件 NoiseField.cpp 第 426 行定义.
引用了 valueNoise(), x , 以及 y.
◆ curlNoiseY()
| float eve::procgen::NoiseField::curlNoiseY | ( | float | x, |
| float | y, | ||
| float | eps = 1e-3f |
||
| ) | const |
Divergence-free curl Y of value-noise potential (finite differences).
在文件 NoiseField.cpp 第 432 行定义.
引用了 valueNoise(), x , 以及 y.
◆ fbm()
| float eve::procgen::NoiseField::fbm | ( | float | x, |
| float | y, | ||
| int | octaves = 4, |
||
| float | lacunarity = 2.f, |
||
| float | gain = 0.5f |
||
| ) | const |
Value-noise fBm.
在文件 NoiseField.cpp 第 257 行定义.
引用了 gain, valueNoise(), x , 以及 y.
被这些函数引用 eve::procgen::CloudField::coverageAt(), fbmColor(), warp() , 以及 warpDeep().
◆ fbmColor()
◆ fbmPerlin()
| float eve::procgen::NoiseField::fbmPerlin | ( | float | x, |
| float | y, | ||
| int | octaves = 4, |
||
| float | lacunarity = 2.f, |
||
| float | gain = 0.5f |
||
| ) | const |
Perlin fBm with uncorrelated octave offsets.
在文件 NoiseField.cpp 第 269 行定义.
引用了 gain, ox, oy, perlinNoise(), x , 以及 y.
被这些函数引用 perlinWorley() , 以及 eve::procgen::TerrainSampler::sample().
◆ fbmRotated()
| float eve::procgen::NoiseField::fbmRotated | ( | float | x, |
| float | y, | ||
| int | octaves = 4, |
||
| float | lacunarity = 2.f, |
||
| float | gain = 0.5f |
||
| ) | const |
Rotated value-noise fBm (axial-bias reduction). Each octave applies a fixed 2D rotation like noisecreater smoke / domain-warp fBm.
在文件 NoiseField.cpp 第 297 行定义.
◆ fbmSimplex()
| float eve::procgen::NoiseField::fbmSimplex | ( | float | x, |
| float | y, | ||
| int | octaves = 4, |
||
| float | lacunarity = 2.f, |
||
| float | gain = 0.5f |
||
| ) | const |
Simplex fBm with uncorrelated octave offsets.
在文件 NoiseField.cpp 第 283 行定义.
◆ gabor()
◆ gaborFbm()
◆ gyroid()
| float eve::procgen::NoiseField::gyroid | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) | const |
◆ gyroidFbm()
| float eve::procgen::NoiseField::gyroidFbm | ( | float | x, |
| float | y, | ||
| float | z, | ||
| int | octaves = 4 |
||
| ) | const |
◆ hash01()
| float eve::procgen::NoiseField::hash01 | ( | int | ix, |
| int | iy | ||
| ) | const |
Lattice hash mapped to [0, 1].
在文件 NoiseField.cpp 第 110 行定义.
引用了 h, periodX, periodY , 以及 seed.
被这些函数引用 gabor(), hexValue(), perlinNoise(), eve::procgen::detail::sampleEveryday(), simplexNoise(), valueNoise(), whiteNoise() , 以及 worleySmooth().
◆ hexDistance()
| float eve::procgen::NoiseField::hexDistance | ( | float | x, |
| float | y | ||
| ) | const |
◆ hexEdge()
| float eve::procgen::NoiseField::hexEdge | ( | float | x, |
| float | y, | ||
| float | width = 0.05f, |
||
| float | soft = 0.02f |
||
| ) | const |
Hex edge line mask in [0, 1] (1 on edge). Matches noisecreater hexNoise edge band.
在文件 NoiseField.cpp 第 452 行定义.
◆ hexValue()
| float eve::procgen::NoiseField::hexValue | ( | float | x, |
| float | y | ||
| ) | const |
◆ hybrid()
| float eve::procgen::NoiseField::hybrid | ( | float | x, |
| float | y, | ||
| int | octaves = 4, |
||
| float | lacunarity = 2.f, |
||
| float | gain = 0.5f, |
||
| float | offset = 0.7f |
||
| ) | const |
Musgrave hybrid multifractal.
- 参数
-
offset Signal bias before weighting (typical ~0.7). Result in [0, 1].
在文件 NoiseField.cpp 第 387 行定义.
◆ isoLine()
| float eve::procgen::NoiseField::isoLine | ( | float | x, |
| float | y, | ||
| int | levels = 8, |
||
| float | width = 0.04f |
||
| ) | const |
Contour / isoline mask of value noise in [0, 1] (1 on lines).
- 参数
-
levels Contour count across [0, 1]. width Half-width of each line in normalized level space.
在文件 NoiseField.cpp 第 566 行定义.
◆ jordan()
◆ perlinNoise()
| float eve::procgen::NoiseField::perlinNoise | ( | float | x, |
| float | y | ||
| ) | const |
Classic 2D Perlin gradient noise, remapped to [0, 1].
在文件 NoiseField.cpp 第 137 行定义.
引用了 dx, dy, h, hash01(), n, px, py, x , 以及 y.
被这些函数引用 billowPerlin(), fbmPerlin(), ridgedPerlin() , 以及 eve::procgen::TerrainSampler::sample().
◆ perlinWorley()
| float eve::procgen::NoiseField::perlinWorley | ( | float | x, |
| float | y, | ||
| int | octaves = 3, |
||
| float | jitter = 1.f |
||
| ) | const |
Perlin–Worley hybrid for cloud / soft cellular shapes. Result is worleyNoise * fbmPerlin (NoiseCreator Cloud / Perlin-Worley).
在文件 NoiseField.cpp 第 406 行定义.
引用了 fbmPerlin(), p, w, worleyNoise(), x , 以及 y.
◆ ridged()
| float eve::procgen::NoiseField::ridged | ( | float | x, |
| float | y, | ||
| int | octaves = 4, |
||
| float | lacunarity = 2.f, |
||
| float | gain = 0.5f |
||
| ) | const |
Ridged multifractal on value noise.
在文件 NoiseField.cpp 第 314 行定义.
引用了 gain, n, valueNoise(), x , 以及 y.
◆ ridgedPerlin()
| float eve::procgen::NoiseField::ridgedPerlin | ( | float | x, |
| float | y, | ||
| int | octaves = 4, |
||
| float | lacunarity = 2.f, |
||
| float | gain = 0.5f |
||
| ) | const |
Ridged multifractal on Perlin.
在文件 NoiseField.cpp 第 328 行定义.
◆ simplexNoise()
| float eve::procgen::NoiseField::simplexNoise | ( | float | x, |
| float | y | ||
| ) | const |
◆ swiss()
| float eve::procgen::NoiseField::swiss | ( | float | x, |
| float | y, | ||
| int | octaves = 4, |
||
| float | lacunarity = 2.f, |
||
| float | gain = 0.5f, |
||
| float | warpStrength = 0.15f |
||
| ) | const |
Musgrave Swiss turbulence: each octave warps by the running sum. Good for eroded / alpine terrain. Result remapped to [0, 1].
在文件 NoiseField.cpp 第 370 行定义.
◆ valueDx()
| float eve::procgen::NoiseField::valueDx | ( | float | x, |
| float | y, | ||
| float | eps = 1e-3f |
||
| ) | const |
∂/∂x of value noise via central differences (slope / erosion helper). Not remapped to [0, 1]; magnitude depends on eps.
在文件 NoiseField.cpp 第 550 行定义.
引用了 valueNoise(), x , 以及 y.
被这些函数引用 valueSlope().
◆ valueDy()
| float eve::procgen::NoiseField::valueDy | ( | float | x, |
| float | y, | ||
| float | eps = 1e-3f |
||
| ) | const |
∂/∂y of value noise via central differences.
在文件 NoiseField.cpp 第 555 行定义.
引用了 valueNoise(), x , 以及 y.
被这些函数引用 valueSlope().
◆ valueNoise()
| float eve::procgen::NoiseField::valueNoise | ( | float | x, |
| float | y | ||
| ) | const |
Smooth value noise.
在文件 NoiseField.cpp 第 123 行定义.
被这些函数引用 banding(), billow(), curlNoiseX(), curlNoiseY(), fbm(), fbmRotated(), hybrid(), isoLine(), jordan(), ridged(), eve::procgen::detail::sampleEveryday(), swiss(), valueDx() , 以及 valueDy().
◆ valueSlope()
| float eve::procgen::NoiseField::valueSlope | ( | float | x, |
| float | y, | ||
| float | eps = 1e-3f |
||
| ) | const |
◆ warp()
| float eve::procgen::NoiseField::warp | ( | float | x, |
| float | y, | ||
| float | amp, | ||
| int | octaves = 3 |
||
| ) | const |
◆ warpDeep()
| float eve::procgen::NoiseField::warpDeep | ( | float | x, |
| float | y, | ||
| float | amp, | ||
| int | octaves = 3 |
||
| ) | const |
◆ whiteNoise()
| float eve::procgen::NoiseField::whiteNoise | ( | int | ix, |
| int | iy | ||
| ) | const |
◆ worleyCombine()
| float eve::procgen::NoiseField::worleyCombine | ( | float | x, |
| float | y, | ||
| float | jitter = 1.f, |
||
| WorleyMetric | metric = WorleyMetric::Euclidean |
||
| ) | const |
◆ worleyEdge()
| float eve::procgen::NoiseField::worleyEdge | ( | float | x, |
| float | y, | ||
| float | jitter = 1.f, |
||
| WorleyMetric | metric = WorleyMetric::Euclidean |
||
| ) | const |
◆ worleyF1()
| float eve::procgen::NoiseField::worleyF1 | ( | float | x, |
| float | y, | ||
| float | jitter = 1.f, |
||
| WorleyMetric | metric = WorleyMetric::Euclidean |
||
| ) | const |
Worley / cellular F1 distance (cell size 1).
- 参数
-
jitter Feature-point jitter in [0, 1]; 1 = full cell, 0 = cell centers. metric Euclidean (default), Manhattan, or Chebyshev.
在文件 NoiseField.cpp 第 207 行定义.
被这些函数引用 worleyNoise().
◆ worleyF2()
| float eve::procgen::NoiseField::worleyF2 | ( | float | x, |
| float | y, | ||
| float | jitter = 1.f, |
||
| WorleyMetric | metric = WorleyMetric::Euclidean |
||
| ) | const |
◆ worleyNoise()
| float eve::procgen::NoiseField::worleyNoise | ( | float | x, |
| float | y, | ||
| float | jitter = 1.f, |
||
| WorleyMetric | metric = WorleyMetric::Euclidean |
||
| ) | const |
Texture-friendly Worley: clamp(1 - F1, 0, 1). Matches NoiseCreator's 1 - minDist cellular look.
在文件 NoiseField.cpp 第 219 行定义.
引用了 worleyF1(), x , 以及 y.
被这些函数引用 perlinWorley().
◆ worleySmooth()
类成员变量说明
◆ periodX
| int eve::procgen::NoiseField::periodX = 0 |
在文件 NoiseField.h 第 26 行定义.
被这些函数引用 eve::procgen::CloudField::coverageAt(), hash01() , 以及 eve::procgen::detail::sampleEveryday().
◆ periodY
| int eve::procgen::NoiseField::periodY = 0 |
在文件 NoiseField.h 第 27 行定义.
被这些函数引用 eve::procgen::CloudField::coverageAt(), hash01() , 以及 eve::procgen::detail::sampleEveryday().
◆ seed
| uint32_t eve::procgen::NoiseField::seed = 1 |
该结构体的文档由以下文件生成:
- src/modules/procgen/texture/NoiseField.h
- src/modules/procgen/texture/NoiseField.cpp