I found strange issue with SFML antialiasing.
Here is screenshot (I used the same source with static scale=1):
All lines were drawn with Color.Black. But as you can see, SFML antialiasing changes color to grey incorrectly.
While D2D antialiasting shows still black lines.
Here is a small fix in DrawLine function (with line thickness).
It works incorrectly, because draws line 2x times bold.
With using it, SFML result looks very close to D2D.
public static void DrawLine
( RenderTarget target,
Vector2f start,
Vector2f end,
float strokeWidth,
Color color
) { var dv
= end
- start
; var dl
= (float)Math
.Sqrt(dv
.X * dv
.X + dv
.Y * dv
.Y); var uv
= dv
/ dl
; var up
= new Vector2f
(-uv
.Y, uv
.X); var offset
= up
* strokeWidth
; var array
= new[] { new Vertex
(start
+ offset, color
),
new Vertex
(end
+ offset, color
),
new Vertex
(end
- offset, color
),
new Vertex
(start
- offset, color
),
}; target
.Draw(array, PrimitiveType
.Quads); } Here is comparison between SFML and D2D antialiasing:
As you can see, the image is very close. But...
There is an issue with line jitter for both - SFML and D2D. May be it's related to precision of float value.
With take into account this issue, D2D antialiasing works great. It shows all lines with no skip.
But there is another picture for SFML - some lines just disappearing.
So, it's definitely SFML antialiasing issue.