summaryrefslogtreecommitdiff
path: root/shaders/crt.vert.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'shaders/crt.vert.glsl')
-rw-r--r--shaders/crt.vert.glsl9
1 files changed, 9 insertions, 0 deletions
diff --git a/shaders/crt.vert.glsl b/shaders/crt.vert.glsl
new file mode 100644
index 00000000..4e15fcdf
--- /dev/null
+++ b/shaders/crt.vert.glsl
@@ -0,0 +1,9 @@
+#version 450
+
+// CRT post-process pass: one fullscreen triangle from gl_VertexIndex, no
+// vertex buffer. The fragment shader derives uv from gl_FragCoord.
+
+void main() {
+ vec2 p = vec2(float((gl_VertexIndex << 1) & 2), float(gl_VertexIndex & 2));
+ gl_Position = vec4(p * 2.0 - 1.0, 0.0, 1.0);
+}