 precision mediump float;
 
-uniform vec3 cPosition_World;
+uniform vec4 cPosition_World;
 varying vec3 vDirection;
 const   vec3 unit = normalize( vec3( 1 ) ); // radius of unit sphere, representing the sun
 const  float vTime = 1.0;


vec4 clouds( vec3 v )
{
    vec2 pos = vec2( vTime * 80.0, vTime * 60.0 );
    vec4 acc = vec4( 0, 0, 0, 0 );

    const int layers = 100;
    for ( int i = 0; i < layers; i++ ) {
        float height = ( float( i ) * 12.0 + 350.0 - cPosition_World.y ) / v.y;
    }

    return acc;
}

    sky += sun( eye );

    vec4 cl = clouds( eye );

    float t = pow( 1.0 - 0.7 * vDirection.y, 15.0 ); // what is t?
    sky = mix( sky, cl.rgb, cl.a * ( 1.0 - t ) );

    gl_FragColor = vec4( sky.r, sky.g, sky.b, 1.0 );
}
