pixels = W:512 H:512

x = from -8 to 8 W
z = from -8 to 8 H

fx = floor(x)
gx = x - fx
fz = floor(z)
gz = z - fz

a = xor_hash2(fx, fz)
b = xor_hash2(fx + 1, fz)
c = xor_hash2(fx, fz + 1)
d = xor_hash2(fx + 1, fz + 1)

m = cosine_interpolate(a, b, gx)
n = cosine_interpolate(c, d, gx)

r = cosine_interpolate(m, n, gz)

a = fdf_hash2(fx, fz)
b = fdf_hash2(fx + 1, fz)
c = fdf_hash2(fx, fz + 1)
d = fdf_hash2(fx + 1, fz + 1)

m = cosine_interpolate(a, b, gx)
n = cosine_interpolate(c, d, gx)

g = cosine_interpolate(m, n, gz)

a = sin_hash2(fx, fz)
b = sin_hash2(fx + 1,fz)
c = sin_hash2(fx, fz + 1)
d = sin_hash2(fx + 1, fz + 1)

m = cosine_interpolate(a, b, gx)
n = cosine_interpolate(c, d, gx)

b = cosine_interpolate(m, n, gz)

a = 1
