Last active
December 21, 2015 06:38
-
-
Save pixelnerve/6265270 to your computer and use it in GitHub Desktop.
Fullscreen TRIANGLE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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