varying vec2 texCoord;
//varying vec4 vColor;
uniform sampler2D smallMap;
uniform sampler2D bigMap;

uniform float testvalue;

vec2 iResolution=vec2(1920.0,1080.0);

void main (void)
{
    vec3 pos;
    vec2 fragCoord=gl_FragCoord.xy;

    vec2 uv = fragCoord.xy/iResolution.xy;
	vec2 p = uv*2.0-1.0;
	p.x*=(iResolution.x/iResolution.y);
	//vec3 col = vec3(0.05);
    //vec3 ro = vec3(0.0,0.0,-2.0);
    //vec3 rd = normalize(vec3(p,0.0)-ro);

    //float fov=1.2;

    ///bg=vec3(1,1,0);
    vec4 floor_ =texture2D(bigMap, texCoord);
    vec4 cloud_ =texture2D(smallMap, texCoord);
    float a=clamp(cloud_.a,0.0,1.0)/1.1;//1.225;
    float brightnessf=floor_.r+floor_.g+floor_.b;
    float brightnessc=cloud_.r+cloud_.g+cloud_.b;
    vec3 res;
    if (brightnessc>brightnessf) /// this removes barely seen ugly dark outline of the cloud volume
        res=cloud_.rgb*a+floor_.rgb*(1.0-a);
    else
        res=floor_.rgb;
	gl_FragColor = vec4(res,1.0);
}
