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.

3 Answers

3

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: Seamless portals into other spaces - Questions & Answers - Unity Discussions

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.

–

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][1] [1]: http://answers.unity3d.com/questions/123547/seamless-portals-into-other-spaces.html

–

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!

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=JTxULkb4xMY&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?

–

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