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.

12 lines
270 B

4 years ago
  1. varying vec4 V_WorldPos;
  2. varying vec3 V_Normal;
  3. uniform samplerCube U_MainTexture;
  4. void main()
  5. {
  6. vec3 eyeVec = normalize(V_WorldPos.xyz - vec3(0.0));
  7. vec3 n = normalize(V_Normal);
  8. vec3 r = refract(eyeVec, n, 1.0/1.4);
  9. gl_FragColor=textureCube(U_MainTexture, r);
  10. }