Skip to content

Instantly share code, notes, and snippets.

@Efimero
Efimero / perlin.cljs
Created March 7, 2018 13:44
ClojureScript Simplex Noise Implementation
(ns perlin.noise)
; Usage:
; (def my-generator (perlin.noise/generator "My Favorite Seed"))
; (my-generator 1.1 2.2 3.3) ; input coordinates as float, output single float (-1 to 1 gaussian distribution)
(defn generator
([] (generator (rand)))
([seed]
(let [T [0x15 0x38 0x32 0x2c 0x0d 0x13 0x07 0x2a]