MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / fractalXY

Method fractalXY

Source/Utils/SimplexNoise.cpp:434–449  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

432 * @return Noise value in the range[-1; 1], value of 0 on all integer coordinates.
433 */
434float 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected