0 votes

Imagine we divide screen to four viewports. One of them is root viewport and other threes are viewports which is placed as child of other nodes, and each viewport has a camera as child. These nodes (which have a viewport) maybe placed on another scene and attached to root scene (ex, KinematicBody as player with its own viewport).

From Viewports, node hierarchy effects on what node renders on what viewport. We want to break this constraint and all viewports on all levels of node hierarchy renders all node available from root node. How we can achieve that?

in Engine by (81 points)
retagged by

1 Answer

+2 votes
Best answer

I think this is like split-screen situation. In order to achieve that, you need to assign the same world to your viewports, so they will render the same things. Then I think the camera used will be the one you put under these viewports:

- root (Viewport)
    - YourLevel
        - Stuff..
        - ...
        - Viewport1 <-- uses same world as root
            - Camera1
        - Viewport2 <-- uses same world as root
            - Camera2
        - Viewport3 <-- uses same world as root
            - Camera3
        - Viewport4 <-- uses same world as root
            - Camera4

I used such setup only once to make a debug view and it worked, but I haven't investigated more configurations than that.

by (28,738 points)
selected by

I think I encounter with amazing behavior!

Here is our simplified version of our project which tries to add split screen behavior, as you can see we failed with strange render results!

Then we try to implement exactly similar project from scratch, amazing! All things work good!

What is difference?!

Sorry! I made a bit mistake! :-)

For someone reading later, both of above projects are correct. The second project problem is about Transformations and their relations to inner Viewports, which discussed here:

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.