1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

Rename perlin noise to value noise (#15858)

This commit is contained in:
Erich Schubert 2025-04-10 14:39:40 +02:00 committed by GitHub
parent 372e37faf2
commit 78293404c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 339 additions and 309 deletions

View file

@ -151,7 +151,7 @@ public:
u32 sy;
u32 sz;
float *noise_buf = nullptr;
float *gradient_buf = nullptr;
float *value_buf = nullptr;
float *persist_buf = nullptr;
float *result = nullptr;
@ -162,31 +162,31 @@ public:
void setSpreadFactor(v3f spread);
void setOctaves(int octaves);
void gradientMap2D(
void valueMap2D(
float x, float y,
float step_x, float step_y,
s32 seed);
void gradientMap3D(
void valueMap3D(
float x, float y, float z,
float step_x, float step_y, float step_z,
s32 seed);
float *perlinMap2D(float x, float y, float *persistence_map=NULL);
float *perlinMap3D(float x, float y, float z, float *persistence_map=NULL);
float *noiseMap2D(float x, float y, float *persistence_map=NULL);
float *noiseMap3D(float x, float y, float z, float *persistence_map=NULL);
inline float *perlinMap2D_PO(float x, float xoff, float y, float yoff,
inline float *noiseMap2D_PO(float x, float xoff, float y, float yoff,
float *persistence_map=NULL)
{
return perlinMap2D(
return noiseMap2D(
x + xoff * np.spread.X,
y + yoff * np.spread.Y,
persistence_map);
}
inline float *perlinMap3D_PO(float x, float xoff, float y, float yoff,
inline float *noiseMap3D_PO(float x, float xoff, float y, float yoff,
float z, float zoff, float *persistence_map=NULL)
{
return perlinMap3D(
return noiseMap3D(
x + xoff * np.spread.X,
y + yoff * np.spread.Y,
z + zoff * np.spread.Z,
@ -201,22 +201,22 @@ private:
};
float NoisePerlin2D(const NoiseParams *np, float x, float y, s32 seed);
float NoisePerlin3D(const NoiseParams *np, float x, float y, float z, s32 seed);
float NoiseFractal2D(const NoiseParams *np, float x, float y, s32 seed);
float NoiseFractal3D(const NoiseParams *np, float x, float y, float z, s32 seed);
inline float NoisePerlin2D_PO(NoiseParams *np, float x, float xoff,
inline float NoiseFractal2D_PO(NoiseParams *np, float x, float xoff,
float y, float yoff, s32 seed)
{
return NoisePerlin2D(np,
return NoiseFractal2D(np,
x + xoff * np->spread.X,
y + yoff * np->spread.Y,
seed);
}
inline float NoisePerlin3D_PO(NoiseParams *np, float x, float xoff,
inline float NoiseFractal3D_PO(NoiseParams *np, float x, float xoff,
float y, float yoff, float z, float zoff, s32 seed)
{
return NoisePerlin3D(np,
return NoiseFractal3D(np,
x + xoff * np->spread.X,
y + yoff * np->spread.Y,
z + zoff * np->spread.Z,
@ -227,10 +227,10 @@ inline float NoisePerlin3D_PO(NoiseParams *np, float x, float xoff,
float noise2d(int x, int y, s32 seed);
float noise3d(int x, int y, int z, s32 seed);
float noise2d_gradient(float x, float y, s32 seed, bool eased=true);
float noise3d_gradient(float x, float y, float z, s32 seed, bool eased=false);
float noise2d_value(float x, float y, s32 seed, bool eased=true);
float noise3d_value(float x, float y, float z, s32 seed, bool eased=false);
float noise2d_perlin(float x, float y, s32 seed,
float noise2d_fractal(float x, float y, s32 seed,
int octaves, float persistence, bool eased=true);
inline float easeCurve(float t)