Delay in rendering of a ViewportTexture

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By sygi

I have a “3D in 2D” setup, very much like in this asset, where a 3D viewport (with an always update mode) is used as a texture for a 2D sprite node.

When the scene is loaded, I see a significant (~1s) delay between when the whole scene is shown, and when the viewport is rendered. Is there a way for the scene tree to wait for the viewport to render, and only then show it all?

Example:

add an intro scene. Sample the “intro scene” as the room changes.
“intro scene”. Let it be black (sprite). and add animation. sprite - visibility/modulate/
add the “second room” to the scene when the animation starts

or use Tİmer

ramazan | 2022-09-18 12:39

I tried adding some animation, but due to the order in which things are rendered and unpredictable loading times, Godot starts by first showing the full frame without the 3D character, then the character is loaded, and only then the black animation starts.

sygi | 2022-09-18 14:24

:bust_in_silhouette: Reply From: sygi

I ended up following this tutorial explaining loading the resources (for me: scene) in a separate thread to avoid showing the user the scene which is half-constructed.