varying vec2 texCoord;
uniform sampler2D envMap;
uniform sampler2D sceneMap;
uniform sampler2D logoMap;
uniform float anim2;
uniform float logoShow;
varying vec3 eye;
varying vec3 eyeSC;
void main()
{

	vec4 envCol = texture2D(envMap,texCoord);
	vec4 colol = vec4(1.0,1.0,1.0,1.0);
//	envCol.a = 0.002;
	float toner = length(-eye.xyz)*0.0003;
	toner = min(pow(toner,1.6),1.0);
	envCol.a *=toner;
	vec3 modVec = refract(eyeSC, vec3(0,0,envCol.a),0.8);
	vec2 tC = modVec.xy*0.5 + vec2(0.5);
	//tC.xy
	vec4 scene = texture2D(sceneMap,tC);
	vec4 logo = texture2D(logoMap,vec2(tC.x ,-tC.y - anim2*0.01));
	scene.a=toner;
//	scene.a*=0.6;
//	scene.r+=0.5;
//	gl_FragColor = envCol;
	gl_FragColor = scene * envCol*1.8 + logo*logoShow*1.0;
	
}