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(x, z)
b = xor_hash2(x + 1, z)
c = xor_hash2(x, z + 1)
d = xor_hash2(x + 1, z + 1)

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

r = linear_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 = linear_interpolate(a, b, gx)
n = linear_interpolate(c, d, gx)

g = linear_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 = linear_interpolate(a, b, gx)
n = linear_interpolate(c, d, gx)

b = linear_interpolate(m, n, gz)

a = 1
