What are the correct settings to render into a _SRgb render target with linear device color space?

97 views
Skip to first unread message

tonfilm

unread,
Sep 3, 2021, 12:44:43 PM9/3/21
to skia-discuss
Hello,

we currently use the ANGLE DX11 backend with linear device color space. We use SkiaSharp to directly render into the final render target by creating a SkSurface from the render target.

However, we have subtle differences in rendering colors and especially glyph edges compared to gamma device color space.

This is the surface setup, the render target format is R8G8B8A8_UNorm_SRgb:


What is the correct setting to get correct font rendering when the DirectX device is set to linear color space?

Thanks!

tonfilm

unread,
Sep 13, 2021, 8:34:33 AM9/13/21
to skia-discuss
Bump. So how do we set up Skia correctly that the alpha values (such as glyph edges) work properly with a linear pipeline setup?

Thanks!


Brian Osman

unread,
Sep 13, 2021, 11:08:26 AM9/13/21
to skia-d...@googlegroups.com
We just recently added a new SkColorType that corresponds to a HW _SRGB format: https://skia.googlesource.com/skia/+/refs/heads/main/include/core/SkImageInfo.h#94

That probably doesn't exist in SkiaSharp yet, but when it does, I think the correct SkSurface configuration to get linear blending would be to use that color type, and a linear color space (eg, SkColorSpace::MakeSRGBLinear).

--
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/0693c2b3-7003-43df-bb32-1eea5f5031b5n%40googlegroups.com.

tonfilm

unread,
Sep 15, 2021, 2:02:06 PM9/15/21
to skia-discuss
Thanks, we made an issue there and will try to start a pull request:
Reply all
Reply to author
Forward
0 new messages