Fix #112180: Noise with high detail and lacunarity outputs erratic values

This patch fixes #112180 by aligning the floor fraction function with
the GLSL/SVM ones, through the use of the floor math function.

Pull Request: https://projects.blender.org/blender/blender/pulls/112962
This commit is contained in:
Hoshinova
2023-09-27 18:01:17 +02:00
committed by Omar Emara
parent 6caa8010d0
commit d98005da5d

View File

@@ -381,8 +381,9 @@ BLI_INLINE float noise_grad(uint32_t hash, float x, float y, float z, float w)
BLI_INLINE float floor_fraction(float x, int &i)
{
i = int(x) - ((x < 0) ? 1 : 0);
return x - i;
float x_floor = math::floor(x);
i = int(x_floor);
return x - x_floor;
}
BLI_INLINE float perlin_noise(float position)