Skip to content

Instantly share code, notes, and snippets.

View eyeofparadox's full-sized avatar

David Bryan Roberson eyeofparadox

View GitHub Profile
@eyeofparadox
eyeofparadox / Perlin_Tiled.cs
Created March 1, 2023 22:37 — forked from Flafla2/Perlin_Tiled.cs
A slightly modified implementation of Ken Perlin's improved noise that allows for tiling the noise arbitrarily.
public class Perlin {
public int repeat;
public Perlin(int repeat = -1) {
this.repeat = repeat;
}
public double OctavePerlin(double x, double y, double z, int octaves, double persistence) {
double total = 0;
@eyeofparadox
eyeofparadox / Perlin.cs
Created March 1, 2023 22:41 — forked from Flafla2/Perlin.cs
Improved Perlin Noise Implementation in C#
public class Perlin {
public static double OctavePerlin(double x, double y, double z, int octaves, double persistence) {
double total = 0;
double frequency = 1;
double amplitude = 1;
for(int i=0;i<octaves;i++) {
total += perlin(x * frequency, y * frequency, z * frequency) * amplitude;
amplitude *= persistence;