Can the main viewport be disabled in gdscript?

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

I am working on a space prototype which involves large world rendering. I have taken inspiration from Kerbal Space Program in that the world is split into multiple scenes of varying scales (in my case, a background scene, miniature scene & a real scale scene). All scenes are rendered to separate viewports and ordered back-to-front so as to display in the correct order onto the screen.

Layout of the scene (image link in case it doesn’t load here)

While this method works mostly as intended, I do believe the main viewport of the engine is still rendering in the background.


Is there a way to disable rendering of the main viewport in gdscript?

If not, is there currently a way to access the depth of a viewport in gdscript (I haven’t found anything documented anywhere for this) so as to allow for some custom compositig (e.g. via a shader) directly onto the main viewport?

Thanks in advance!

:bust_in_silhouette: Reply From: Althar93

I ended up capturing a frame of my prototype in Renderdoc and discovered that the main viewport was not being rendered again, to my relief.

In the image below, you can see that I have three colour passes, for three separate layers/viewports, with the final colour pass being the viewport textures being blitted onto the screen.

The RenderDoc capture showing the 3 layer passes & final compositing pass(image link in case it doesn’t load here)

Maybe someone can confirm but I would venture a guess that because my root Spatial node has no actual renderables or cameras (see the scene graph I pasted in the original question), the viewport does not render anything other than the viewport container (which is exactly what I need it to do).