-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Path3D has editor performance issues when points are added over a long distance #81707
Comments
Can you try with a recent version of 4.2? Your build is about two months old |
Sorry, I should have mentioned I've also tried it with a build from master that I built today |
Can you reproduce this in 4.1.1? I wonder if this is a regression from #80329. |
Yep, still happens in 4.1.1, and it even happens all the way back in the first stable release of 4.0 as well I've just tried it in 3.3 (which is what I was using before moving to 4.x) and I can keep adding points while fully zoomed out and there's no drop in performance at all |
Can you reproduce this in 3.5.2? If not, can you test 4.0 alphas and betas? This would help pinpoint the regression more accurately, as there are a lot of commits to cover before we should start bisecting. |
Okay, I've just gone through some of the betas and I've found that it started with Beta 8, everything before that (including 3.5.2) is fine |
@sketchyfun Seems working on my computer. Could you provide a minimal reproduction project? I'd like to investigate if it is somehow caused by my curve baking code refactor. |
I didn't add a minimal project because part of the issue appears when actually adding the points, after several points have been added, it starts to get slower and slower to add new points. If I made a project, it would just be a path with some points already added, there's really nothing else to it. Maybe it's system specific, but I'm not sure why that would be.. |
I can confirm that happens in the master version, i also bisected between beta 7 and beta 9 and this started to happen after #68860 I did some test and what i found was:
I compiled both master and #68860 with scons default options My specs: Demonstrating the bug in master: https://www.youtube.com/watch?v=YouQkKOZaWY |
Edit: Although the fish bones are contributing to the issue, I've found it's not the entire reason for the performance issues. I think the bigger problem is simply how subdivided the path is when it's drawn, especially since the same number of points used to draw the line are used to generate the collision segments (so the path can be clicked on). I've done a bit of testing, and it's definitely the fish bones that are slowing it down. The issue is that there's just too many of them being drawn unnecessarily. You only have to be zoomed out slightly and they're barely visible, and yet with two points only 4 units apart, there's 50 fish bones being drawn. I checked how many were drawn when I was fully zoomed out (thus adding points large distances apart) and after I'd added around 45 points, there were almost 150,000 fish bones being drawn. I think the code needs to be changed so that the amount of fish bones drawn takes the zoom level into account or the on-screen distance between each point, so that there isn't an excessive amount of them drawn. I'll look into this myself, but I can't promise anything. |
Further investigate this problem a bit, find something interesting. I reported in previous comment that I cannot reproduce this problem . It turns out that's because I was rotating the camera with the "ball gizmo" at the upper-right corner of the viewport. If I rotate with middle mouse button, then there is the stutter. So my hypothesis is that the stutter is not related with drawing at all, but with the mouse event handling, which somehow trigger the collision detection code path. Then I checked the code of So I think the solution should be optimizing the collision detection code. For example, substitute |
@xiongyaohua This reminds me, someone else recently reported a stutter with mouse camera rotating.... |
There's #80941 but it's caused by an unrelated Vulkan issue (#84137). There is also #52378 but it's not related to this issue either. |
I'm not getting any stutters myself when rotating the camera, but dragging points over large distances is awfully laggy. Adding points over long distances can also cause hitches. Definitely related to how long the spline is in world-space. |
Setting the interval value higher here helps to alleviate the issue, but only temporarily. You'll end up hitting a threshold where it starts to chug. The simplest solution is probably to match Blender's functionality. A resolution value that defines a fixed number of intervals between two spline points. godot/editor/plugins/path_3d_editor_plugin.cpp Lines 291 to 355 in e5b4ef8
|
Godot version
v4.2.dev.custom_build [da81ca6]
System information
Godot v4.2.dev (da81ca6) - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 (NVIDIA; 31.0.15.3699) - AMD Ryzen 5 2600 Six-Core Processor (12 Threads)
Issue description
I noticed that when I loaded up one of my game's levels that uses a long Path3D, the editor was slow to respond when I initially selected the Path3D node, and then when I was panning around with the camera, there were intermittent hiccups in the performance and the editor would freeze for a second.
If you create a Path3D with a bunch of points while zoomed right in, the performance is okay, but if you zoom all the way out and start adding points, it takes longer and longer to process as you add each new point. I also found that after I'd added the points, if I panned the camera around I'd get random stutters/freezes like something is being re-calculated as the view changes.
Steps to reproduce
Create a Path3D node
Zoom all the way out and start adding a bunch of points
Notice the editor become less responsive as more points are added (not that many are needed to cause this, maybe 15 or so)
With the Path3D node still selected, pan the camera around continuously and you may notice some stutters (how long it takes to happen for me is a bit inconsistent, but usually after a few seconds it starts happening)
Minimal reproduction project
I don't think a minimal reproduction project is really needed
The text was updated successfully, but these errors were encountered: