-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
The editor is less responsive when set to "update only changes" #11030
Comments
Yeah, I've noticed this too. Setting the editor to "Update Changes" causes the framerate in the 3D viewport to drop from a solid 60fps to what feels like 30fps. Quickly scrolling through a script also shows some jerkiness with this setting. I don't think it's subtle at all, this is definitely something that should be ironed out. Tested on master 5f0d367, Linux Mint 18.2 Cinnamon x64, running on an NVIDIA Geforce 980 Ti with NVIDIA's drivers (version 375.66) |
I can reproduce this as well (on Intel and NVIDIA graphics). |
@Zylann It might also just be that it is only noticeable with really good hardware which can draw the editor at 60+fps. |
@toger5 my hardware is a "gaming" laptop with an very average graphics card^^ (nVidia 940M) |
The same for me. Using a ThinkPad X230, i7-3520M, Intel HD 4000, Ubuntu 16.04.3 LTS, so it might not depend on the Hardware |
@reduz I tested the fix: However the problem still exists when starting actions (as in, not constantly feeding input, which is 90% of all actions in editor). Things still have difficulty to "kick in", still mostly noticed by scrolling the script editor, or beginning a pan, scroll or drag. (compared to "update always") New videos taken, hopefully the difference is visible: |
This is likely a bug in the text editor scrolling that should be fixed
…On Fri, Nov 17, 2017 at 10:21 PM, Marc ***@***.***> wrote:
I tested the fix:
It feels better, however still not as good as "update always". Things
still have a bit of difficulty to "kick in" (for example scrolling the
script editor) while it reacts faster and smoothly with "update always".
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#11030 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AF-Z26CfGwQ0wKv2BxbS9bJlJ38nShyfks5s3jEqgaJpZM4PPH7k>
.
|
No, it is not. It's everywhere, I recorded three videos to show it :( |
What about attempting ca19403 again, but with an higher sleep time like |
@Calinou I tested with 8000 and it doesn't solve it. In fact, I wonder why this sleep time would be the problem, to me I would intuitively look for here https://github.com/godotengine/godot/blob/master/main/main.cpp#L1716 |
I've profiled this section to see how long it takes:
I waited. Then I started dragging stuff (here the EditorSettings window), without stopping. Then I stopped dragging and immediately paused the process to look at my prints. Here is the result: |
Tested on another computer with beta 1 (powerful desktop one, GeForce GTX 750 Ti/PCIe/SSE2), and I can still feel the difference between two modes, and the kick-in lag is present too (please read my post above to see where it really comes from). I took yet another video, with a GIProbe so it slowed down FPS there the difference is even more noticeable. In that video I saw that my mouse wasn't captured at the same rate I saw it though (it lags at the same "rate" as Godot in the video, even though I saw it moving independently smooth): However... I noticed that if OBS is open and running on the same graphics card, this kick-in doesn't happen Oo Does it means this not-so-good responsivity is a driver issue that we cannot fix? |
Now that I tested this on Windows and Linux, I can say that I'm fine with the current editor responsiveness; it's much better than it was a few months ago. 😃 I can't notice much difference between Update Changes and Update Always now (if at all). |
@Calinou it still responds awfully on my laptop, and it worsens if the scene is busy or has a GIProbe. I guess high-end graphics card dont have this issue as much as I have... |
Not critical for the upcoming 3.0 release, so moving to the next milestone. A fix can still be cherry-picked for 3.0.x maintenance releases once available in the master branch. |
I wanted to edit the first post but the Edit menu broke even if I restart Firefox, so: I wrote a TL;DR to sum up what is the root problem, and it looks like even Blender has been aware since 2016, at least for nVidia: https://developer.blender.org/T49758 |
Is this also the case for vulkan? if not we could wait until Vulcan is the default. (Donno how different the driver is when using gles3 vs vulkan) |
@toger5 there is only one way to find out... :D |
Some related ideas on this (aside from the driver problem, which may be difficult to fix Godot side), which may or may not be relevant (I have very little knowledge on how Godot currently does this, especially in terms of threads for editor and 3d / 2d window): Using sleep in the main thread to limit FPS in the editor seems like it could be problematic. If the editor is running at e.g. 10fps, then (depending on how it works with the OS) you could be artificially putting a variable lag on your input, AND potentially limiting the continuous response time as you e.g. move around a mouse on a scrollbar. I don't know whether input overrides a sleep, I suspect not. An alternative (at least for running the IDE in low processor mode at low frame rates) is to use OS timers. These are often very unreliable in terms of accuracy, however they have the advantage that they won't introduce any lag to input, so you can have low processor, but the moment you decide to e.g. rotate the 3d view, you get instant reponse again, best of both worlds. Another idea is to set a 'last input time' every time you get input (keyboard mouse), and prevent doing any sleeping until there hasn't been any input for say, half a second. This would at least potentially make things like scrolling more responsive. The other trick with heavy 3d / 2d scenes is to render them to a texture that is cached, and when changing UI items you don't always do a full render of the 3d / 2d window, so that UI responsiveness isn't linked to how heavy the scene is. (You can also do this vice versa.) |
I have the same problem I think (win10, 144Hz display, GTX 2070 Super). While focused the editor (and the open project window) both have a mouse framerate lag, as if switching to a lower framerate monitor. If I unfocus the editor (click on another window) the mouse visuals return to normal. For me enabling "update continuously" made the editor put GPU in 80-90% load while unfocused, but while focused started working as normal with no mouse visuals problems and at lowload (5-15% load). Enabling "V-sync" in project settings as well as "update continuously" in the editor settings, makes it stutter free while focused and low load while onfocused. This does not include the open project window that still suffers the problem (probably since the settings are not loaded yet?). This has solved it for me, but again I have a powerful computer enough for the continous updates, so it doesn't feel like this is how it should be. Also it feels as if the editor should be more limited when unfocused as opposed to focused. I talked to @Calinou in discord and tried the build in #36052 but the results were identical (not working, at least for me), except V-sync wasn't working yet. |
Projects don't use the low processor mode by default unless you enable it in the Project Settings. |
What's the state of this in 4.0 with Vulkan? It seems latest master just continuously updates even when set not to but wasn't sure if that's intended or if I did something wrong. Also, is @Calinou PR still going in for 3.2 and did it end up helping? |
This is definitely not intended; low-processor mode hasn't been reimplemented yet in the
It hasn't been merged yet, but it's still cherry-pickable into the |
I'm interested in this issue for my own app which is using low processor mode not specifically the editor. What I don't quite understand is why is it that setting the low cpu more usec to 0 then yields high framerate when I have vsync enabled. Basically what I'm trying to achieve isn't so much the CPU reduction from the sleep but primarily the reduction to be gained from the RenderingServer check which only renders when there are changes. Is it possible to achieve that? Or is the issue precisely because we're not rendering then vsync isn't being applied? It seems if that's the case potentially having a way to still use the renderingserver to apply backpressure rather than the artificial sleep would make things fairly seamless but I am way out of my depth here. |
Yes, that can be done by setting the low-processor mode sleep duration to a very low duration like you did.
V-Sync should still be applied when you enable low-processor mode. Godot enables V-Sync by default, and many graphics drivers enforce it (with no way for applications to disable it). This is often the case on mobile/web platforms. |
Doesn't this mean Godot will then never sleep and consume max CPU instead? |
That is indeed what I'm seeing. If v-sync was still applied then I wouldn't see my app running at 144fps when using the same settings as the editor (or even hitting as high as 500fps when going w/ a very low sleep) but instead I should see only 60fps since that's what my monitor supports. If vsync should still be the upper bound (meaning if sleep is 0 I should only see 60fps) then something is wrong there. When I don't use low cpu mode then I do see the app running at 60fps so vsync does seem to work fine. BTW I don't know how bad the responsiveness is for you @Zylann when using low cpu mode vs continous update. I can't say it's absolutely horrible but I'd describe it as going from something that feels like 60fps down to something that feels like 20ish fps. I'm going to test out @Calinou change maybe tonight and report whether I notice an improvement. |
This is pretty much what my PR should fix. It replaces the low processor mode's fixed delay for a delay that varies depending on the time spent in the last frame (like Force Fps in the Project Settings). |
@Calinou It's night and day difference for me! My use case is a tree with a lot of visible nodes. The latest 3.2.2 beta during scrolling gets ~30fps on a high end desktop whereas your change never drops below 70fps. It's seems my frame is not ast enough to maintain 144fps but that's ok, at least your change has the dynamic component which still then does its best to maintain as high FPS as it can whereas current behavior just adds the fixed delay and makes things even worse. No way we can get this merged for 3.2.2? Seems like a fairly straight forward change that primarily affects the editor. |
@giulianob I don't know if Akien plans to release a fifth beta for 3.2.2, so it may be too late. Anyway, I asked on the PR. |
The Low Processor Usage Mode Sleep Usec setting is now used as a FPS limiter rather than a constant sleep duration. This will increase CPU/GPU usage slightly due to the higher effective FPS, but the increase in overall smoothness is worth it. If both Force Fps and Low Processor Usage Mode settings are enabled in the project settings, only the setting that causes the highest sleep duration will be retained. This closes godotengine#11030.
The Low Processor Usage Mode Sleep Usec setting is now used as a FPS limiter rather than a constant sleep duration. This will increase CPU/GPU usage slightly due to the higher effective FPS, but the increase in overall smoothness is worth it. If both Force Fps and Low Processor Usage Mode settings are enabled in the project settings, only the setting that causes the highest sleep duration will be retained. This closes #11030. (cherry picked from commit 1c28b26)
The Low Processor Usage Mode Sleep Usec setting is now used as a FPS limiter rather than a constant sleep duration. This will increase CPU/GPU usage slightly due to the higher effective FPS, but the increase in overall smoothness is worth it. If both Force Fps and Low Processor Usage Mode settings are enabled in the project settings, only the setting that causes the highest sleep duration will be retained. This closes godotengine#11030. (cherry picked from commit 1c28b26)
Godot 3.0 master, also 2.1.3
Windows 10 64 bits
I don't know wether this is fixable or not, but on Windows I always noticed a better response time / better framerate when "update always" was checked on top-right. To the point I always checked it when taking videos, because the experience is smooth and reactive. Now I see the option is going to be deprecated and default to "update changes", which finally convinced me to open this issue for the record.
I noticed this in many situations, for example scrolling the script editor, and took a video of it to show the difference: #10489 (comment)
@toger5 didn't experience this on Mac, so it might be OS-specific.I just tried to record a video of it in the 3D viewport but I was unable to make the difference stand out much with OBS, because on my laptop it slows down FPS just enough, which is frustrating...
I retried with tweaked settings: http://zylannprods.fr/dl/godot/subtle_framerate_difference.mp4
(but the most measurable example is the script editor).
It feels like the editor reacts and redraws at 30..40 fps / drops frames, instead of 60 when I set "update changes", which is fairly noticeable and impacts usage experience in a global way.
Edit: the difference is also easily seen when resizing docks or using freelook.
TL;DR:
The editor lags if not redrawn after a few seconds because the driver puts the graphics card in low-performance mode, and it's by default. It is very slow at waking back up, causing lag, and ruins editing experience.
It happens only on Windows with nVidia drivers, and AMD appears to have this too, with OpenGL 3. This gets much worse if the scene is complex.
See the measured framerate showing the lag here #11030 (comment)
And explanation for nVidia: #11030 (comment)
This does not happen (or not as badly) with Godot 2 (OpenGL 2), and I also noticed the exact same issue in Blender 2.8 beta, while reactivity in 2.79 felt much better. (although a bug existed since 2016 https://developer.blender.org/T49758)
A workaround is to change the driver settings to put the application in maximum performance mode, or to run a 60fps application side-by-side. This might however heat your computer much more.
I hope drivers get fixed in the future (it's been years now), or that Vulkan drivers will work better...
The text was updated successfully, but these errors were encountered: