Update / Render a single Viewport

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

Hello everyone!

Is there a way to:

Update and render a single Viewport via GDScript?

Currently I’m struggling to make following scenario work:
I have a camera inside a viewport which should render into the viewport in N number of steps. In each step it should either change its transform or change its near / far properties. And in each step I want to change some materials in the world. Then for each step it should render into the viewport while keeping what has already been rendered into the viewport.

The final result of the viewport should be a world layered (by changed near / far clipping) and materials of the world.

Can someone help me understand how to have control over viewports? Currently it more feels like they do what they want to do without being able to force update single viewports.

Thank you! <3

it should render into the viewport while keeping what has already been rendered into the viewport

What do you mean by this? How many viewports are you working with?

Magso | 2020-03-08 16:28

Currently (it’s about portals) I have only two Viewports.

I try to work out the solution of this coding adventure
https://youtu.be/cWpFZbjtSQg?t=891
but for Godot.

But there’s no obvious way to me like in Unity where it’s just a call:

Camera.Render();

or

Viewport.Render();

which will keep previous buffer information (like depth and color), except the viewport is cleared by method or so.

TheWhiteLlama | 2020-03-08 16:55