scenefx
scenefx copied to clipboard
Blur strength
Adds support for blur strength.
https://github.com/user-attachments/assets/2038bd47-2504-49b5-af66-66b626997010
Here's what it looks like with just regular alpha:
Tested with SwayFX main branch using:
for_window [app_id="kitty" title="opacity test"] floating enable; resize set 800 400
exec kitty -T "opacity test" -o "background_opacity 0.0" -e $SHELL -c './opacity_script.sh; read'
script to run in nested kitty:
set_opacity() {
opacity=$(perl -e "print ((100 - $i) / 100)")
swaymsg "[app_id=\"kitty\" title=\"opacity test\"] opacity $opacity"
echo "Opacity: $opacity"
sleep 0.1
}
while true; do
for ((i = 0; i < 100; i++)); do
set_opacity "$i"
done
for ((i = 100; i >= 0; i--)); do
set_opacity "$i"
done
done
Tested in SwayFX:
- [x] Floating toplevels (non-optimized blur)
- [x] Tiled toplevels and “x-ray” floating toplevels (optimized blur)
- [x] Scene rect color alpha adjusts blur alpha
Updated the desc with a video of the implementation. There are some minor artifacts in the top right section of the window blur, where there are thin lines. This is due to the lowering of the num_passes and doubling of the blur radius (which displays more artifacts).
Not sure if there's anything that can be done here, except maybe mixing a max opacity blur with the lower opacity blur? Or maybe mixing the higher num_passes version with the lower one?
Updated the desc with a video of the implementation. There are some minor artifacts in the top right section of the window blur, where there are thin lines. This is due to the lowering of the num_passes and doubling of the blur radius (which displays more artifacts).
Not sure if there's anything that can be done here, except maybe mixing a max opacity blur with the lower opacity blur? Or maybe mixing the higher
num_passesversion with the lower one?
Is this still present? I didn't notice it from the video
Updated the desc with a video of the implementation. There are some minor artifacts in the top right section of the window blur, where there are thin lines. This is due to the lowering of the num_passes and doubling of the blur radius (which displays more artifacts). Not sure if there's anything that can be done here, except maybe mixing a max opacity blur with the lower opacity blur? Or maybe mixing the higher
num_passesversion with the lower one?Is this still present? I didn't notice it from the video
Not anymore! :D
Converting to draft again, we should wait with this until it can be tested with SwayFX animations
I added blur_strength and blur_alpha for finer tuning. Makes it easier for SwayFX to decide if it wants alpha or strength adjustments when fading in/out :D
I'm off topic but - is that an inset border? Looks lovely, is it a SwayFX thing?
Getting back to this, hoping to merge it soon. Can you remind me why we add a optimized_no_blur_buffer? not sure I follow why it's needed - did this fix a bug?
Getting back to this, hoping to merge it soon. Can you remind me why we add a
optimized_no_blur_buffer? not sure I follow why it's needed - did this fix a bug?
It's for the edge case for blurring with optimizations (xray enabled) while setting a lower alpha.
When we adjust the alpha, we instead adjust/lower the blur strength for that scene_node, so we can't use the already blurred background in the optimized_blur framebuffer
