#version 410 in vec2 uvV; uniform float globalAlpha = 1.0; // per-part settings in vec4 colorA; in vec4 colorB; in float radiusLow; in float radiusHigh; in float alpha; in float currentValue; out vec4 fragColor; // Simplest Texture render -- assign "texture1" from varying UV coords. // Requires vertex shader with uvV output, only. void main (void) { float r = distance(vec2(0,0), uvV); if(r < radiusLow || r > radiusHigh) discard; float angle = atan(uvV.y, uvV.x) / (3.141592653589793238 / 2.0); vec4 result = angle < currentValue ? colorB : colorA; result.a *= alpha * globalAlpha; fragColor = result; }