
uniform samplerCube cubeMap;
uniform sampler2D normalMap;

void main (void)
{
/*
	vec3 normal = -1.0+2.0*texture2D(normalMap, gl_TexCoord[0].xy).rgb;

	gl_FragColor = textureCube(cubeMap, normalize(gl_TexCoord[1].xyz+0.20*normal));
*/

	gl_FragColor = textureCube(cubeMap, gl_TexCoord[1].xyz) * 0.0 +
			textureCube(cubeMap, refract(-gl_TexCoord[1].xyz, vec3(0, 0, -1), 0.2)) * 0.2 +
			textureCube(cubeMap, refract(-gl_TexCoord[1].xyz, vec3(0, 0, -1), 0.7)) * 0.3 +
			textureCube(cubeMap, refract(gl_TexCoord[1].xyz, vec3(0, 0, -1), 0.55)) * 0.3 +
			texture2D(normalMap, gl_TexCoord[0].xy) * 0.2;
}