Partially working ellipse shader
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#version 430 core
|
||||
in vec4 gColor;
|
||||
in vec2 gFocusA;
|
||||
in vec2 gFocusB;
|
||||
in float gRad;
|
||||
|
||||
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)
|
||||
)
|
||||
);
|
||||
fColor = gColor;
|
||||
// fColor = vec4 (1,1,1,1);
|
||||
}
|
||||
//note it is the fragdepth that stops this from being square
|
||||
Reference in New Issue
Block a user