 #define DENSITY_HEIGHT_SCALE_M  1200.0
 #define PLANET_RADIUS           6360e3
 #define ATMOSPHERE_RADIUS       6420e3
-#define SAMPLE_STEPS            6
-#define DENSITY_STEPS           8
+#define SAMPLE_STEPS            16
+#define DENSITY_STEPS           16
 
 @slider1(0.0, 50.0)
 uniform float sun_intensity;


float terrain(vec2 p) {
    p *= 0.0013;
    float s = 1.0;
    float t = 0.0;
    for (int i = 0; i < 6; i++) {
        t += s * noi(p);
        s *= 0.5 + 0.1 * t;
        p = 0.97 * m2 * p + (t - 0.5) * 0.2;
    }
    return t * 55.0;
}

vec2 map(vec3 pos)
{
    float m = 0.0;
    float h = pos.y - terrain(pos.xz);
    float k = 60.0;

//#define ANIMATE

uniform vec2 resolution;
uniform float time;
