Skip to content

Instantly share code, notes, and snippets.

@pixelnerve
Last active December 21, 2015 06:38
Show Gist options
  • Save pixelnerve/6265270 to your computer and use it in GitHub Desktop.
Save pixelnerve/6265270 to your computer and use it in GitHub Desktop.
Fullscreen TRIANGLE
#version 330 core
layout(location = 0) in vec4 PositionIn;
const vec2 verts[3] = vec2[]( vec2(-1, -1), vec2(3, -1), vec2(-1, 3) );
const vec2 uvs[3] = vec2[]( vec2(0, 2), vec2(2, 2), vec2(0, 0) );
out block
{
vec2 texcoord;
} OUT;
void main()
{
vec2 position2 = verts[ gl_VertexID ];
vec2 texcoord = uvs[ gl_VertexID ];
OUT.texcoord = texcoord;
gl_Position = vec4( position2, 0.0, 1.0 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment