[Question] Text transparency in Win32 vs. UWP/WinUI on a translucent background #91
Replies: 1 comment
-
UWP/WinUI never uses anything from GDI, instead it uses Direct2D/DWrite/DirectComposition with hardware acceleration to compose the UI. GDI has almost no hardware acceleration, all rendering takes place in system memory, and the exact step to fix alpha is to manually change the value of the alpha channel in memory and apply alpha premultiplication. Unfortunately, the performance overhead of this operation is significant, and you can't expect to make all GDI-rendered text alpha-supported. By the way, GDI-rendered content will never be able to support HDR, because the relevant pixel formats are not supported. As far as I know, DWM is responsible for transforming GDI surfaces from SDR to HDR, except that sometimes the transformation may turn out to be wrong. I don't know much about HDR though because I lack a monitor that supports it :P The only advice I can give is to let go of the obsession and do something more meaningful. |
Beta Was this translation helpful? Give feedback.
-
I love the transparent translucent glass-like window background and I'm currently using OpenGlass and extending the mod's effects to the entire window area. The problem is that text becomes completely transparent in HDR or on a pure white background in Win32 windows, but on the other hand UWP/WinUI windows preserve the alpha channel of the texts regardless of the problem cases for Win32 windows.
As I already know, this is an architectural flaw of the GDI text rendering window that doesn't support transparency, but don't UWP/WinUI apps also use GDI text rendering?
Google didn't help me much in finding an answer, maybe you could help on this topic since you have internal knowledge of DWM/Windows effects.
What is the difference between the APIs regarding text transparency, is there a different way that UWP/WinUI renders translucent backgrounds or does it use a different text rendering engine? As far i am aware EBM/TF solve this by applying alpha blending but doesn't modifying GDI renderer could potentially break some system apps ?
Picture samples:
Win32 text alpha problem
White background:
HDR enabled:
UWP (Win11 StartMenu)
White background:
HDR enabled:
Win32 text transparency "fix"
(Using ExplorerBlurMica)
Applying Black saturation in Acrylic Brush background using OpenGlass GlassLuminosity(18%)
Beta Was this translation helpful? Give feedback.
All reactions