mirror of
https://github.com/enduro2d/enduro2d.git
synced 2025-12-15 00:11:55 +07:00
shader asset
This commit is contained in:
9
untests/bin/library/shader.frag
Normal file
9
untests/bin/library/shader.frag
Normal 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);
|
||||
}
|
||||
4
untests/bin/library/shader.json
Normal file
4
untests/bin/library/shader.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"vertex" : "shader.vert",
|
||||
"fragment" : "shader.frag"
|
||||
}
|
||||
12
untests/bin/library/shader.vert
Normal file
12
untests/bin/library/shader.vert
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user