blob: 4e195794fa6e01115f783be15ba953cd94bdbfb0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
## coding=utf-8
<%inherit file="shader_base.mako"/>\
layout(triangles) in;
layout(triangle_strip, max_vertices = 3) out;
uniform ${from_type} from;
uniform ${to_type} to;
in vec4 vertex_to_gs[3];
out vec4 fs_color;
#define RED vec4(1.0, 0.0, 0.0, 1.0)
#define GREEN vec4(0.0, 1.0, 0.0, 1.0)
void main()
{
${to_type} converted = ${converted_from};
bool match = converted == to;
for (int i = 0; i < 3; i++) {
fs_color = match ? GREEN : RED;
gl_Position = vertex_to_gs[i];
EmitVertex();
}
}
|