Bug 411352 - Improve performance of assisstant tools rendered on canvas.
Summary: Improve performance of assisstant tools rendered on canvas.
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tool/Assistants (show other bugs)
Version: 4.2.5
Platform: Microsoft Windows Microsoft Windows
: NOR wishlist
Target Milestone: ---
Assignee: Nabil Maghfur usman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-27 14:31 UTC by lempikq
Modified: 2021-10-03 17:02 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
krita-bug-log (11.98 KB, text/plain)
2019-09-25 12:45 UTC, lempikq
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lempikq 2019-08-27 14:31:31 UTC
SUMMARY
Assisstants have poor performance on canvas actions (panning, rotation, zooming in/out). The more you zoom in the worse it becomes, aprticularly perspective and vanishing point make rendering basically freeze at some zoom levels.

I don't have a particularly low spec machine either but it feels like it might not be GPU accelerated or something?

STEPS TO REPRODUCE
1. Put a vanishing point with low angle on the canvas
2. Zoom in and perhaps even pan around (keep the assi. tool on screen the whole time) the canvas. It's jerky and at soem point it almost stops if you have enough lines/curves from the tool on screen.

Just a tiny little addition to the wishlist :-).
Comment 1 vanyossi 2019-09-25 03:34:44 UTC
I don't get any slowdown following the steps provided or even after adding more than 10 vanishing points and panning at different zooming levels.

Could you paste the text from "help > system information for bug reports"? Also check that you are not using OpenGL directly for display canvas acceleration but ANGLE.
Comment 2 lempikq 2019-09-25 12:45:36 UTC
Created attachment 122862 [details]
krita-bug-log
Comment 3 lempikq 2019-09-25 12:51:36 UTC
(In reply to vanyossi from comment #1)
> I don't get any slowdown following the steps provided or even after adding
> more than 10 vanishing points and panning at different zooming levels.
> 
> Could you paste the text from "help > system information for bug reports"?
> Also check that you are not using OpenGL directly for display canvas
> acceleration but ANGLE.

The file is above, I thought the comment text will stay, so I'll jsut make one more reply here.

Vanishing point is currently certainly the least laggy one it's still slower but not that noticeable can you please try the perspective? When I have perspective in and zoom to 100% or clsoer to 140% it basically takes half a second or asecon to make one pan or zoom level difference (which obviously stacks as you are trying to pan large distance).

As said above the report file is above in the comment - sorryy about that.

I do have nalge not opengl, opengl makes everything worst if I try it so I dont' use it anyway.

Not sure what changed from the time of the bug report, I'm on enwer version of Krita but even if I download 4.2.5 portable the vanishing point is still a bit slower but not even close to the perspective.

Just to be sure I make a 2000x3000 new file with a background flat colored layer, I just put in a perspective and try to zoom in on the perspctive (make sure it's in the viewport the whole time) from 40% to 100%, then a bit further to 140% and evne at 100% it's lagging like hell, it basically turn to a slideshow rather than a smooth zoom/pan.
Comment 4 lempikq 2019-09-25 12:52:09 UTC
One more, there was someone on reddit saying the same so it's probably not just me.
Comment 5 Lynx3d 2019-09-25 15:10:09 UTC
I definitely still get unpleasant choppiness too when panning on a zoomed in document with some perspective assistants.
It's not quite as bad as 1 second lags for me (Linux, nVidia proprietary OpenGL drivers), but the canvas lags quite a bit compared to the smooth movement when assistants are turned off.
Comment 6 vanyossi 2019-09-25 16:57:06 UTC
Thanks! I can now reproduce this bug.

1. Create a document 300 x 300 is fine.
2. add a perspective assitant.
3. Zoom in keeing the perspective assistant always visible.
Comment 7 Bug Janitor Service 2021-09-22 00:30:30 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1064
Comment 8 Tiar 2021-10-03 13:23:43 UTC
Git commit 00f86a7e5540464a9c4e3a6c5a0300e41edb43f6 by Agata Cacko.
Committed on 03/10/2021 at 13:22.
Pushed by tymond into branch 'master'.

Move Perspective assistant drawing to drawAssistant from drawCache

Before this commit, the grid of the Perspective Assistant was drawn
in the drawCache, which caused performance issues when using
the perspective assistant and zooming in a lot.
(test method: zoom in a lot, so it's around 1600%, and then zoom in
and out very quickly using your mouse wheel. It's instant with this
patch, but slow without the patch. Note that if the Configure Krita ->
Display -> Canvas Acceleration is off, it's still super slow).

This commit does two things:
- crops the drawn lines to the viewport
- moves the whole drawing action to drawAssistant
Note: just cropping the drawn lines, but still using the cache,
didn't improve the assistants performance that much.
There must be some inherent issue with this caching method.

M  +42   -32   plugins/assistants/Assistants/PerspectiveAssistant.cc

https://invent.kde.org/graphics/krita/commit/00f86a7e5540464a9c4e3a6c5a0300e41edb43f6
Comment 9 Tiar 2021-10-03 17:02:55 UTC
Git commit 0cd2ea87b0719cb8a496fd0a96de2434a909ae10 by Agata Cacko.
Committed on 03/10/2021 at 16:27.
Pushed by tymond into branch 'krita/5.0'.

Move Perspective assistant drawing to drawAssistant from drawCache

Before this commit, the grid of the Perspective Assistant was drawn
in the drawCache, which caused performance issues when using
the perspective assistant and zooming in a lot.
(test method: zoom in a lot, so it's around 1600%, and then zoom in
and out very quickly using your mouse wheel. It's instant with this
patch, but slow without the patch. Note that if the Configure Krita ->
Display -> Canvas Acceleration is off, it's still super slow).

This commit does two things:
- crops the drawn lines to the viewport
- moves the whole drawing action to drawAssistant
Note: just cropping the drawn lines, but still using the cache,
didn't improve the assistants performance that much.
There must be some inherent issue with this caching method.

M  +42   -32   plugins/assistants/Assistants/PerspectiveAssistant.cc

https://invent.kde.org/graphics/krita/commit/0cd2ea87b0719cb8a496fd0a96de2434a909ae10