Re-Creating a Portal Effect,

To put it simply, this video goes over what Im trying to achieve. I understand how its done, but can’t seem to replicate the effect myself. Here’s the link.

I already am aware of how to store velocity and what not, I have a base portal animation, I just can’t seem to re-create it correctly, I’ve tried messing and researching on viewportframes but it dosent seem to be doing what Im trying to create, I can’t even go further into my game until I finish this part first. Thank you for your time.


I believe the easiest way of doing this would be with viewportframes


I’ve tried but it seems I simply can’t find out how to distort the viewportframes in such a way to produce this effect.


Using ViewportFrame is unreliable. Each time opening the portal requires the entire workspace to be cloned, which may cause part lag.


No you wouldn’t, you only need to clone the room that the portal is inside of, and then update the part’s position as the player moves around while looking at the portal


Yes, Viewportframes would be an approximate solution to this. Like others have said,

This is what you would need to do to create a portal of that sort.


while ViewportFrames are the most accurate solution, this is not their intended purpose and you should be wary of that when making anything for a production environment. Their primary purpose is to display small items inside there own render environment. ViewportFrames generate a texture, which also means constantly updating is not ideal for something like this.


If viewport frames aren’t working, try cloning another room with the portal as the point of reflection.
This does limit room size though.


Hey, that “ViewportFrame guy” here! I gave this a go, once upon a time.

This is actually almost impossible to do in Roblox. You’d have to rely on buggy behavior that we’ve been explicitly told not to do.

I haven’t watched the video, but I think I know what it’s going to say. At some step, At 4:10 in the video, it’ll discuss how you have to “crop” to a specific portion and make it fill up the frame. We don’t have the ability to do that. However, you could achieve that using Glass rendering bug and some resizing math. It won’t look great, but it works in theory. I don’t recommend it. Because it’ll look off, players will notice when they get close. They get close at crucial points in gameplay, so this isn’t yet viable on Roblox.

Edit: Perhaps one day ViewportFrames will be able to render other ViewportFrames inside themselves. If they do, you could use techniques similar to my image clipping module to crop and size the relevant image. Until then…


Not if you do it right!

I’ve made a few modules that make this very easy to implement. You would only clone things once!
My most recent handler module also lets you chose the FPS at which it would update object CFrames, so you could make the cubes move at only 30 FPS in the portal view. You could also make the map static, and therefore set the module to 0 FPS and massively save on performance since it’ll clone once and then never touch it.


I believe this is possible to do. As a matter of fact I took a good 30 mins to try and put this together.

It’s not perfect, but I believe I was able to convert the clipping problem to being axis aligned. I imagine with a bit of perspective “fudgery” I could make the clipping frame fit properly (which is why it’s not finished yet). That said the actual rotation aspect is clearly possible in the above video.


I’m very impressed. Didn’t think about that! Care to explain the technical details a bit more in depth?


Assuming I can solve this last hurdle I will do a write up.


You’re a gentleman and a scholar.


Okay, so I have something that’s worth talking about now.

I didn’t go through a nice solution that would make aspect and clipping work nicely. Instead out of laziness I choose to just use a “that’s a big number” solution. This is somewhat problematic because it’s still possible to get that cut off problem (although minimized).

Basically instead of doing the clipping and aspect I just use a large field of view and a stretched x size which doesn’t seem to effect the camera in viewport frames. Unfortunately it does result in some minor blurring. Again, I believe this could be fixed if I took the time :laughing:

I’m a little tired of working on this problem, but I know you yourself have a solid track record with viewport frames. I may come back to this problem in a few days, but until then I’ll upload the demo place so the community can have a run at it! :grin:

portal.rbxl (45.8 KB)


Edit: This isn’t a final solution for the reasons mentioned above, hence no write up yet.


EgoMoose to the rescue, though honestly it’d be so much nicer if non-Euclidean space were achievable in Roblox without hacking it together. I obviously have concerns about ViewportFrames but at the very least it does get that “other dimension” view down pat.


6 posts were merged into an existing topic: Off-topic and bump posts

Getting back on topic before someone gets annoyed, let’s discuss this brilliant file you’ve shared.

The most pressing issue is pixelation and blur when close up. If you want players walking through, it needs to work up close too!
(The gif optimizations make this look awesome, but in game it’s just gross)

EgoMoose’s solution is the best we’ve got, and this is a side effect. So, how do we deal with this?

My solution? Game lore. Work with it. Call it “portal sickness”, a phenomenon that occurs when you get too close to a tear in the fabric of space. Add a bit of polish to it using some BlurEffects and particles, and bam: you have a workable product.

The next issue is the behavior at extreme angles. That’s a math issue that’s out of my area of expertise, unfortunately.

Overall, this is the best portal effect I’ve seen so far. As usual, EgoMoose blows everyone away.


There are some issues though.
I will however agree that this is really good.
@boatbomber has already told us the first problem.

But there is also this:

and this

The viewport frame seems to shorten itself at the bottom when you’re close and looking at 90 degrees. Now sure this isn’t exactly a terrible thing. But certainly noticeable.

@EgoMoose What exactly is the module drawClass for? Its not used in the main code and you can remove it without altering functionality. Is it for debugging?


I mentioned it, but because I lack any answers, I didn’t go in detail.