https://www.dropbox.com/s/n8tth64f0klj63e/crap_dff.jpg

Code: Select all
#version 150
in vec4 vertex;
out vec2 oUv0;
out vec3 oRay;
uniform vec3 farCorner;
uniform float flip;
void main()
{
// Clean up inaccuracies
vec2 Pos = sign(vertex.xy);
// Image-space
oUv0 = (vec2(Pos.x, -Pos.y) + 1.0) * 0.5;
// This ray will be interpolated and will be the ray from the camera
// to the far clip plane, per pixel
oRay = farCorner * vec3(Pos, 1);
gl_Position = vec4(Pos, 0, 1);
gl_Position.y *= flip;
}