summaryrefslogtreecommitdiff
path: root/src/scope/shaders/view.vert
diff options
context:
space:
mode:
Diffstat (limited to 'src/scope/shaders/view.vert')
-rw-r--r--src/scope/shaders/view.vert7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/scope/shaders/view.vert b/src/scope/shaders/view.vert
new file mode 100644
index 0000000..d9461e9
--- /dev/null
+++ b/src/scope/shaders/view.vert
@@ -0,0 +1,7 @@
+#version 450
+// One triangle over the whole target, from the vertex index alone: the
+// fragment shaders work in pixels (gl_FragCoord).
+void main() {
+ vec2 p = vec2((gl_VertexIndex << 1) & 2, gl_VertexIndex & 2);
+ gl_Position = vec4(p * 2.0 - 1.0, 0.0, 1.0);
+}