Low quality path rendering on GPU

163 views
Skip to first unread message

ピックスフォルジュ

unread,
Aug 23, 2021, 7:07:23 AM8/23/21
to skia-discuss
I'm experimenting with Skia on C++ (built with gn then imported libskia.a and headers into CMake, using GLFW or SDL2 to open a windowed GL context) and it looks like the rendering quality isn't great when I try to render glyphs or other complex paths. This strangely does not occur when I was using unofficial Rust Skia bindings and Winit for windowing.

Does anyone have an idea of why this is?

Below is a screenshot, you can see the burred edges on the right-hand side "leg" of the letter R. Here is my code: https://pastebin.com/1ueQmYXg


I would provide any extra information as needed and I appreciate any assistance. Thanks.

ピックスフォルジュ

unread,
Aug 23, 2021, 7:08:32 AM8/23/21
to skia-discuss
letter_r.png

Apologies, my previous message did not attach the image for some reason. Here is it.

ピックスフォルジュ

unread,
Aug 24, 2021, 2:45:03 AM8/24/21
to skia-discuss
Hello all, setting `GrContextOptions::fInternalMultisampleCount` to anything but `4` seems to fix it. I'll set it to 16 for my applications. Thank you very much.

Michael Ludwig

unread,
Aug 24, 2021, 10:13:13 AM8/24/21
to skia-discuss
I cannot say for certain what the Rust Skia bindings are doing, or what version of Skia they are linked to. But our newest path renderer uses MSAA when you draw a path with anti-aliasing and is able to dynamically attach or acquire an MSAA surface to draw with even if the final SkSurface was not created with MSAA (hence fInternalMultisampleCount). It offers significantly better performance compared to our other path renderers, without needing to cache or pre-compute masks or distance fields, but it's visual quality is constrained by the sample count of the MSAA buffer.  On high dpi screens and mobile devices, a sample count of 4 is reasonable but a higher value being necessary on a desktop platform is not surprising.

Christopher Dalton

unread,
Aug 24, 2021, 11:01:27 AM8/24/21
to skia-d...@googlegroups.com
I'll set it to 16 for my applications

I'd highly recommend 8 if it is acceptable for you. 16 is really only partially supported by many GPUs, leading to performance and correctness issues.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/c1e82e46-ef68-4ff5-a840-491cb7f7ebcfn%40googlegroups.com.

ピックスフォルジュ

unread,
Aug 26, 2021, 6:06:15 AM8/26/21
to skia-discuss
> I cannot say for certain what the Rust Skia bindings are doing

I believe they are simply using an older version of Skia without the newer path renderer.

Reply all
Reply to author
Forward
0 new messages