Multiple camera from different angles on one scene at the same time.

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

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?

:bust_in_silhouette: Reply From: Zylann

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.

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!
https://drive.google.com/open?id=1sxh2M7Pud0wKfjIp-HpstGJZ4XjVT2CY

Then we try to implement exactly similar project from scratch, amazing! All things work good!
https://drive.google.com/open?id=187uZedMhN0aIQRSSNCXSoQC1V8eUZCf6

What is difference?!

siamak-s | 2019-08-11 11:18

Sorry! I made a bit mistake! :slight_smile:

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:
https://forum.godotengine.org/50112/transforming-attached-scene-child-affect-viewport-camera

siamak-s | 2019-08-12 12:16