Conversation
d8cbb46 to
79946f4
Compare
|
Uh, well, this is cool! Though, I stand by what I've said... somewhere I can't find apparently, guess it was in Matrix. For a complex operation like blur, I would like to first finish the Smithay Tracy GPU profiling integration, and then understand the underlying niri implementation very well (which amounts to a similar amount of work to trying to implement it myself). That is to say:
Still, a niri proof of concept is very appreciated, and especially the thousand of small things like adding the window rules and so on that hopefully shouldn't need much reviewing! |
|
I don't think it's worth working on this for now then but once you get back to this subject let me know if you need an extra pair of hands 😉 |
|
If you bumped into any unforeseen code or design constraints (as it goes), please do write so we can think about it! |
|
The only issue that I had (apart from not knowing rust) wast that we need access to the Output inside the Blur element so we can sample the correct one, and I didn't want change much code, so I did a trashy thingy just to get the last one that was added... But I guess it wouldn't be a problem to change whatever calls the render method to pass the output |
|
But I think the hard part is done, the OptimizedBlur could just be copy and pasted now, the rest is just organizing the code |
|
Hello! Thank you for trying to port this! I'd also like to wait for GPU profiling in smithay before calling this implementation good/optimized, we'll see soon. Other remarks I have to do are:
The sole reason why this unfinished product is in my compositor is because it was good enough for me, and mostly nobody use my comp anyway Regardless, good job! |
Curious about how you may implement that! Regardless, both impls need a lot of polishing |
|
Now that I'm a bit more familiar with how this works I've been thinking about a more "agnostic" strategy for the x-ray: setting pre-blurred image paths on the config and then just using them with |
|
That sounds like part of a general effect where you can replace backgrounds with a shader or other surface (think like place-within-backdrop reuses an existing surface). But a question is whether it can reasonably be exposed in the config. |
0863832 to
7b31f59
Compare
|
I'm still working on this to have this feature for myself while it's not implement in the best way and also to learn more about rust and wayland. I managed to improve and fix somethings from the todo list and found a new issue: the sample area gets displaced by the top layer, like when I have a waybar the blurred layer is off by the height of the bar... I couldn't find a way to get the value I should offset by, so for now I just added these values to the config so I can manually tweak them. I feel like this should be an obvious fix for people who know the project, if that's the case please let me know 😁 |
|
Ok, the TrueBlur position error had nothing to do with waybar but with opengl being bottom-left based instead of top-left, it's fixed now 🥳 and OptimizedBlur (x-ray) is also working |
4b859a0 to
c4e3916
Compare
|
So, I think this basically working now, both blur strategies and with scaling. I didn't manage to make with work it layers because I don't know if this even makes sense since the blur element is a rectangle 🤔 @YaLTeR fell free to close this PR if you like, I'll use this fork for myself and will try to keep up to date with the main repo/branch. |
|
I'm going to test it out personally - been missing blurry windows from hyprland for a hot minute haha. It'd be nice for the time being until either this gets merged or someone else implements it in the way @YaLTeR prefers and merges it into main. |
|
so just testing, haven't looked too closely at the code yet, but doing blur {
off
passes 3
radius 12.0
noise 0.0
}keeps the blur effect running. (not sure if it's supposed to reload once you save changes to config.kdl) |
|
I just tried this with an external 4k monitor and had bugs and perf issues 😭 this is not something I can fix myself, so if anybody wants to take over I'd be happy to help |
|
I was on a dual 4k display and had no perf issues on my end. I guess Smithay Tracy GPU profiling integration is supposed to help us debug. I also found out changing backgrounds does not update the blurred backdrop, just commenting for visibility. |
|
Currently the buffer only updates when the output changes, I imagine we need to trigger this in other places as well |
|
I think my perf issues are related to my hybrid nvidia gpu and this was never going to work on my machine, it does work flawlessly on my other laptop without this cursed gpu setup |
|
okay, thx for anwser |
|
@levpr1c if there aren't too many other changes for you, you can check out my fork (link in a previous comment). it has blur on layer shell, and I just recently implemented support for the KDE blur & background effect wayland protocols, so some apps can blur themselves now without requiring extra config. |
Can you submit a pr for it? If so I'd happily review it Blur is in no way contradictory to the goals of the niri project, it's just that we want to do it properly and aren't creating technical debt for ourselves in the process. So if you're confident in the quality of what you've made, please, give us the chance to look it over! See, the fun part is making blur work, the hard parts are: Profiling - we want/need a way to determine and troubleshoot issues with any introduced visual flair, our best lead on that presently is an outstanding PR on smithay to introduce tracy GPU profiling. At least, that's a start. Settings design - names of a setting should be self evident (i.e. there should be minimal possible ambiguity of the function of the setting when spotting it in the condig.kdl as a commented out default for the first time), they shouldn't clash, break or override existing settings, they should not introduce aditional considerations or challenges when updating the config with future settings. Testing - lots of it. This is where at least submitting a draft comes in real handy. If we can download and install it on as many machines as possible, that gives us the data to make better choices overall. So please, make a pr!!! |
|
@Naxdy I tried downloading and compiling your fork about a week ago, but the blur didn't work. Maybe I cloned the wrong branch or something. |
|
@levpr1c I've tried it quit a while ago and it didn't work, but after retrying it few days later, it now works for me, so maybe try it again. |
|
@yayuuu Did you compile the type and turn it on a few days later? Or did you compile it again? |
|
@alicealysia I'm not saying that blur doesn't align with niri's goals (that part is more referring to the other things I'm doing in my fork, like adding KDE protocol support), but I was going off of what @YaLTeR said in the initial comment:
If this has changed, I'll happily open a PR at least for optimized / x-ray blur, since that implementation is pretty much finished & optimized for GPU performance (I tested this by comparing GPU load with other blur-enabled compositors like KWin & Hyprland). However, I'd like to avoid opening a PR that'll sit for many months, since this means having to keep it up-to-date & resolve conflicts, even if a merge is unlikely in the near future. |
|
@levpr1c I've compiled it again few days later. Currently I use my personal fork that ports Naxdy's changes as well as changes from release and modifier only keybinds PR, removed scanout tranche flags that fix the performance on my PC and few more scrolling improvements that I vibe coded myself. |
|
@yayuuu нихуя себе, okay i wiil tried it agian, maybe i will use ur fork |
|
@yayuuu if i use another shell based on quickshell blur doesn't work, i downloaded the naxdy fork first and then yours, but when i downloaded the naxdy fork i didn't run dms Here are the screenshots of your fork |
|
Testing it now and will report any issues The blur isn't updating in maxed windows compared to smaller windows |
|
@visualglitch91 Thought you might want to see this. Also, anything you need help on currently? It looks like this is really close. Can we start a checklist of what still needs to be done before this is merged, or are we just not sure what all the bugs are yet? |
|
Please read above for the reasons why this hasn't been merged yet |
This is now completed and merged. |
|
@levpr1c the blur seems aligned with the wallpaper, it's the semi-transparent background on your terminal panels that looks off, i don't think this is related to the blur |
|
I'm using this version of Niri and it's very stable. |
|
@dotcubecn Yes. This is intended optimization, but I also would like a toggle to this behavior. In fact, in the early stages of this, there was no such optimization, so tiled windows would automatically update. This is useful because in order to update the x-ray - or optimized - blur (as they call it) after changing wallpapers, you would have to update the config. Or useful in your case, where you have a video background. I mean, why optimize the blur for battery life / less usage when you are running a whole video in the background, right? :) Also This is in hyprland too, just that the blur actually updates for the background properly, just not for other things like windows under the tiled windows (this can happen while moving windows), and shadows under the windows. In hyprland, floating windows do not have such restrictions forced onto them (I think you are able to turn on x-ray blur for floating windows) and behave like the floating windows in this implementation of blur. |
|
Closing this in favor of the work being done in https://github.com/niri-wm/niri/tree/wip/branch which is already so much better than what we had here! Thank you all folks for trying out my code during these months <3 |
Thanks for maintaining it! |
|
Anyway to track progress of WIP branch? Subscribed to this thread just to get notified |
|
You can watch the matrix or discord or YaLTeR's mastodon for when he posts updates |
|
Hey everyone, here's the official blur PR for testing: #3483 |





This PR ports the optimized blur implementation from https://github.com/nferhat/fht-compositor/tree/main/src/renderer/blur (kudos to @nferhat for the original implementation).
This is my first attempt at Rust and at Window Compositors, so be gentle 😋
This is more of a PoC than anything, I hacked away somethings that were missing in Niri and we can further develop if y'all want to move in this direction.
Preview
Screencast.From.2025-05-21.19-35-36.mp4
Todo
clipped surface shaderis failing to compile if we haven't changed itConclusion
If this is something you are intersted in I would love to continue working on it and also have help of more experienced people.
Thanks for this amazing project 😊