 #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;

vec2 intersect(vec3 ro,vec3 rd,float tmin,float tmax ) {
    float t = tmin;
    float  m = 0.0;
    for(int i=0; i < 200; i++) {
        vec3 pos = ro + t*rd;
        vec2 res = map(pos);
        m = res.y;
        if (res.x < (0.001 * t) || t > tmax) break;
        t += res.x * 0.5;
    }
    return vec2(t, m);
}

mat3 setCamera(vec3 ro, vec3 ta, float cr) {
    vec3 cw = normalize(ta-ro);
    vec3 cp = vec3(sin(cr), cos(cr),0.0);
    vec3 cu = normalize(cross(cw,cp));


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

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