Created
August 30, 2018 14:11
-
-
Save jt0dd/2842997f9284d6887aedab15538aea5b to your computer and use it in GitHub Desktop.
This file contains 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
// fragment shaders don't have a default precision so we need | |
// to pick one. mediump is a good default. It means "medium precision" | |
precision mediump float; | |
void main() { | |
// gl_FragColor is a special variable a fragment shader | |
// is responsible for setting | |
gl_FragColor = vec4(1, 0, 0.5, 1); // return redish-purple | |
} |
This file contains 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
// an attribute will receive data from a buffer | |
attribute vec4 a_position; | |
// all shaders have a main function | |
void main() { | |
// gl_Position is a special variable a vertex shader | |
// is responsible for setting | |
gl_Position = a_position; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment