Bug 488840 - Glide effect is distorted
Summary: Glide effect is distorted
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-various (show other bugs)
Version: 6.1.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2024-06-20 22:25 UTC by Hesam Gholami
Modified: 2024-06-22 00:29 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.1.1


Attachments
Preview of Glide distortion (1.36 MB, video/webm)
2024-06-20 22:25 UTC, Hesam Gholami
Details
Glide effect working correctly on Plasma 6.0.4 (627.97 KB, video/webm)
2024-06-21 02:21 UTC, Hesam Gholami
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hesam Gholami 2024-06-20 22:25:03 UTC
Created attachment 170712 [details]
Preview of Glide distortion

SUMMARY

After upgrading to Plasma 6.1.0, the Glide effect is now distorted in bottom center section. Sorry if the video is laggy, I think this is also another bug in new version of Spectacle video recorder with NVIDIA gpu.

STEPS TO REPRODUCE
1. Open up Desktop Effects
2. Choose Glide settings
3. Increase duration, angle and distance
4. Save and apply
5. Open up any application
6. Look at the bottom center of windows

OBSERVED RESULT

Windows are distorted while opening/closing like the attached video.

EXPECTED RESULT

No distortion on open/close animation

SOFTWARE/OS VERSIONS

Operating System: Arch Linux 
KDE Plasma Version: 6.1.0
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1
Kernel Version: 6.9.5-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 20 × Intel® Core™ i9-10900 CPU @ 2.80GHz
Memory: 62.6 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1650/PCIe/SSE2
Manufacturer: ASUS

ADDITIONAL INFORMATION

N/A
Comment 1 Nate Graham 2024-06-20 23:20:07 UTC
It looks like you've changed the settings of this effect. Does the issue go away if you restore them to their default values?
Comment 2 Hesam Gholami 2024-06-21 02:14:22 UTC
(In reply to Nate Graham from comment #1)
> It looks like you've changed the settings of this effect. Does the issue go
> away if you restore them to their default values?

No. If I restore default settings, the issue will remain the same. But because it happens fast, it's hard to see. So I've changed settings to demonstrate the issue better.
Comment 3 Hesam Gholami 2024-06-21 02:21:30 UTC
Created attachment 170717 [details]
Glide effect working correctly on Plasma 6.0.4

This preview is for KDE Plasma 6.0.4 where the Glide effect works correctly without any distortion at bottom center section
Comment 4 Hesam Gholami 2024-06-21 02:23:45 UTC
I've added a new attachment in which you can see the same effect with the same settings works correctly (without any distortion at bottom center) in KDE Plasma 6.0.4
Comment 5 Bug Janitor Service 2024-06-21 06:50:16 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5956
Comment 6 Vlad Zahorodnii 2024-06-21 12:59:58 UTC
Git commit 7eb9f75af22c4aeeb58e864772912ec060f79826 by Vlad Zahorodnii.
Committed on 21/06/2024 at 12:46.
Pushed by vladz into branch 'master'.

plugins/glide: Subdivide window quad grid

The way the glide effect works is that it takes 2D geometry and applies
the perspective projection to it on the CPU side. The reason we do it is
that the scene is 2D.

However, this leaves us with the well known problem where a texture
that's mapped to a trapezoid won't be correctly interpolated along the
diagonal.

It can addressed by performing a perspective division in the fragment
shader, but given the way the effect is structured, it's off the table. So
instead subdivide the window grid.

M  +1    -0    src/plugins/glide/glide.cpp

https://invent.kde.org/plasma/kwin/-/commit/7eb9f75af22c4aeeb58e864772912ec060f79826
Comment 7 Vlad Zahorodnii 2024-06-21 13:15:26 UTC
Git commit 24c9ed3bde8a7830e43a2527d05e9099e5e138bd by Vlad Zahorodnii.
Committed on 21/06/2024 at 13:05.
Pushed by vladz into branch 'Plasma/6.1'.

plugins/glide: Subdivide window quad grid

The way the glide effect works is that it takes 2D geometry and applies
the perspective projection to it on the CPU side. The reason we do it is
that the scene is 2D.

However, this leaves us with the well known problem where a texture
that's mapped to a trapezoid won't be correctly interpolated along the
diagonal.

It can addressed by performing a perspective division in the fragment
shader, but given the way the effect is structured, it's off the table. So
instead subdivide the window grid.


(cherry picked from commit 7eb9f75af22c4aeeb58e864772912ec060f79826)

Co-authored-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>

M  +1    -0    src/plugins/glide/glide.cpp

https://invent.kde.org/plasma/kwin/-/commit/24c9ed3bde8a7830e43a2527d05e9099e5e138bd