         {
             Heights[k] = (Heights[k - halfStep] + Heights[k + halfStep]) / 2.0
                 + transit(snoise(vec2(line, k)), -1.0, 1.0, -hardness, hardness);
+        }
+    }
+}
+
+#define idx(x, y) (y * (NumPnts + 1) + x)
+#define lval(x, y) Land[idx(x, y)]
+#define lset(x, y, v) Land[idx(x, y)] = v
+
+void land()
+{
+    float H = 0.6;
+    lset(0, 0, 0.0);
+    lset(0, NumPnts, 0.0);
+    lset(NumPnts, 0, 0.0);
+    lset(NumPnts, NumPnts, 0.0);
+    for (int step = NumPnts; step > 1; step /= 2)
+    {
+        float hardness = 1 / pow(2.0, H / float(step) * NumPntsF);
+        int halfStep = step / 2;
+        for (int y = halfStep; y < NumPnts; y += step)
+        {
+            for (int x = halfStep; x < NumPnts; x += step)
+            {
+                float value = (lval(x - halfStep, y - halfStep) + lval(x - halfStep, y + halfStep)
+                    + lval(x + halfStep, y - halfStep) + lval(x + halfStep, y + halfStep)) / 4.0;
+                    + transit(snoise(vec2(x, y)), -1.0, 1.0, -hardness, hardness);
+                lset(x, y, value);
+            }
+        }
+        for (int y = 0; y < NumPnts; y += step)
+        {
+            for (int x = halfStep; x < NumPnts; x += step)
+            {
+                int ym = y - halfStep;
+                if (ym < 0)
+                    ym += step;
+                float value = (lval(x - halfStep, y) + lval(x, ym)
+                    + lval(x + halfStep, y) + lval(x, y + halfStep)) / 4.0
+                    + transit(snoise(vec2(x, y)), -1.0, 1.0, -hardness, hardness);
+                lset(x, y, value);
+            }
+        }
+        for (int y = halfStep; y < NumPnts; y += step)
+        {
+            for (int x = 0; x < NumPnts; x += step)
+            {
+                int xm = x - halfStep;
+                if (xm < 0)
+                    xm += step;
+                float value = (lval(xm, y) + lval(x, y - halfStep)
+                    + lval(x + halfStep, y) + lval(x, y + halfStep)) / 4.0
+                    + transit(snoise(vec2(x, y)), -1.0, 1.0, -hardness, hardness);
+                lset(x, y, value);
+            }
         }
     }
 }

            R += pressence(persPos.xyz, Radius * transVal) * intens;
        }
    }
    */
const int NumPnts = 16;
const float NumPntsF = float(NumPnts);
float Heights[NumPnts + 1];
const int NumPntsSq = (NumPnts + 1) * (NumPnts + 1);
float Land[NumPntsSq];
float Radius = 2.0;
float Intensity = 0.8;

const float M_PI = 3.1415926535,
