SebLague / Portals

Portals in Unity
https://www.youtube.com/watch?v=cWpFZbjtSQg
MIT License
773 stars 167 forks source link

Top down Camera View #10

Open Grootloops33 opened 3 years ago

Grootloops33 commented 3 years ago

Hello!

I've started on a project using precisely this awesome portal feature. However, my project is top down, means I'm dealing with an extra camera to keep track of.

image This is what I'm looking at, for some reason the portal (In top-down view) seems to be displaying the main camera, instead of the player's camera.

However, from the player's camera pov, it's displaying the other end correctly.

Does anyone know how to fix it? Cheers!

Edit: I forgot to mention, that I believe It's most likely to do with line 40 in the portal.shader o.screenpos = ComputeScreenPos(o.vertex) I'm assuming this'll grab the main camera's display. Which I don't want.