How to use rooms and portals in 3D

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By samuncle
:warning: Old Version Published before Godot 3 was released.

I’m trying to use room to optimize my 3D scene. From what I understood, everything inside a room will be hidden to the player unless he is going inside.

A portal can be placed somewhere in the room that will allow to render only the object visible throught the portal.

When I added the room it seems to work fine and objects inside are hidden unless the player goes inside. However the portal doesn’t seems to work or do something. I’m not sure what’s wrong or if I didn’t understood the concept of room+portals. I included a basic scene to show you the problem.

https://drive.google.com/open?id=0B9jjDvqB8YxFMURVR0lveWd0XzQ

Thanks for your answers

From what I understand, portals are only used to allow other rooms to see the content of a near adjacent room, sort of like a hallway to another room.

Not 100% sure though

Leonard Meagher | 2016-10-18 01:37

:bust_in_silhouette: Reply From: Banskel

Portals do not “render only the object visible through the portal.”
They simply cull the room if the camera is outside the room or if it’s looking away from the portal.

So In your example it should look like this:

Portal/Room Example

A camera has to be in a room for portals/rooms to work.

You can also do something like this if you want to create a cave/outside inside system:

Example Portal/Room
Rather than having two rooms next to each other, this has one room surround another and have portals look into the two rooms, like looking into a cave from outside.