Portal Viewport Issues

I’m trying to make a simple portal for the first time and I have ran into some issues.

My plan was to use a ViewportFrame (not exactly like this, but close) to mask out what you’re not supposed to see. As you can see in the image above, you can see that transparent glass doesn’t quite work.

While I could avoid using a ViewportFrame altogether, the lighting wouldn’t be correct if the portal had a different orientation than the starting portal if it were lit by the sun. I do hope Roblox adds a proper masking tool that works for the default Viewport as well as any ViewportFrame. If I can find a way to deal with the lighting inconsistencies with not using a ViewportFrame, that would be a helpful solution.

Otherwise, I would like to know how to use a ViewportFrame specifically in a SurfaceGui to bypass having to clip things myself. The problem with that is I can’t figure out how to project it correctly as shown here:

Portal Issue 3

I’ve tried moving the ViewportFrame’s Camera based on the offset of the Player’s CurrentCamera. However, outside of looking directly at the portal from the center, it produces odd results like this:

Portal Issue 2

It moves around a bit weird and the sphere stretches towards when it reaches the edges. It just seems a bit weird overall. I assume this is because the camera is directly inside of the output portal (which is the same portal for testing purposes). I’m not quite sure how to fix the output of the ViewportFrame so that it shows what I want instead of what the second gif (above) shows.

Any help would be appreciated. Thanks

Edit:
Actually, looking at this more, I don’t think it’s a position issue exactly. I think it’s a rotation issue. I’m not quite sure how to explain it, but it’s matching the exact orientation of the camera, but from the viewpoint of the portal itself. I need to somehow offset that in a way that would give the proper perspective.

2 Likes

The object goes in the opposite direction of the camera? Could you try multiplying the position with -1?

I can see where you might get that, but I think it has to do with the camera position. When I added the baseplate texture, it seems more obvious now. When moving around, it never changes the position of the camera, which is why it looks so weird:

Portal Issue 2

I’ll try messing with the camera position to see what I can work out. But thank you for the suggestion as it lead me to this.

(Updated original post with new gifs)

Edit:
Actually, looking at this more, I don’t think it’s a position issue exactly. I think it’s a rotation issue. I’m not quite sure how to explain it, but it’s matching the exact orientation of the camera, but from the viewpoint of the portal itself. I need to somehow offset that in a way that would give the proper perspective.

1 Like