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

Method fractalX

Source/Utils/SimplexNoise.cpp:408–423  ·  view source on GitHub ↗

* Fractal/Fractional Brownian Motion (fBm) summation of 1D Perlin Simplex noise * * @param[in] octaves number of fraction of noise to sum * @param[in] x 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

406 * @return Noise value in the range[-1; 1], value of 0 on all integer coordinates.
407 */
408float SimplexNoise::fractalX(size_t octaves, float x) {
409 float output = 0.f;
410 float denom = 0.f;
411 float frequency = mFrequency;
412 float amplitude = mAmplitude;
413
414 for (size_t i = 0; i < octaves; i++) {
415 output += (amplitude * noiseX(x * frequency));
416 denom += amplitude;
417
418 frequency *= mLacunarity;
419 amplitude *= mPersistence;
420 }
421
422 return (output / denom);
423}
424
425/**
426 * Fractal/Fractional Brownian Motion (fBm) summation of 2D Perlin Simplex noise

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected