1#version 140 2 3#extension GL_ARB_fragment_coord_conventions: require 4#extension GL_ARB_explicit_attrib_location : enable 5 6 7#if !defined GL_ARB_fragment_coord_conventions 8# error GL_ARB_fragment_coord_conventions is not defined 9#elif GL_ARB_fragment_coord_conventions != 1 10# error GL_ARB_fragment_coord_conventions is not equal to 1 11#endif 12 13 14layout (location = 0) in vec4 pos; 15out vec4 i; 16 17uniform float gtf_windowWidth; 18uniform float gtf_windowHeight; 19uniform float n; 20uniform float f; 21 22void main() 23{ 24 gl_Position = pos; 25 i = vec4((pos.x+1.0)*0.5*gtf_windowWidth, (pos.y+1.0)*0.5*gtf_windowHeight, (f-n)*0.5*pos.z + (f+n)*0.5, pos.w); 26} 27 28