move shaders into .glsl files and add #include feature

This commit is contained in:
2019-02-21 19:26:40 +01:00
parent 16eb9de358
commit eaab9c79e5
47 changed files with 1124 additions and 777 deletions

21
data/shaders/atlas.glsl Normal file
View File

@@ -0,0 +1,21 @@
[[vertex]]
uniform mat4 mvp;
uniform vec2 tof;
uniform vec2 tsz;
in vec2 pos;
in vec2 uvs;
out vec2 uv;
void main()
{
uv = tof + uvs * tsz;
gl_Position = mvp * vec4(pos, 0.0, 1.0);
};
[[fragment]]
uniform sampler2D tex;
in mediump vec2 uv;
out mediump vec4 frag;
void main()
{
frag = texture(tex, uv);
};