Skip to content

Instantly share code, notes, and snippets.

Created June 1, 2014 00:04
Show Gist options
  • Save anonymous/07ec0c6e5c0410e6c663 to your computer and use it in GitHub Desktop.
Save anonymous/07ec0c6e5c0410e6c663 to your computer and use it in GitHub Desktop.
Screen rendering!
uniform sampler2D uTexColor;
varying vec2 vTexCoord;
void main()
{
gl_FragColor = texture2D(uTexColor, vec2(vTexCoord));
}
attribute vec2 aPosition;
varying vec2 vTexCoord;
void main()
{
gl_Position = vec4(aPosition, 0, 1);
vTexCoord = (aPosition + vec2(1.0)) / 2.0;
}
GLfloat QuadVertices[] =
{
-1.0, -1.0,
1.0, -1.0,
1.0, 1.0,
-1.0, 1.0
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment