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