- Home /
True Portal Effect
So I did a small portal project from this tutorial: https://www.youtube.com/watch?v=sK9Qf8ElFHo
Only problem I had is that the use of render texture is not as realistic as Portal. I am not looking to make it as realistic as Portal in terms of texture (but if you know how than that is much better).
Basically in Portal when you move closer or further from a portal, you see more or less. When you move around, what you see through the portal is different depending on the direction between you and the portal.
I get that the camera rotates and change its field of view to create the realism, but I just don't really get the math behind it, like how much rotation around what axis and how much field of view increment/reduction is needed.
Answer by Eno-Khaon · Jan 20, 2016 at 06:16 PM
I would recommend starting with this Reflection script and shader combo. It calculates an oblique matrix for the camera in order to properly begin its rendering area along an angled wall. If you modify it a little to remove the reflection aspect of it, you should be able to get results along the lines of what you're working towards.
A note regarding this, as well, is that Portal includes an option for how many layers of depth it's willing to generate. For every layer of depth you use, you would create a new camera system based on each camera system in the line, so that when you can see from one portal through another and back into the first, you have that proper perspective of depth (up the your own specified limit).
Your answer
Follow this Question
Related Questions
Camera.WorldToScreenPoint Equivalent 1 Answer
Checking for quaternion values to not be NaN 4 Answers
Camera Rotation Question 1 Answer
how to clamp y axis with Quaternion.Euler in unity 1 Answer
camera rotation apparent to player 1 Answer