So currently I am having a very rough time trying to make my portal look like the portal demo from egomoose.
local cam = Instance.new("Camera",script.Parent.ViewportFrame)
script.Parent.ViewportFrame.CurrentCamera = cam
game:GetService("RunService").RenderStepped:Connect(function()
local x,y,z = CFrame.new(game.Workspace.CurrentCamera.CFrame.p,game.Workspace.Part.Position):ToOrientation()
cam.CFrame=game.Workspace.Part.CFrame*CFrame.fromEulerAnglesXYZ(math.rad(math.deg(-x)), math.rad(math.deg(y)-180), math.rad(-math.deg(z)))
script.Parent.ViewportFrame.CurrentCamera = cam
end)
As you can see here, the portal is quite rough. Yes, it works somewhat well when you scroll out and it doesn’t just do the weird thing when you just make the viewportframe camera the currentcamera. But, it’s still has a long way to go. I want to make my portal from scratch so don’t send me modules or plugins please. I want to learn how to make this myself. Thanks.
I found this video that created a good looking portal. Even though it isn’t created in Roblox, there is still some theories and rules you can learn from this video. Hope this helps!
For @rottendogDkR, the viewportframe does not change the camera rotation when you move the camera around in first person mode.
For @RontheDragon204, the concepts applied in the video are used for Unity, and there are some very exclusive ideas that cannot be applied to specifically RBXLua. Additionally, the papers shown in the video and linked in the description are quite advanced and I am sure I will be unable to comprehend them.
Roblox does not have render textures, render functions, shaders, view culling, or really anything mentioned in that video. The concepts may apply but no part of the implementation is even remotely applicable to this platform, except for maybe the teleportation.