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

Blend mode that increases saturation under areas of low value #946

Open
danirabbit opened this issue Oct 25, 2020 · 4 comments
Open

Blend mode that increases saturation under areas of low value #946

danirabbit opened this issue Oct 25, 2020 · 4 comments
Labels
Needs Design Waiting for input from the UX team Priority: Wishlist An enhancement or new feature Status: Blocked Something else needs to be done before this can be fixed

Comments

@danirabbit
Copy link
Member

Problem

Currently shadows overlay black. This only affects value but does not affect saturation as shadows in real life would:

screen2

Proposal

It would be pretty sweet if we could increase saturation under shadows so that they would be tinted with the color of what's beneath them and look more true to life:

screen1

@danirabbit danirabbit added Priority: Wishlist An enhancement or new feature Needs Design Waiting for input from the UX team labels Oct 25, 2020
@danirabbit danirabbit changed the title shader that increases contrast under areas of low value shader that increases saturation under areas of low value Oct 25, 2020
@jassmith
Copy link

I made you a dumb example doing this with 2 shadows and simple blending modes in CSS. Not sure you really need a custom shader. Its definitely not flawless but it might be a simple place to start.

https://codepen.io/jassmith87/pen/ExyWgav

@donadigo
Copy link
Contributor

I don't think this is a feasible thing to do in gala at least partially. Shadows in Gtk3 are being drawn by the client itself, not the WM.
If we were to do it just here in gala we would need to:

  1. Render the window to some offscreen framebuffer first.
  2. Either:
  • Render our own shadow first. Then render just the window area of the offscreen buffer to the screen (if rectangular it would leave artrifacts on windows with rounded edges).
  • Apply & composite a shader to the buffer with a mask, which still has the same issue with rounded corners, unless we specifically make the assumption that the rounded corners are always present in all windows.

Both methods assume a lot about how a window looks like but this cannot be fixed either in mutter, because of the chosen architecture by Gtk.

@danirabbit danirabbit changed the title shader that increases saturation under areas of low value Blend mode that increases saturation under areas of low value Oct 26, 2020
@hanaral
Copy link

hanaral commented Oct 26, 2020

I don't think this is a feasible thing to do in gala at least partially. Shadows in Gtk3 are being drawn by the client itself, not the WM.
If we were to do it just here in gala we would need to:

1. Render the window to some offscreen framebuffer first.

2. Either:


* Render our own shadow first. Then render just the window area of the offscreen buffer to the screen (if rectangular it would leave artrifacts on windows with rounded edges).

* Apply & composite a shader to the buffer with a mask, which still has the same issue with rounded corners, unless we specifically make the assumption that the rounded corners are always present in all windows.

Both methods assume a lot about how a window looks like but this cannot be fixed either in mutter, because of the chosen architecture by Gtk.

I thought Gala used it's own shadows anyway, hence the odd incompatabilites of the stylesheet with other WMs. (I haven't tried it with the new stylesheet though)

@cassidyjames
Copy link
Contributor

I thought Gala used it's own shadows anyway

No, shadows are client-side in the GTK stylesheet, and rendered by GTK.

@lenemter lenemter added the Status: Blocked Something else needs to be done before this can be fixed label Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Design Waiting for input from the UX team Priority: Wishlist An enhancement or new feature Status: Blocked Something else needs to be done before this can be fixed
Projects
None yet
Development

No branches or pull requests

6 participants