taj-ny / kwin-effects-forceblur

Blur any window on KDE Plasma 6
GNU General Public License v3.0
107 stars 7 forks source link

blur/rounded-corners: rewrite #68

Closed taj-ny closed 1 week ago

taj-ny commented 1 month ago

This is a rewrite of the rounded corners implementation, which has much better-looking corners. There's probably a better way to do it, but for now that's the simplest and most efficient way of doing it that I can implement myself.

The corner radiuses are also now decimal values.

Comparison

The pictures were made in the worst possible situation: maximum blur strength with the corner being on a darker surface right next to a bright one.

Blur only (15px radius)

Before

1

After

No antialiasing: 2 0,5 antialiasing: 3

With window-rounding effects (15px radius)

KDE-Rounded-Corners

17px blur radius with 1 antialiasing image Couldn't get it to match perfectly, but it's definitely better than before.

LightlyShaders

14,75px blur radius with 0,5 antialiasing image Looks perfect.

To do

talentlessguy commented 1 month ago

Sorry for off-topic, but what Window Decoration theme are you using here? I'm using SierraBreezeEnhanced window decoration and Lightly application style and I get artifacts coming from blur:

image

taj-ny commented 1 month ago

I'm using Breeze with disabled titlebar. In your picture it looks like SierraBreezeEnhanced specifies its own blur region, which needs to be overridden by enabling Blur window decorations as well. The bottom corner appears to be rounded properly, but you'll need an effect that rounds the window as well, such as KDE-Rounded-Corners or LightlyShaders.

talentlessguy commented 1 month ago

@taj-ny what should be border radii in each of the components (LightlyShaders/SierraBreezeEnhanced/Lightly/Force Blur)? Should be all the same (ex. 8px)?

I enabled all of them and I still experience artifacts, but only for window titlebar

image image image

also Force blur together with LightlyShaders makes most apps blurry (see https://github.com/a-parhom/LightlyShaders/issues/130)

taj-ny commented 1 month ago

Go to force blur settings, enable Blur window decorations as well and keep adjusting the top corner radius until it looks fine.

Applications becoming blurry when using LightlyShaders/KDE-Rounded-Corners with scaling is a KWin bug.

talentlessguy commented 1 month ago

@taj-ny should I file a bug to KDE? How do I reproduce it properly? I mean without involving desktop effects directly (like via c++ or smth idk)

taj-ny commented 1 month ago

@taj-ny should I file a bug to KDE? How do I reproduce it properly? I mean without involving desktop effects directly (like via c++ or smth idk)

It has already been reported. The bug report is about the Colorblindness Correction effect, but it's the same bug that affects LightlyShaders/KDE-Rounded-Corners. https://bugs.kde.org/show_bug.cgi?id=482978

taj-ny commented 1 month ago

I've fixed the low texture resolution issue when using scaling on Wayland, but sometimes its position is off by 1 pixel. A similar issue affects many effects, including Blur, Invert, Colorblindness Correction, LightlyShaders and KDE-Rounded-Corners. I guess I'm not going to bother fixing that for now and I'll just let users choose whether they want to use the old or the new rounded corners implementation.

EDIT: The issue described above will not occur when antialiasing is set to 0.

It's also interesting how even on 200% scaling the blur looks fine, even though the texture that's being blurred has a resolution that's two times smaller.

taj-ny commented 1 week ago

There are some minor issues with antialiasing when using scaling on Wayland but other than that everything seems to be working perfectly. I'll probably make a release tomorrow.

Floating panels are now rounded correctly and non-floating panels aren't at all anymore.