Skip to main content

FULLSCREEN_VERT

Constant FULLSCREEN_VERT 

Source
pub const FULLSCREEN_VERT: &str = "// fullscreen.vert \u{2014} single-triangle fullscreen pass\r\n//\r\n// Covers the entire clip-space viewport using 3 vertices, no VBO needed.\r\n// Call with glDrawArrays(GL_TRIANGLES, 0, 3) with any VAO bound.\r\n//\r\n//   gl_VertexID  uv        clip-space pos\r\n//   0            (0, 0)    (-1, -1)\r\n//   1            (2, 0)    ( 3, -1)\r\n//   2            (0, 2)    (-1,  3)\r\n//\r\n// The giant triangle is clipped to the viewport, so f_uv stays in [0,1]\r\n// across all visible fragments.\r\n\r\n#version 330 core\r\n\r\nout vec2 f_uv;\r\n\r\nvoid main() {\r\n    float u = float(gl_VertexID & 1) * 2.0;\r\n    float v = float(gl_VertexID >> 1) * 2.0;\r\n    f_uv        = vec2(u, v);\r\n    gl_Position = vec4(u * 2.0 - 1.0, v * 2.0 - 1.0, 0.0, 1.0);\r\n}\r\n";