Created
June 23, 2019 18:12
-
-
Save croepha/1546e72b2dab85ae755b815196f822fb 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
char* vertex_shader = | |
"#version 100\n" | |
"attribute highp vec3 mesh_xyz;\n" | |
"attribute highp vec4 mesh_color;\n" | |
"uniform highp mat4 model_view;\n" | |
"uniform highp mat4 projection;\n" | |
"varying highp vec4 vertex_color;\n" | |
"varying highp vec4 vertex_position;\n" | |
"void main () {\n" | |
" vertex_color = mesh_color;\n" | |
" vertex_position = gl_Position = projection * model_view * vec4(mesh_xyz, 1);\n" | |
"}\n" | |
; | |
char* fragment_shader = | |
"#version 100\n" | |
"varying highp vec4 vertex_color;\n" | |
"varying highp vec4 vertex_position;\n" | |
"void main () {\n" | |
" if (distance(vertex_position, gl_FragCoord) < 10.0) {\n" | |
" gl_FragColor = vec4(0.0,0.0,0.0,1.0);\n" | |
" } else {\n" | |
" gl_FragColor = vertex_color;\n" | |
" }\n" | |
"}\n"; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment