Skip to content

Instantly share code, notes, and snippets.

@hiroyuki
Last active November 28, 2019 14:34
Show Gist options
  • Save hiroyuki/9f2356a148b22a48285a9171575e93c9 to your computer and use it in GitHub Desktop.
Save hiroyuki/9f2356a148b22a48285a9171575e93c9 to your computer and use it in GitHub Desktop.
// fragment shader
#version 150
// this is how we receive the texture
uniform sampler2D tex0;
in vec2 varyingtexcoord;
out vec4 outputColor;
void main()
{
vec4 color = texture(tex0, varyingtexcoord);
outputColor = color;
}
#version 150
uniform mat4 modelViewProjectionMatrix;
out vec2 varyingtexcoord;
in vec4 position;
void main(){
varyingtexcoord = position.xy/720.0;//screen width
gl_Position = modelViewProjectionMatrix * position;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment