uniform samplerCube Env; varying vec3 dir; void main(){ gl_FragColor = textureCube(Env, normalize(dir)); //if (dir.z < 0) //{ // gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); //} //gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); }