载入中...
搜索中...
未找到
NoiseField.h
浏览该文件的文档.
1#pragma once
2
3#include <cstdint>
4
5namespace eve::procgen {
6
11struct NoiseField {
12 uint32_t seed = 1;
13 int periodX = 0; // 0 = non-tiling
14 int periodY = 0;
15
16 float hash01(int ix, int iy) const;
17 float valueNoise(float x, float y) const;
19 float perlinNoise(float x, float y) const;
20 float fbm(float x, float y, int octaves = 4, float lacunarity = 2.f, float gain = 0.5f) const;
21 float fbmPerlin(float x, float y, int octaves = 4, float lacunarity = 2.f, float gain = 0.5f) const;
22 float ridged(float x, float y, int octaves = 4, float lacunarity = 2.f, float gain = 0.5f) const;
23 float ridgedPerlin(float x, float y, int octaves = 4, float lacunarity = 2.f,
24 float gain = 0.5f) const;
25 float warp(float x, float y, float amp, int octaves = 3) const;
26};
27
28} // namespace eve::procgen
int y
Definition Grass.cpp:135
int x
Definition Grass.cpp:135
Deterministic value-noise helpers for pixel textures. When periodX/periodY > 0, lattice wraps for sea...
Definition NoiseField.h:11
float fbm(float x, float y, int octaves=4, float lacunarity=2.f, float gain=0.5f) const
float ridged(float x, float y, int octaves=4, float lacunarity=2.f, float gain=0.5f) const
float fbmPerlin(float x, float y, int octaves=4, float lacunarity=2.f, float gain=0.5f) const
float warp(float x, float y, float amp, int octaves=3) const
float hash01(int ix, int iy) const
float perlinNoise(float x, float y) const
Classic 2D Perlin gradient noise, remapped to [0, 1].
float ridgedPerlin(float x, float y, int octaves=4, float lacunarity=2.f, float gain=0.5f) const
float valueNoise(float x, float y) const