aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/renderer/shaders/glsl/full_screen.v.glsl
blob: b89cedfa564acbcf4e504cab7d7a2b0289caa5a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#version 330 core

void main() {
  vec4 position;
  position.x = (gl_VertexID == 2) ? 3.0 : -1.0;
  position.y = (gl_VertexID == 0) ? -3.0 : 1.0;
  position.z = 1.0;
  position.w = 1.0;

  // Single triangle is clipped to viewport.
  //
  // X <- vid == 0: (-1, -3)
  // |\
  // | \
  // |  \
  // |###\
  // |#+# \ `+` is (0, 0). `#`s are viewport area.
  // |###  \
  // X------X <- vid == 2: (3, 1)
  // ^
  // vid == 1: (-1, 1)

  gl_Position = position;
}