varying vec2 texCoord;
uniform sampler2D envMap;
uniform samplerCube reflectMap;
uniform float eta;
varying float colLol;

varying vec3 eye;
varying vec3 norm;

void main()
{
float eta = 0.85;
vec3 perpedNorm = norm;
//perpedNorm.b+=colLol;
vec3 theVec = refract(normalize(eye),normalize(perpedNorm),eta);
vec3 reflVec = reflect(normalize(eye),normalize(perpedNorm));
vec3 refraCol = textureCube(reflectMap,theVec).rgb;
vec3 reflecCol = textureCube(reflectMap,reflVec).rgb;

float fressy = ((1.0 - eta)*(1.0 - eta))/((1.0 + eta)*(1.0 + eta));
float superFres = fressy + (1.0 - fressy)*pow((1.0-dot(normalize(-eye),perpedNorm)),5.0);

vec3 envCol1 = vec3(colLol,colLol,colLol);
gl_FragColor = vec4(mix(refraCol,reflecCol,superFres) ,1.0);

}