载入中...
搜索中...
未找到
eve::procgen::NoiseField结构体 参考

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].

参数
bandsNumber 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 行定义.

引用了 gain, ox, oy, perlinNoise(), x , 以及 y.

◆ 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()

float eve::procgen::NoiseField::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.

在文件 NoiseField.cpp 第 584 行定义.

引用了 fbm(), gain, x , 以及 y.

◆ 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 行定义.

引用了 gain, px, py, valueNoise(), x , 以及 y.

被这些函数引用 eve::procgen::CloudField::coverageAt().

◆ 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 行定义.

引用了 gain, ox, oy, simplexNoise(), x , 以及 y.

◆ gabor()

float eve::procgen::NoiseField::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].

参数
dirX/ dirY Preferred wave direction bias.
frequencyCarrier frequency (typical ~2π).

在文件 NoiseField.cpp 第 503 行定义.

引用了 cx, cy, dx, dy, hash01(), ox, oy, w, x , 以及 y.

被这些函数引用 gaborFbm().

◆ gaborFbm()

float eve::procgen::NoiseField::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).

在文件 NoiseField.cpp 第 534 行定义.

引用了 gabor(), n, px, py, x , 以及 y.

◆ gyroid()

float eve::procgen::NoiseField::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].

在文件 NoiseField.cpp 第 460 行定义.

引用了 p, seed, x, y , 以及 z.

◆ gyroidFbm()

float eve::procgen::NoiseField::gyroidFbm ( float  x,
float  y,
float  z,
int  octaves = 4 
) const

Absolute-gyroid fBm (noisecreater gyroid fbm), remapped to [0, 1].

在文件 NoiseField.cpp 第 466 行定义.

引用了 a, result, seed, x, y , 以及 z.

◆ 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

Distance to nearest hex edge (noisecreater hexDist field), typically [0, ~1]. Pointy-top lattice; scale inputs to control cell size.

在文件 NoiseField.cpp 第 438 行定义.

引用了 cx, cy, ox, oy, x , 以及 y.

被这些函数引用 hexEdge().

◆ 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 行定义.

引用了 d, hexDistance(), soft, t, width, x , 以及 y.

◆ hexValue()

float eve::procgen::NoiseField::hexValue ( float  x,
float  y 
) const

Hash of the nearest hex cell, in [0, 1].

在文件 NoiseField.cpp 第 446 行定义.

引用了 cx, cy, hash01(), x , 以及 y.

◆ 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.

参数
offsetSignal bias before weighting (typical ~0.7). Result in [0, 1].

在文件 NoiseField.cpp 第 387 行定义.

引用了 gain, offset, result, valueNoise(), weight, x , 以及 y.

◆ 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).

参数
levelsContour count across [0, 1].
widthHalf-width of each line in normalized level space.

在文件 NoiseField.cpp 第 566 行定义.

引用了 n, t, v, valueNoise(), width, x , 以及 y.

◆ jordan()

float eve::procgen::NoiseField::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].

在文件 NoiseField.cpp 第 482 行定义.

引用了 dx, dy, gain, n, px, py, valueNoise(), x , 以及 y.

◆ 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.

被这些函数引用 eve::procgen::CloudField::coverageAt().

◆ 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 行定义.

引用了 gain, n, ox, oy, perlinNoise(), x , 以及 y.

被这些函数引用 eve::procgen::TerrainSampler::sample().

◆ simplexNoise()

float eve::procgen::NoiseField::simplexNoise ( float  x,
float  y 
) const

2D Simplex noise remapped to [0, 1]. Same family as noisecreater SampleNoiseA (Ashima-style corners + radial falloff).

在文件 NoiseField.cpp 第 162 行定义.

引用了 h, hash01(), i1, px, py, s, t, x , 以及 y.

被这些函数引用 fbmSimplex().

◆ 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 行定义.

引用了 gain, n, px, py, valueNoise(), x , 以及 y.

◆ 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 行定义.

引用了 hash01(), x , 以及 y.

被这些函数引用 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

Gradient magnitude of value noise.

在文件 NoiseField.cpp 第 560 行定义.

引用了 dx, dy, valueDx(), valueDy(), x , 以及 y.

◆ warp()

float eve::procgen::NoiseField::warp ( float  x,
float  y,
float  amp,
int  octaves = 3 
) const

Single-pass domain warp of value fBm.

在文件 NoiseField.cpp 第 412 行定义.

引用了 fbm(), wx, wy, x , 以及 y.

◆ warpDeep()

float eve::procgen::NoiseField::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.

在文件 NoiseField.cpp 第 418 行定义.

引用了 fbm(), qx, qy, x , 以及 y.

◆ whiteNoise()

float eve::procgen::NoiseField::whiteNoise ( int  ix,
int  iy 
) const

White noise at integer lattice point (alias of hash01).

在文件 NoiseField.cpp 第 121 行定义.

引用了 hash01().

◆ worleyCombine()

float eve::procgen::NoiseField::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).

在文件 NoiseField.cpp 第 229 行定义.

引用了 x , 以及 y.

◆ worleyEdge()

float eve::procgen::NoiseField::worleyEdge ( float  x,
float  y,
float  jitter = 1.f,
WorleyMetric  metric = WorleyMetric::Euclidean 
) const

Worley F2 - F1 edge distance (cell borders).

在文件 NoiseField.cpp 第 223 行定义.

引用了 x , 以及 y.

◆ 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).

参数
jitterFeature-point jitter in [0, 1]; 1 = full cell, 0 = cell centers.
metricEuclidean (default), Manhattan, or Chebyshev.

在文件 NoiseField.cpp 第 207 行定义.

引用了 x , 以及 y.

被这些函数引用 worleyNoise().

◆ worleyF2()

float eve::procgen::NoiseField::worleyF2 ( float  x,
float  y,
float  jitter = 1.f,
WorleyMetric  metric = WorleyMetric::Euclidean 
) const

Worley F2 (second-nearest) distance.

在文件 NoiseField.cpp 第 213 行定义.

引用了 x , 以及 y.

◆ 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()

float eve::procgen::NoiseField::worleySmooth ( float  x,
float  y,
float  smoothness = 0.25f,
float  jitter = 1.f 
) const

Smooth-min Worley (metaball / soft cellular).

参数
smoothnessBlend width; larger → softer lobes. Result in [0, 1].

在文件 NoiseField.cpp 第 235 行定义.

引用了 cx, cy, dx, dy, hash01(), px, py, x , 以及 y.

类成员变量说明

◆ periodX

int eve::procgen::NoiseField::periodX = 0

◆ periodY

int eve::procgen::NoiseField::periodY = 0

◆ seed


该结构体的文档由以下文件生成: