Implement arc rendering, works for increasing angle difference < 2pi

This commit is contained in:
2021-02-20 08:16:24 +01:00
parent 2866535b52
commit 9ff7810a2d
9 changed files with 101 additions and 104 deletions
+3 -4
View File
@@ -5,15 +5,14 @@ in float gRad;
out vec4 fColor;
out float gl_FragDepth;
uniform vec2 winSize;
void main()
{
vec2 pos = gl_FragCoord.xy;
// fColor = vec4( gColor.xyz , 0 );
// fColor = vec4( gColor.xyz , 1 - step(distance(pos,cenPos.xy),gRad) );
// fColor = vec4( gColor.xyz , distance(pos,cenPos.xy)/gRad );
fColor = vec4( gColor.rgb, gColor.a * (1-step(gRad/2,distance(pos,cenPosT))) );
// fColor = vec4( gColor.rgb, gColor.a * (1-step(gRad/2,distance(pos,cenPosT))) );
gl_FragDepth = max(gl_FragCoord.z , step(gRad/2,distance(pos,cenPosT)));
//fColor = vec4( 0.5,0,0 , 1 );
fColor = gColor;
}
//note it is the fragdepth that stops this from being square