* Fractal/Fractional Brownian Motion (fBm) summation of 3D 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 * @param[in] z z float coordinate * * @return Noise value in the range[-1; 1], value of 0 on all integer coordinates. */
| 459 | * @return Noise value in the range[-1; 1], value of 0 on all integer coordinates. |
| 460 | */ |
| 461 | float SimplexNoise::fractalXYZ(size_t octaves, float x, float y, float z) { |
| 462 | float output = 0.f; |
| 463 | float denom = 0.f; |
| 464 | float frequency = mFrequency; |
| 465 | float amplitude = mAmplitude; |
| 466 | |
| 467 | for (size_t i = 0; i < octaves; i++) { |
| 468 | output += (amplitude * noiseXYZ(x * frequency, y * frequency, z * frequency)); |
| 469 | denom += amplitude; |
| 470 | |
| 471 | frequency *= mLacunarity; |
| 472 | amplitude *= mPersistence; |
| 473 | } |
| 474 | |
| 475 | return (output / denom); |
| 476 | } |
| 477 | |
| 478 | std::vector<std::vector<float>> SimplexNoise::create(size_t pWidth, size_t pHeight, size_t pOctaves) { |
| 479 |
nothing calls this directly
no outgoing calls
no test coverage detected