shader asset

This commit is contained in:
2018-11-28 19:22:20 +07:00
parent 27c7ce57d5
commit 8879e86c15
6 changed files with 131 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
#version 120
uniform sampler2D u_texture;
varying vec2 v_st;
void main() {
vec2 st = vec2(v_st.s, 1.0 - v_st.t);
gl_FragColor = texture2D(u_texture, st);
}

View File

@@ -0,0 +1,4 @@
{
"vertex" : "shader.vert",
"fragment" : "shader.frag"
}

View File

@@ -0,0 +1,12 @@
#version 120
attribute vec3 a_position;
attribute vec2 a_st;
uniform mat4 u_MVP;
varying vec2 v_st;
void main() {
v_st = a_st;
gl_Position = vec4(a_position, 1.0) * u_MVP;
}