Skip to content
0.2.0-dev Download ZIP
39 lines ·621 B Raw
1/* clang-format off */
2#[modes]
3
4mode_default =
5
6#[specializations]
7
8USE_EXTERNAL_SAMPLER = false
9
10#[vertex]
11
12layout(location = 0) in vec2 vertex_attrib;
13
14out vec2 uv_interp;
15
16
17void main() {
18 uv_interp = vertex_attrib * 0.5 + 0.5;
19 gl_Position = vec4(vertex_attrib, 1.0, 1.0);
20}
21
22/* clang-format off */
23#[fragment]
24
25layout(location = 0) out vec4 frag_color;
26in vec2 uv_interp;
27
28/* clang-format on */
29#ifdef USE_EXTERNAL_SAMPLER
30uniform samplerExternalOES sourceFeed; // texunit:0
31#else
32uniform sampler2D sourceFeed; // texunit:0
33#endif
34
35void main() {
36 vec4 color = texture(sourceFeed, uv_interp);
37
38 frag_color = color;
39}