is it possible to only render objects in a specific viewport but not the main screen?

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

I set up a viewport and add several meshes as children in the viewport.
My question is, is it possible only render those meshes in parent viewport, but not render them to 3d screen (main camera)?


:bust_in_silhouette: Reply From: omggomb

You want to check use_own_world in your Viewport and create a World resource for it (right under use own world). Then you also need to add a camera to your viewport. It will then render only children of the viewport. Make sure to add a WorldEnvironment node under the viewport and set the Background and Ambient Light to something appropriate, or else you’ll only see a grey image.

For further details see the docs: Using Viewports — Godot Engine (stable) documentation in English