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

uniform float testvalue;

vec2 iResolution=vec2(1920.0,1080.0);
vec2 iResolution2=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);

    ///vec2 uv2 = fragCoord.xy/iResolution2.xy;
	///vec2 p2 = uv2*2.0-1.0;
	///p2.x*=(iResolution2.x/iResolution2.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);
    vec4 cube_=texture2D(cubeMap, texCoord);
    vec4 meshhelix_=texture2D(meshhelixMap, 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;

    ///res=cloud_.rgb+floor_.rgb;
    res=cloud_.rgb*a+floor_.rgb*(1.0-a);

    res=res+meshhelix_.rgb;

    a=clamp(cube_.a,0.0,1.0);
    res=res.rgb*(1.0-a)+cube_.rgb*a;


	gl_FragColor = vec4(res,1.0);
}
