wlroots/render/vulkan
John Lindgren 2ec08b38d8 [RFC] vulkan: compensate alpha to better match perceptual blend intent
The Vulkan renderer performs alpha blending in linear RGB space, which
preserves hue better than blending sRGB-encoded values directly (as the
gles and pixman renderers do), but unfortunately tends to give a
too-bright result when blending dark and light colors.

(In desktop usage, this especially affects dark, semi-transparent
tooltips, which appear significantly more transparent than expected,
affecting readability if light text underneath shows through.)

This is a novel (I think) approach to compensating for this effect by
adjusting the alpha value of the source texture - basically the result
is that dark semi-transparent pixels are made a little more opaque,
while light semi-transparent pixels are made a little more transparent.
Alpha values of 0 and 1 are unchanged.

I am somewhat new to science of color blending (Björn Ottosson's page,
"How software gets color wrong" is very enlightening) but I think this
approach makes at least a little bit of sense theoretically, and the
result seems to me subjectively to be an improvement.

Analysis from an expert on the subject would be greatly appreciated.

v2: compensate alpha in solid color conversions also
v3: un-premultiply average value for solid color conversion
2024-12-14 11:55:03 -05:00
..
shaders [RFC] vulkan: compensate alpha to better match perceptual blend intent 2024-12-14 11:55:03 -05:00
meson.build render/vulkan: use renamed glslang binary by default 2023-07-27 16:06:49 +08:00
pass.c [RFC] vulkan: compensate alpha to better match perceptual blend intent 2024-12-14 11:55:03 -05:00
pixel_format.c render: unify getter for texture formats 2024-04-21 11:27:29 +00:00
README-alpha-blend [RFC] vulkan: compensate alpha to better match perceptual blend intent 2024-12-14 11:55:03 -05:00
renderer.c render/vulkan: fix crash on OOM 2024-12-06 14:28:40 +00:00
texture.c render/vulkan: add support for explicit sync 2024-10-28 17:51:21 +00:00
util.c render/vulkan: drop unused vulkan_has_extension() 2023-05-26 12:25:53 +00:00
vulkan.c render/vulkan: add support for explicit sync 2024-10-28 17:51:21 +00:00