• Periodic fractional Brownian motion. Sums octaves octaves of periodicNoise2, each sampled at lacunarity × the previous frequency and scaled by gain × the previous amplitude. The lattice period passed to each octave scales with the frequency, so the wrap stays consistent across the spectrum. pX and pY describe the base octave's period.

    Parameters

    • x: number
    • y: number
    • pX: number
    • pY: number
    • octaves: number = 4
    • lacunarity: number = 2.0
    • gain: number = 0.5

    Returns number