Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by vovacooper · Jan 14, 2013 at 10:45 AM · portalportalstexture render

create a portal with texture render

hi can any one please explain or give some tutorial on how to make a non walk trough portal in unity pro. some thing like this all i have managed to fine is that it's easy, but never the answer. i have build a plane and put on it the camera texture but how do i keep all the perspectives so it look like a portal.

thank's.

Comment
Add comment
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

3 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by robhuhn · Jan 14, 2013 at 02:14 PM

I don't know the code but I would say it works as follows.

  • attach one camera to portal0 and another to portal1 both looking away from the portal (-1 on local z). They are used to render the texture.

  • calculate difference between portal0 and portal1 -> diff

  • apply the negative transformation of the main camera to the portal cameras, add the linked portal transformation and add the diff from above.

May be like that the more or less. Hope it helps to get the idea.


also, i found another question about portals on unity answers which is exactly what you need: http://answers.unity3d.com/questions/123547/seamless-portals-into-other-spaces.html

Comment
Add comment · Show 3 · 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 vovacooper · Jan 14, 2013 at 09:36 PM 0
Share

thank you for tiring to help me. but can you please b a little bit more specific? i have tried this as much i understood but i have nothing :(

i have created 2 main objects portal0 and portal1 that each contain a camera and a "screen" that shows the camera (texture render) the code is?

 void Update () {
     GameObject $$anonymous$$ainCamera = GameObject.Find("mainCamera");
     GameObject portal0Camera = GameObject.Find("portal0Camera");
     GameObject portal1Camera = GameObject.Find("portal1Camera");
     GameObject portal0 = GameObject.Find("portal0");
     GameObject portal1 = GameObject.Find("portal1");
     
     Vector3 diff = portal0.transform.position - portal1.transform.position;
     portal0Camera.transform.localPosition = $$anonymous$$ainCamera.transform.localPosition * -1 + diff;
     portal1Camera.transform.localPosition = $$anonymous$$ainCamera.transform.localPosition * -1 + diff;
 }

thank u.

avatar image robhuhn · Jan 14, 2013 at 11:26 PM 1
Share

I'm really interessted in this and also like to know how to achieve that effect. I will create an example project tomorrow and post some details if I get it to work. I think it's not the diff between the portals but between e.g. Portal0 and main camera which then is applied to the cam of the other portal. I'll know more tomorrow.

avatar image robhuhn · Jan 15, 2013 at 10:04 AM 1
Share

hi, i found another question about portals on unity answers which is exactly what you need: http://answers.unity3d.com/questions/123547/seamless-portals-into-other-spaces.html

avatar image
0

Answer by MattewMarkson · Jan 14, 2013 at 11:41 AM

this is looking as mirror, just create a render texture, and camera. assign this render texture in camera render texture, and then apply this rendertexture to your object. Done!

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 vovacooper · Jan 14, 2013 at 01:47 PM 0
Share

i did it. but how do i keep all the perspective. i want it to look something like this

http://www.youtube.com/watch?v=JTxULkb4x$$anonymous$$Y&playnext=1&list=PLiZAW2FUE1Da5UC4sHwl05uiurncQwaTU&feature=results_main

you see that if the main camera is traveling then the texture render is changing accordingly

how can i do thaT?

avatar image
0

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

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

A two-line shader, and it works in Unity Standard. Handles the view but not the actual relocation.

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

12 People are following this question.

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

Related Questions

making a non walk through portal 2 Answers

A way to code teleporters for different teams? 1 Answer

How to make the Skybox visible only through a window? 3 Answers

Portal issue and transform.position 0 Answers

Creating portal camera view with render textur 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