shader/rectangle_frag.glsl

changeset 151
42960d0c879b
parent 137
f8e6e0ae61a8
equal deleted inserted replaced
150:3045f61bc4eb 151:42960d0c879b
1 layout(location = 0) out vec4 diffuse;
2 in vec2 uvcoord;
3
4 uniform vec4 color;
5 uniform vec2 size;
6 #ifndef FILL
7 uniform float thickness;
8 #endif
9
10 void main(void) {
11 #ifdef FILL
12 diffuse = color;
13 #else
14 if (uvcoord.x < thickness || uvcoord.x >= size.x - thickness || uvcoord.y < thickness || uvcoord.y >= size.y-thickness) {
15 diffuse = color;
16 } else {
17 discard;
18 }
19 #endif
20 }

mercurial