Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disassociate Fade and Blur #2

Open
PapyElGringo opened this issue Jan 18, 2019 · 15 comments
Open

Disassociate Fade and Blur #2

PapyElGringo opened this issue Jan 18, 2019 · 15 comments
Assignees

Comments

@PapyElGringo
Copy link

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Author

Did it helps? ^^

@tryone144
Copy link
Owner

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 tryone144 self-assigned this Mar 16, 2019
@tryone144
Copy link
Owner

tryone144 commented Mar 16, 2019

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
Copy link

frebib commented Mar 17, 2019

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Owner

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
Copy link

vn-ki commented Jun 15, 2019

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

@tryone144
Copy link
Owner

@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
Copy link

vn-ki commented Jun 16, 2019

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
Copy link

vn-ki commented Jun 16, 2019

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
Copy link
Owner

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

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

@vn-ki
Copy link

vn-ki commented Jun 29, 2019

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants