2020-02-03 10:52:39 -08:00
|
|
|
#version 330
|
|
|
|
|
2023-01-24 20:03:23 -08:00
|
|
|
uniform bool winding;
|
|
|
|
|
2020-02-03 10:52:39 -08:00
|
|
|
in vec4 color;
|
2023-01-24 13:49:43 -08:00
|
|
|
in float fill_all;
|
2023-01-24 20:03:23 -08:00
|
|
|
in float orientation;
|
2020-02-03 10:52:39 -08:00
|
|
|
in vec2 uv_coords;
|
|
|
|
|
|
|
|
out vec4 frag_color;
|
|
|
|
|
2023-01-24 13:29:34 -08:00
|
|
|
void main() {
|
|
|
|
if (color.a == 0) discard;
|
|
|
|
frag_color = color;
|
2023-01-24 20:03:23 -08:00
|
|
|
|
|
|
|
if(winding && orientation > 0) frag_color *= -1;
|
|
|
|
|
2023-01-24 13:49:43 -08:00
|
|
|
if (bool(fill_all)) return;
|
2023-01-10 08:54:02 -08:00
|
|
|
|
2023-01-24 13:49:43 -08:00
|
|
|
float x = uv_coords.x;
|
|
|
|
float y = uv_coords.y;
|
2023-01-24 20:03:23 -08:00
|
|
|
float Fxy = (y - x * x);
|
|
|
|
if(!winding && orientation > 0) Fxy *= -1;
|
|
|
|
if(Fxy < 0) discard;
|
2020-03-30 20:26:06 +02:00
|
|
|
}
|