Make a Transparent object with one side to look in

Guys,

for me this is a pritty advanced challange.

For simplicity I explain this with a cube, also my object has a fairly irregular shape.

Let’s imagine a cube, in a scene. Inside the cube is a sphere. The cube floats over the terrain. Inside the cube has 5 textured sides, lets call them the green sides. The 6th side is transparent so you can look inside the cube and see the green walls and the sphere.

The 5 green sides also have a backside facing into the scene.

So far so easy. Now the challange: How do I make it happen, that when viewed from the scene outside of the cube, the entire cube (with exeption of the 6th side) and the sphere within are not visible?

In the end this shall be an effect, where an invisible spaceship opens a door and you can see whats inside.

Thanks for your support.

You seem to be describing a portal which can be done by using a render texture. So basically you have a second camera that is looking though the door of the spaceship and renders its view into a render texture which you can then use as a material for the spaceship’s door (A plane).

That was my first idea as well. This will work, with the caveat that the camera which films the texture has a fixed orientation. The guy standing on the ground looking upwards to the spaceship will look at it from likely a different angle. I could optimize the effect for one angle, but it would not be perfect.
Potentially I could tilt the filming camera based on the vector from the observer to the spaceship door…

Yep, I believe that’s how portals work. The portal camera can have the same orientation as your main camera but only renders a layer that the space ship’s interior is on. While the main camera isn’t allowed to render the space ship’s layer.