This is work in progress. Look is not final. This align data VBO data structure used for edti cage drawing to the one use for normal drawing. We no longer use barycentric coords to draw the lines an just rasterize line primitives for edge drawing. This is a bit slower than using the previous fast method but faster than the "correct" (edge artifact free) method. This also make the code way simpler. This also makes it possible to reuse possible and normal vbos used for shading if the edit cage matches the This also touches the UV batch code to share as much render data as possible. The code also prepare for edit cage "modified" drawing cage (with modifier applied) but is not enabled since selection and operators does not work with modified cage yet.
18 lines
296 B
GLSL
18 lines
296 B
GLSL
|
|
flat in vec4 finalColor;
|
|
out vec4 fragColor;
|
|
|
|
void main()
|
|
{
|
|
vec2 centered = gl_PointCoord - vec2(0.5);
|
|
float dist_squared = dot(centered, centered);
|
|
const float rad_squared = 0.25;
|
|
|
|
// round point with jaggy edges
|
|
if (dist_squared > rad_squared) {
|
|
discard;
|
|
}
|
|
|
|
fragColor = finalColor;
|
|
}
|