Does the projection matrix calculation affect the shader?

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.

alt text

If I don’t change the projection matrix of the camera, there is no problem.

alt text

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 :frowning:

Also, the projection matrix is reset when I use a post processing stack. I have learned that there is no solution yet. So my question is: how can I set up the F***ing portal camera with these restrictions? How will the portal camera work without using a projection matrix? :((