Godot-docs: Instancing relatively large Viewport Textures consistently causes frame drops.

Created on 10 Jul 2020  路  8Comments  路  Source: godotengine/godot-docs

Godot version:
v3.2.1

OS/device including version:
win10, gtx 1080, GLES3

Issue description:
Consistent freeze when instancing a scene with a ViewportTexture with a high resolution, despite the scene being preloaded.
I also noticed that during these frame drops, the Profiler registers it as being below the average frame rate during them, as if the profiler itself is also freezing.
This happens for every instance and not just the first instance.
image

Steps to reproduce:
create a scene with a 3d viewport, same as this demo project, set the Viewport size to something like 3500x3500 or higher.

Then create another scene where your previous scene is preloaded into it, and add a control or something to instance the scene into this scene at runtime in order to see the effect it has on framerate.

Minimal reproduction project:
I don't want to spend time on one right now in case this is not an issue but just a known limitation in Godot. So let me know and I will.

enhancement

Most helpful comment

This is a known issue. It makes dynamic resolution unfortunately not viable right now. It might be solvable in Vulkan though: https://github.com/godotengine/godot-proposals/issues/917

All 8 comments

Most likely shaders compiling?

@Zireael07 do they have to compile for every instance? There's no way to preload them?

Nope, GLES 2 and 3 don't allow preloading shaders. There are some tricks, @BastiaanOlij I think showcased some, but IIRC they don't work for viewport textures...

Darn, guess this isn't a bug report as much as it is a performance issue, i could try and instance this 3d viewport scene from a thread and just have a delay before the instance appears rather than a stutter if that's possible.

This is a known issue. It makes dynamic resolution unfortunately not viable right now. It might be solvable in Vulkan though: https://github.com/godotengine/godot-proposals/issues/917

We could consider adding this to about/troubleshooting.

It would save me from having to create a 3D sprite based damage popup, like in rpgs, to achieve something as simple as that without stuttering; I would have to create a script that aligns every 3D sprite for each character due to this limitation.

@KnightNine See https://github.com/godotengine/godot-demo-projects/pull/512 for a different approach to 3D text using Control-based nodes and Camera.unproject_position(). You do not need to use Viewports to display text in a 3D world :slightly_smiling_face:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mhilbrunner picture mhilbrunner  路  3Comments

creikey picture creikey  路  4Comments

golddotasksquestions picture golddotasksquestions  路  3Comments

jcs224 picture jcs224  路  3Comments

Gfurst picture Gfurst  路  3Comments