c = lerp(a, b, sy);
/* interpolate along the bottom slice of the cell */
- u = dotgrad3(grad3[b00 + bz0], rx0, ry0, rz1);
- v = dotgrad3(grad3[b10 + bz0], rx1, ry0, rz1);
+ u = dotgrad3(grad3[b00 + bz1], rx0, ry0, rz1);
+ v = dotgrad3(grad3[b10 + bz1], rx1, ry0, rz1);
a = lerp(u, v, sx);
- u = dotgrad3(grad3[b01 + bz0], rx0, ry1, rz1);
- v = dotgrad3(grad3[b11 + bz0], rx1, ry1, rz1);
+ u = dotgrad3(grad3[b01 + bz1], rx0, ry1, rz1);
+ v = dotgrad3(grad3[b11 + bz1], rx1, ry1, rz1);
b = lerp(u, v, sx);
d = lerp(a, b, sy);
c = lerp(a, b, sy);
/* interpolate along the bottom slice of the cell */
- u = dotgrad3(grad3[b00 + bz0], rx0, ry0, rz1);
- v = dotgrad3(grad3[b10 + bz0], rx1, ry0, rz1);
+ u = dotgrad3(grad3[b00 + bz1], rx0, ry0, rz1);
+ v = dotgrad3(grad3[b10 + bz1], rx1, ry0, rz1);
a = lerp(u, v, sx);
- u = dotgrad3(grad3[b01 + bz0], rx0, ry1, rz1);
- v = dotgrad3(grad3[b11 + bz0], rx1, ry1, rz1);
+ u = dotgrad3(grad3[b01 + bz1], rx0, ry1, rz1);
+ v = dotgrad3(grad3[b11 + bz1], rx1, ry1, rz1);
b = lerp(u, v, sx);
d = lerp(a, b, sy);
y = (i + 0.5f) / (NY/2.0f) - 1.0f;
for(j=0; j<NX; j++) {
x = (j + 0.5f) / (NX/2.0f) - 1.0f;
- sz = cgm_lerp(1.0f, noise2(x * 5.0f, t) * noise2(y * 5.0f, t) * 2.5f, scr.vis);
+ sz = cgm_lerp(1.0f, noise3(x * 5.0f, y * 5.0, t) * 2.0f, scr.vis);
if(sz < 0.0f) sz = 0.0f;
if(sz > 1.0f) sz = 1.0f;
xr = sz / NX;