Godot: Periodic stalls when drawing meshes in GLES3

Created on 25 Apr 2020  路  10Comments  路  Source: godotengine/godot

Godot version:
Version 3.2.1. This bug also appears in Version 3.2.2 beta 1, and in Version 3.1.

OS/device including version:
Windows 10.
Graphics card GeForce GTX 760/PCIe/SSE2.

Issue description:
If you play a scene in the editor that involves a 3D scene and a mesh, there are periodic spikes in the frame time of a few seconds.
This occurs if GLES3 is the renderer - GLES2 does not have this problem. Also, this only applies to scenes runs in the editor - exported standalone projects do not have this problem, so I don't think this is an issue with graphics drivers.

Steps to reproduce:
-Create a new project, set the renderer to GLES3.
-Create a scene with a Spatial as the root, add a Camera, and add a MeshInstance with a cube Mesh for the camera to look at.
-Play the scene in the editor. You can observe the problem either in the Profiler, or dragging the game window around and watching it hiccup.
-Set the cube to be invisible and play the scene again. The periodic stalls should be gone.

bug rendering

Most helpful comment

This could be due to the remote scene view. If you change it to local while the game is running it wont do that. You can have it default to off by going to the editor settings->export->debugger->auto switch to remote scene tree and un-checking it.

With remote view enabled:

Profile_Remote

With remote view disabled:
Profile Local

All 10 comments

I think this has something to do with the debugger. I believe there is a setting you can change that will fix the issue. I know this has been discussed before, so if you search around open issue you should be able to find something. I'll look later too when I have a moment.

I noticed that if you play a scene, and then minimize the editor, the hiccups disappear. The hiccups are dependent on whether the editor window is visible or not.

This could be due to the remote scene view. If you change it to local while the game is running it wont do that. You can have it default to off by going to the editor settings->export->debugger->auto switch to remote scene tree and un-checking it.

With remote view enabled:

Profile_Remote

With remote view disabled:
Profile Local

To complete @NHodgesVFX's suggestion, make sure to uncheck Debugger > Auto Switch To Remote Scene Tree in the Editor Settings.

The "Auto Switch To Remote Scene Tree" was already unchecked, and either checking it or not checking it had no effect on the problem.

I'd like to show that the hiccups are actually quite dramatic:
spikes

I updated my NVIDIA drivers, but the problem continued.

Finally, I checked the Task Manager, and there's a lot of GPU activity in the 'Copy' section. I'm not sure what Copy means, but it seems to be the source of the hiccups.
gpu_copy

If it's not remote scene tree AND GLES3 only, then it means it's shaders compiling (and therefore a duplicate of an already reported issue)

@Zireael07 For reference, that issue would be #13954.

I don't know if that's the issue or not: #13954 talks about a pause when something first appears, but the pausing here is looping and continuous. Also, it's possible to avoid the pausing by minimizing the editor while debugging, which is unusual.

I've found a satisfactory workaround for the moment.

If I place the 3D scene inside a Viewport, then I can play the scene without hiccups. The problem is still strange, but now I don't have to worry about it as much.

i dont think its GLES3...

Im using GLES2 only and i see stalls now and then, here and there.
Sometimes even freezes for half of second.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RebelliousX picture RebelliousX  路  3Comments

SleepProgger picture SleepProgger  路  3Comments

EdwardAngeles picture EdwardAngeles  路  3Comments

blurymind picture blurymind  路  3Comments

bojidar-bg picture bojidar-bg  路  3Comments