summary refs log tree commit diff
path: root/shader/tri.frag
blob: f67a4e04d3049402c845623ceaed5f1bad537f88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#version 450

layout(location = 0) in vec2 uv;
layout(location = 1) in vec4 in_color;
layout(location = 2) flat in int type;

layout(location = 0) out vec4 out_color;

void main(void) {
	float n = 2 * length(uv - 0.5);
	switch (type) {
	case 0:
		out_color = vec4(in_color.rgb, in_color.a * float(n<1));
		break;
	case 1:
		out_color = vec4(in_color.rgb, in_color.a * (max(0.25 - n, 0) + max(1 - n, 0)) * 0.5);
		break;
	}
}