When in the frame do SubViewports render?

Godot Version

4.4 stable

Question

I’d like to get the viewport texture and display it manually. To do this I need to get the texture after the rendering of the first viewport and before the rendering of the second, parent viewport.

the rendering happens at once. You can await for the RenderingServer.frame_post_draw signal before getting the texture and showing it in the second viewport.

Thanks. That’s what I figured, but that would mean that the texture is displayed the next frame, correct? Not ideal obviously.

I’m trying to implement a resolution scaling method. Which works by rendering the game at a custom base resolution and scaling that up to the screen size.

I do this by getting the viewport texture and applying it to a TextureRect.

Terrible implementation because it loses the basic functionality of GUI events but it works very well already.

Actually, after re-reading the initial post, if it’s a ViewportTexture you don’t need to await anything. For some reason I thought you were saving the texture somewhere :sweat_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.