You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

13 lines
270 B

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);
}