* Fractal/Fractional Brownian Motion (fBm) summation of 2D Perlin Simplex noise * * @param[in] octaves number of fraction of noise to sum * @param[in] x x float coordinate * @param[in] y y float coordinate * * @return Noise value in the range[-1; 1], value of 0 on all integer coordinates. */
| 432 | * @return Noise value in the range[-1; 1], value of 0 on all integer coordinates. |
| 433 | */ |
| 434 | float SimplexNoise::fractalXY(size_t octaves, float x, float y) { |
| 435 | float output = 0.f; |
| 436 | float denom = 0.f; |
| 437 | float frequency = mFrequency; |
| 438 | float amplitude = mAmplitude; |
| 439 | |
| 440 | for (size_t i = 0; i < octaves; i++) { |
| 441 | output += (amplitude * noiseXY(x * frequency, y * frequency)); |
| 442 | denom += amplitude; |
| 443 | |
| 444 | frequency *= mLacunarity; |
| 445 | amplitude *= mPersistence; |
| 446 | } |
| 447 | |
| 448 | return (output / denom); |
| 449 | } |
| 450 | |
| 451 | /** |
| 452 | * Fractal/Fractional Brownian Motion (fBm) summation of 3D Perlin Simplex noise |
nothing calls this directly
no outgoing calls
no test coverage detected