yozoon/gnome-shell-extension-blyr

Feature Request: Implement Kawase Blur Algorithm

ToxicDragon opened this issue · 7 comments

Using Wayfire, it is possible to select various types of blur. One of the is Kawase Blur, which apparently is also used in MacOs and Windows 10, looks really stunning and should also be way more efficient. A video showing more details can be found here: https://youtu.be/AN-cVA_tCR0

It would be great to see the Kawase Blur algorithm being used by Blyr extension :)

It seems like a fork of Compton is also integrating Kawase Blur: https://github.com/tryone144/compton

Here you can find a Kawase Blur implementation in javascript (which might be handy for gnome shell extension development): https://github.com/pixijs/pixi-filters/tree/master/filters/kawase-blur

Here is a generel comparison between gaussian / kawase / box filter: https://software.intel.com/en-us/blogs/2014/07/15/an-investigation-of-fast-real-time-gpu-based-image-blur-algorithms

The original proposal by Masaki Kawase ist his GDC2003 presentation “Frame Buffer Postprocessing Effects in DOUBLE-S.T.E.A.L (Wreckless)”: http://www.daionet.gr.jp/~masa/archives/GDC2003_DSTEAL.ppt

I already tried to implement a dual Kawase blur shader (and it kinda worked, see kawase-blur branch ), but I was unable to solve a memory leak that resulted in the extension taking up multiple hundred megabytes of memory...
Also the level of control I have using pure GJS (as it is required for Shell extensions) is limited. The best way would be to have the blur effect natively supported by clutter. So out of curiosity, I also implemented the Kawase blur effect in C for the Clutter Library (see: clutter-kawase-blur-effect-demo which increased the performance a lot, but this was at the time when GNOME 3.36 was already on the horizon. GNOME Shell 3.36 now natively supports this kind of blur shader, so I stopped trying to implement the effect by myself and just used the blur effect provided by the shell (see current master branch).
Of course you can play around with the code of my attempts to implement the effect myself, and maybe you can fix the memory leak, then we could backport this kind of shader to users of GNOME Shell < 3.36.
Cheers,
Julius

I close this issue for now, because the recent commit 6eb7aee implements the native Shell Blur effect (GNOME Shell 3.36), which is based on the Kawase blur.

Oh, thank you for the information! I'll look into the gnome shell implementation! Thx!