1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add eased 3d point-value noise functions

This commit is contained in:
kwolekr 2014-11-12 23:49:45 -05:00
parent 7616537bc0
commit fc9521874c
2 changed files with 24 additions and 12 deletions

View file

@ -134,7 +134,7 @@ float noise2d(int x, int y, int seed);
float noise3d(int x, int y, int z, int seed);
float noise2d_gradient(float x, float y, int seed);
float noise3d_gradient(float x, float y, float z, int seed);
float noise3d_gradient(float x, float y, float z, int seed, bool eased=false);
float noise2d_perlin(float x, float y, int seed,
int octaves, float persistence);
@ -143,10 +143,10 @@ float noise2d_perlin_abs(float x, float y, int seed,
int octaves, float persistence);
float noise3d_perlin(float x, float y, float z, int seed,
int octaves, float persistence);
int octaves, float persistence, bool eased=false);
float noise3d_perlin_abs(float x, float y, float z, int seed,
int octaves, float persistence);
int octaves, float persistence, bool eased=false);
inline float easeCurve(float t) {
return t * t * t * (t * (6.f * t - 15.f) + 10.f);
@ -182,5 +182,10 @@ float contour(float v);
noise3d_perlin((float)(x) / (np)->spread.X, (float)(y) / (np)->spread.Y, \
(float)(z) / (np)->spread.Z, (s) + (np)->seed, (np)->octaves, (np)->persist))
#define NoisePerlin3DEased(np, x, y, z, s) ((np)->offset + (np)->scale * \
noise3d_perlin((float)(x) / (np)->spread.X, (float)(y) / (np)->spread.Y, \
(float)(z) / (np)->spread.Z, (s) + (np)->seed, (np)->octaves, \
(np)->persist), true)
#endif