hubbub

Simple module that generates 2D improved Perlin noise. More or less a Frankenstein’s monster of this and this implemented in Go.

Usage is simple:

import (
    "github.com/dwimmertxt/hubbub"
)

var (
    scale       float64 = 0.05
    persistence float64 = 0.5
    octaves     float64 = 4
)
// initialise an instance of hubbub
hb := hubbub.New()

// get a Perlin noise value in range [0, 1]
nz := hb.Get2D(2.15 * scale, 5.423 * scale)

// get an octaved Perlin noise value in range [0, 1] 
nz := hb.Octave2D(2.15 * scale, 5.423 * scale, persistence, octaves)
        

GitHub

View Github