aboutsummaryrefslogtreecommitdiff
path: root/render/gles3/shaders.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-06-08 15:52:42 -0400
committerDrew DeVault <sir@cmpwn.com>2017-06-08 15:52:42 -0400
commitcd6a40d81679c37795e9d24354a8bbbf84cd53a6 (patch)
tree82186fb0985a16ed76928b0226ff2eed9bb2c261 /render/gles3/shaders.c
parent83f8864f0ab1722aae12cc744094a7424c41f2d8 (diff)
Further improvements to rendering subsystem
Diffstat (limited to 'render/gles3/shaders.c')
-rw-r--r--render/gles3/shaders.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/render/gles3/shaders.c b/render/gles3/shaders.c
new file mode 100644
index 00000000..f53ef385
--- /dev/null
+++ b/render/gles3/shaders.c
@@ -0,0 +1,28 @@
+#include "render/gles3.h"
+#include <GLES3/gl3.h>
+
+const GLchar vertex_src[] =
+"uniform mat4 proj;\n"
+"attribute vec2 pos;\n"
+"attribute vec2 texcoord;\n"
+"varying vec2 v_texcoord;\n"
+"void main() {\n"
+" gl_Position = proj * vec4(pos, 0.0, 1.0);\n"
+" v_texcoord = texcoord;\n"
+"}\n";
+
+const GLchar fragment_src_RGB[] =
+"precision mediump float;\n"
+"varying vec2 v_texcoord;\n"
+"uniform sampler2D tex;\n"
+"void main() {\n"
+" gl_FragColor = vec4(texture2D(tex, v_texcoord).rgb, 1.0);\n"
+"}\n";
+
+const GLchar fragment_src_RGBA[] =
+"precision mediump float;\n"
+"varying vec2 v_texcoord;\n"
+"uniform sampler2D tex;\n"
+"void main() {\n"
+" gl_FragColor = texture2D(tex, v_texcoord);\n"
+"}\n";