hyprwm / aquamarine

Aquamarine is a very light linux rendering backend library
BSD 3-Clause "New" or "Revised" License
278 stars 21 forks source link

Add support for CTM (color transformation matrix) #89

Closed sfiedler0 closed 1 month ago

sfiedler0 commented 1 month ago

I am currently working on Asahi Linux with Hyprland. Everything works perfectly, except for night light. After some research I found AsahiLinux/docs#67.
The mentioned gammastep issue had a comment pointing to an issue in wlroots. As Hyprland is independent now (and uses aquamarine which does the gamma LUT stuff), I thought it'd be a great idea to implement the CTM here too.

vaxerski commented 1 month ago

hm, the problem is that wl-sunset et al that control this on hyprland via the wlr gamma protocol can only provide a ramp, not a matrix. How would we control the amount of red-shifting?

sfiedler0 commented 1 month ago

I don't know exactly how KDE did it, but they have CTM support merged: https://invent.kde.org/plasma/kwin/-/merge_requests/3296

vaxerski commented 1 month ago

they dont have to support stuff like wl-sunset though (and they dont)

while we do

sfiedler0 commented 1 month ago

They seem to have updated some gamma control code too though. So it looks like they use the CTM through gammaControl if I interpreted the C++ code right (I like programming, but not in C++).

vaxerski commented 1 month ago

no, they didnt

sfiedler0 commented 1 month ago

So CTM control is ready for a new wlr protocol?

vaxerski commented 1 month ago

wlr makes no sense (we arent wlr anymore)

I'd either:

vaxerski commented 1 month ago

looking at drm support it seems that all drivers support CTMs. Well, all that matter. AMD, Nvidia, Intel.

vaxerski commented 1 month ago

I'll try to draft a protocol later today if I don't forget at hyprland-protocols. Ping me tomorrow if I don't

vaxerski commented 1 month ago

closing this as aquamarine is done. Hyprland see https://github.com/hyprwm/Hyprland/pull/8023, client see https://github.com/hyprwm/hyprsunset.

If you compile from 8023 you should be able to use hyprsunset no problem, tested on my machine, but lmk if it works on apple.

cheers

littleblack111 commented 1 month ago

they dont have to support stuff like wl-sunset though (and they dont)

while we do

updated and hyprsunset works, while wlsunset doesnt:

registry: adding output 51
gamma control of output DP-2 (51) failed
calculated sun trajectory: polar night
setting temperature to 4000 K
gamma control of output DP-2 (51) failed

is it going to be supported soon or is that unexpected

vaxerski commented 1 month ago

wlsunset only supports gamma ramps

tikhonp commented 2 weeks ago

Any way to adjust color temperature in SwayWM? Neither redshift nor wlsunset dont work :(

vaxerski commented 2 weeks ago

why are you asking this in a hyprland project? I have no idea. If you are using apple, likely not.