move shaders into .glsl files and add #include feature
This commit is contained in:
21
data/shaders/atlas.glsl
Normal file
21
data/shaders/atlas.glsl
Normal 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);
|
||||
};
|
||||
Reference in New Issue
Block a user