Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
7
Question by save · May 29, 2011 at 11:22 AM · teleportportalseamless

Seamless portals into other spaces

Portal in Lego

Not trying to make a replica of Valve's Portal, just very curious about the technique behind the solution of seamless teleportation between one space to another. This could surely be done in Unity (graphically with cameras and rendertextures and technically with trigger areas to ghost through a bit of the wall), but what happens codewise when the player goes through a hole in one location to wind up on the other side of the hole without glitches in between (so all view angles of entry/exit seem seamless)?

Would it be a good idea to duplicate the room so there are two rooms at all times or is this just a position arrangement of the player? Once entering the entry portal you immediately transform the position to the exit portal with the same view rotation as when the entry were made. One thing to bear in mind is the cameras near clipping as you get really close to the wall on entry.

As this could be used for other technical reasons in a game the solutions are very interesting to discuss. How would you solve a seamless portal?

Comment
Add comment · Show 11
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image iggy · May 29, 2011 at 11:31 AM 0
Share

everyone is saying the rendering part is easy but i can't figure it out. i understand the Stencil Buffer Technique but in Unity and RTT i just can't get the angles right.

this is my progress: http://uploadpic.org/storage/2011/wJcbVRDAzZLfYwVmVxnyH9fLF.jpg

avatar image save · May 29, 2011 at 11:35 AM 0
Share

This gets really twisty in my head when thinking of it, but bear with me. I think the rendertexture's camera has to be moved the same way as the first person camera but position referenced as to the output position of the "exit"-portal. So while looking into the "entry"-portal it would behave as you were looking straight into the other room with the same distance and rotation.

avatar image iggy · May 29, 2011 at 11:37 AM 0
Share

yes i thought so too. but you get smaller picture every time.

avatar image save · May 29, 2011 at 11:39 AM 0
Share

Yeah you're right, didn't think of that! The z-location should be fixed to the exit-position to solve that.

avatar image iggy · May 29, 2011 at 11:41 AM 0
Share

for the sake of simplicity i am trying to create a 2 portals in same position. so i get seamless transition to scene behind portal. the relativity of 2 portals later is easy.

Show more comments

4 Replies

· Add your reply
  • Sort: 
avatar image
5

Answer by ggappleid · Apr 27, 2012 at 10:58 AM

I am an author of "Portalizer" package that you can find in AssetStore. Here is explanation of how i made a seamless portals for teleporting objects and FPS (pakcage include only object teleporting).

1) Rendering: i look into MirrorReflection shader and script that you can find in Wiki. I have add two mirrors on scene and my goal was to render Reflection for camera that look on other mirror. I have modified transformation matrix that know relations between 2 portals and voila, all works fine.

2) Object teleporting: i have add inner trigger zone to portal which activates when you add moving object here. It simply create clone of this object and add script to it, that control his position and rotation using similar transformation matrix (like in previous step)

3) I have add a few zones to portals that send info about colliders to global script that manage them (enable|disable collision with walls, other objects e.t.c.)

4) To make object culling visually when it is inside portal, i have used interesting shader that i found on forum written by Aras. I modified it and got cool result, now my portals are connected and can seamless teleport object.

5) FPS teleporting: This is the most tricky part. How to teleport camera? I thinking about it too much and here is what i get. To make Camera looks fluid, i played with "Depth only" option. When i am creating clone for FPS, i also create Eyes for it, with absolutely the same params as your MainCam with rotation and position multiply on transformation matrix. Then i "wear glasses" while going through portal. This is basically a plane with transparent shader placed in front of camera. Then i placing projector behind each portal that project "Depth only shader" on this glasses and mix 2 camera views automatically.

You can try my final project here. Good luck

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ubunturox104 · Mar 16, 2016 at 06:00 AM 0
Share

Aloha, I noticed that the Portalizer package is now deprecated. Are you planning to make an updated version or new package?

avatar image
2

Answer by Anxo · May 29, 2011 at 08:00 PM

I used portals (black holes) for my "AstroNut 3D" game.(plug!) The player is able to jump from one location to another of the same level (room).

My character had a rigidbody attached to it and moved by Rigidbody.AddForce so what I did was when the player hit on black hole, The direction and speed of the character is stored in varibles, then an animation plays of the character flying in the black hole and the camera flew over to the other black hole, the position of the character was moved to the second blackhole and an animation was played for the character coming out. Then the stored velocity's direction and speed is reapplied to the character so that the player knows where he/she is flying once they came out of the black hole allowing them to plan on which direction to enter it from.

People are not able to look in the portal but if you need a portal you can look into and see the same thing thats happening you could use a camera in that location and then render to texture on a plane thats in that same location. But you would need Unity Pro Depending on your situation it might just be as simple as

on collision enter, player position = new position.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image save · May 31, 2011 at 01:40 AM 0
Share

Interesting solutions, there might be a good point to let animations take over the logic in the enter-exit moment to solve a few issues with the seamlessness. Awesome reading thanks Anxo.

avatar image
1

Answer by DanJC · Apr 25, 2013 at 08:35 AM

http://answers.unity3d.com/questions/421450/how-can-i-render-a-scene-to-a-surface.html#answer-444650

Two-line shader handles the viewing aspect, and it works in Unity Standard. Not sure about the stepping through.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by BornOnFire · Jul 04, 2015 at 07:09 PM

I Just finished making the portals from this video https://www.youtube.com/watch?v=sK9Qf8ElFHo Easy to understand and now with Unity 5 its available to do it with the free version. Made the portals into a Prefab for my project.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How can I make a character disappear from view from one side to the other? 1 Answer

Portal between scenes? 3 Answers

Advice on portal clone (More cameras in 1 scene) 1 Answer

Teleportation problem! 1 Answer

Depth mask Portal Method. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges