2D Amortized Noise Performance Evaluator
A Program to Evaluate the Performance of Amortized Noise
 All Classes Files Functions Variables Macros Pages
Macros | Functions
Common.h File Reference

Go to the source code of this file.

Macros

#define MurmurHash3_32   MurmurHash3_x86_32
 MurmurHash3 for x86 architectures.
 
#define B   0x100
 Perlin's B, a power of 2 usually equal to 256.
 
#define BM   0xff
 A bit mask, one less than B.
 
#define N   0x1000
 Perlin's N.
 
#define lerp(t, a, b)   (a + t*(b - a))
 Linear interpolation.
 
#define s_curve(t)   (t * t * (3.0f - 2.0f*t))
 Cubic spline.
 
#define s_curve2(t)   (t * t * t * (10.0f + 3.0f * t * (2.0f*t - 5.0f)))
 Quintic spline.
 
#define setup(i, b0, b1, r0, r1)
 Perlin's setup macro.
 
#define at2(rx, ry)   (rx*q[0] + ry*q[1])
 Perlin's dot product macro.
 

Functions

unsigned int h2 (unsigned int x, unsigned int y)
 

Macro Definition Documentation

#define setup (   i,
  b0,
  b1,
  r0,
  r1 
)
Value:
t = vec[i] + N;\
b0 = ((int)t) & BM;\
b1 = (b0+1) & BM;\
r0 = t - (int)t;\
r1 = r0 - 1.0f;

Function Documentation

unsigned int h2 ( unsigned int  x,
unsigned int  y 
)

A 2D hash function. Hash two dimensions into a single unsigned int using MurmurHash.

Parameters
xX coordinate of value to be hashed.
yY coordinate of value to be hashed.
Returns
Hash of (x, y).