uniform sampler2D PosTex, RefEyeTex, OcclusionTex;
uniform samplerCube EnvTex;

void main()
{
	vec2 texCoord = gl_FragCoord.xy / vec2(1280, 720);
	vec3 Pos = texture2D(PosTex, texCoord).xyz;
	if (Pos.z == 0.0) discard;
	gl_FragColor = textureCube(EnvTex, texture2D(RefEyeTex, texCoord).xyz) * (1.0 - texture2D(OcclusionTex, texCoord).x);
}
