Improve ellipses

This commit is contained in:
2021-03-10 03:59:38 +01:00
parent cddf7d1f8f
commit cc86a701db
7 changed files with 39 additions and 60 deletions
+2 -14
View File
@@ -1,25 +1,13 @@
#version 430 core
in vec4 gColor;
in vec2 gFocusA;
in vec2 gFocusB;
in float gRad;
in vec2 gBoundingBox;
out vec4 fColor;
//out float gl_FragDepth;
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))) );
gl_FragDepth = max( gl_FragCoord.z
, step(gRad/2
, distance(pos,gFocusA) + distance(gFocusA,gFocusB)
//+ distance(pos,gFocusB)
)
);
if ( dot(gBoundingBox,gBoundingBox) > 1) { discard; }
fColor = gColor;
// fColor = vec4 (1,1,1,1);
}