2D Amortized Noise Performance Evaluator
A Program to Evaluate the Performance of Amortized Noise
|
Code file for 2D infinite Perlin noise functions. More...
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "Common.h"
#include "MurmurHash3.h"
Functions | |
unsigned int | h2 (unsigned int x, unsigned int y) |
float | infinitenoise2 (float vec[2]) |
float | InfinitePerlinNoise2D (float x, float y, float alpha, float beta, int n) |
Generate a cell of 2D infinite Perlin noise. | |
Infinite Perlin noise uses MurmurHash3 to get the gradients at integer points.
unsigned int h2 | ( | unsigned int | x, |
unsigned int | y | ||
) |
A 2D hash function. Hash two dimensions into a single unsigned int using MurmurHash.
x | X coordinate of value to be hashed. |
y | Y coordinate of value to be hashed. |
float infinitenoise2 | ( | float | vec[2] | ) |
Compute a single octave of infinite 2D noise at a single point.
vec | Point at which to evaluate noise. |
float InfinitePerlinNoise2D | ( | float | x, |
float | y, | ||
float | alpha, | ||
float | beta, | ||
int | n | ||
) |
Compute turbulence, also known as 1/f noise.
x | X coordinate. |
y | Y coordinate. |
alpha | Persistence. |
beta | Lacunarity. |
n | Side of square grid. |