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
261 B

  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 = reflect(eyeVec, n);
  9. gl_FragColor=textureCube(U_MainTexture, r);
  10. }