tryone144 / compton

A compositor for X11.
Other
615 stars 236 forks source link

Disassociate Fade and Blur #2

Open PapyElGringo opened 5 years ago

PapyElGringo commented 5 years ago

Hello @tryone144 thanks for your work on this, it's Awesome.

However I noticed that If I use blurred background with the Fade-in/Fade-out feature It's don't work properly in my opinion.

Because today Fade-out feature basically change the opacity from the current level to 0 making the Client transparent while the blur feature make a transparent Client blurred.

The result is that all the fade-in or the fade-out create blur which could be a valid option but the problem here is that the blur "appear" or "disappear" instantly at entrance or exit of Client which break for me the use of the fading feature which is supposed to be a gentle transition.

Instead I would prefer that the opacity of the fading feature is independant of the opacity of the Client. It's mean that a blurred Client fading-out will appear less and less blurred and more an more transparent and would disappear gently.

Maybe it's already possible Im not a pro in Compton...

Please let me konw of what you are thinking about it.

Thanks in advance.

tryone144 commented 5 years ago

Maybe you can create a short screencast to show the intended effect? This would help me better understand the desired effect.

The problem I previously had was with transparent clients still beeing completely blurred. I guess this transparent-but-blurred client completely dissappears just the moment the oppacity changes to zero and reappears as soon as it goes above.

The current hack just tries to change the “draw-opacity” of the blur-layer with the windows opacity. Sadly though, the dual-filter kawase blur does not allow for smooth scaling/interpolation between different blur levels.

PapyElGringo commented 5 years ago

Thanks for your quick answer!

To illustrate my mind I made 3 quick example:

1) Simple fade-out without blur https://stackblitz.com/edit/js-9jbtmi

2) Current miss behavior with blur https://stackblitz.com/edit/js-pkgbsm

3) Desired effect https://stackblitz.com/edit/js-s5ijlx

I hope it's more clear to understand Thanks for you help !

PapyElGringo commented 5 years ago

Did it helps? ^^

tryone144 commented 5 years ago

Yeah, the animations did help bring the desired behavior across, thanks. I'll try to fade the opacity of the blur-layer in a simmilar way then, since the strength of the blur itself can sadly not be smoothly changed.

But I'm currently a bit short on time, so it might take a while.

tryone144 commented 5 years ago

Hey,

I've added support for opacity changes of the blur-layer. Currently the blur is faded linearly between 20% and 0% opacity. When fading over the complete range, the blur effect is lost way too early. Furthermore, I experimented with changing the blur-level as well, but as mentioned before you get a jump between different levels.

I made a demo of both effects: https://imgur.com/a/nNjGzK6 The first one just shows the opacity change when fading out and in. The second one additionaly demonstrates the jump between blur-levels. This is done with blur-level=7 and background opacity of 70% in termite.

Is the fade-only effect close enough to your desired effect? I can push the changes to a different branch if you want to try them out.

frebib commented 5 years ago

I'd like to chime in and say that this is great! It's the functionality I used to have before switching to the dual kawase blur. To have this back would be fantastic

PapyElGringo commented 5 years ago

Hey nice work on this! Could you show us the fading over the complete range? Because in my opinion it's the way to do it. The blur effect should be hiding as fast as the client window.

tryone144 commented 5 years ago

Hey,

finally managed to get around making a demo of the fullrange opacity change: https://imgur.com/a/neNMa5W Blur opacity is now the same as the client window opacity.

I've also added a comparison to the limited fading when window opacity just changes from 100% to 20%.

tryone144 commented 5 years ago

If you want to try them out for yourself, I've pushed the hacky changes to their own branch https://github.com/tryone144/compton/tree/hack/opacity. You can compile these features in with the following flags:

Limited blur range (0-0.2)

$ make clean && CFLAGS="-DBLUR_RANGE=1" make

Limited blur range (0-0.2) + Adaptive blur level

$ make clean && CFLAGS="-DBLUR_HACK -DBLUR_RANGE=1" make

Full blur range (0-1.0)

$ make clean && CFLAGS="-DBLUR_RANGE=2" make

Full blur range (0-1.0) + Adaptive blur level

$ make clean && CFLAGS="-DBLUR_HACK -DBLUR_RANGE=2" make
vn-ki commented 5 years ago

@tryone144 My scrolling in chrome is very choppy when using the hack. Any ideas why?

tryone144 commented 5 years ago

@vn-ki Hmm, chrome is known to be problematic with compton... Does this only happen with this branch or also with the improved_fbo one? Which drivers are you using? Proprietary Nvidia drivers are also known to cause some strange problems.

vn-ki commented 5 years ago

It happens with all branches but more pronounced in hack. Full blur range (0-1.0) is almost equal to improved_fbo and dual_kawase branches. But Full blur + adaptive blur is very pronounced and annoying (Fading looks very nice though).

On a side note, yshui compton has no problems. Are you planning to take this upstream to yshui?

@tryone144

vn-ki commented 5 years ago

Also, I am using intel drivers

00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (Whiskey Lake) (prog-if 00 [VGA controller])                                                                          
        DeviceName: VGA                                                                                                                                                                     
        Subsystem: ASUSTeK Computer Inc. UHD Graphics 620 (Whiskey Lake)                                                                                                                    
        Flags: bus master, fast devsel, latency 0, IRQ 132                                                                                                                                  
        Memory at b2000000 (64-bit, non-prefetchable) [size=16M]                              
        Memory at 90000000 (64-bit, prefetchable) [size=256M]
        I/O ports at 4000 [size=64]                                                           
        [virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
        Capabilities: <access denied>          
        Kernel driver in use: i915
        Kernel modules: i915                   
tryone144 commented 5 years ago

On a side note, yshui compton has no problems. Are you planning to take this upstream to yshui?

Jep, see #9 :wink: The recent changes should make this easier to merge now.

vn-ki commented 5 years ago

@tryone144 There is a huge battery drain on this branch. Can you look into it?

I get like 8-10 hrs on original compton and about 3-4 on this branch.