I’m working on a portal game with Unity. For the portal camera to see the world correctly, I do a matrix calculation like the one I see in github. I also tried the matrix calculation used in the water script of unity and the MirrorReflection4 script in the unity wiki. The result has not changed.
The portal camera calculates the projection matrix correctly, but does not render certain materials correctly.
If I don’t change the projection matrix of the camera, there is no problem.
I need to use a projection matrix for the portal camera. Otherwise, the camera displaying the portal can see the walls behind the portal and similar objects. But when I use the projection matrix, I encounter the problem mentioned above. Does anyone have an idea for the cause and solution of this problem?
I’ve uploaded a video to better understand my problem.
I still haven’t found a solution