varying vec4 V_WorldPos; varying vec3 V_Normal; uniform samplerCube U_MainTexture; void main() { vec3 eyeVec = normalize(V_WorldPos.xyz - vec3(0.0)); vec3 n = normalize(V_Normal); vec3 r = refract(eyeVec, n, 1.0/1.4); gl_FragColor=textureCube(U_MainTexture, r); }