Skip to content

Commit

Permalink
add back in antialiasing
Browse files Browse the repository at this point in the history
  • Loading branch information
ccarmichael-uncharted committed Mar 6, 2024
1 parent 2c7c7b7 commit 12bc7eb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/graph/nodes/ring/Ring.fs.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,18 @@ void main() {
float thickness = uOutline / 2.0;
float innerRadius = 1.0 - thickness;
float ring = opOnion(sdCircle(vFromCenter, innerRadius), thickness);
float antialias = fPixelLength * 1.5;

if (ring > 0.0) {
discard;
}

fragColor = outputColor(vec4(fColor.rgb, 1.0));
if (uRenderMode == MODE_HIGH_PASS_2) {
if (ring < -antialias) {
discard;
}
fragColor = outputColor(vec4(fColor.rgb, smoothstep(0.0, antialias, abs(ring))));
} else {
fragColor = outputColor(vec4(fColor.rgb, 1.0));
}
}

0 comments on commit 12bc7eb

Please sign in to comment.