From 6c718ed73369518ab9b42193c5d93ecfd4725a9a Mon Sep 17 00:00:00 2001 From: Boris Novikov Date: Tue, 8 Jan 2019 19:44:36 +0300 Subject: [PATCH] Camera projection matrix to camera FOV conversion --- Assets/GoogleARCore/SDK/Scripts/ARCoreBackgroundRenderer.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Assets/GoogleARCore/SDK/Scripts/ARCoreBackgroundRenderer.cs b/Assets/GoogleARCore/SDK/Scripts/ARCoreBackgroundRenderer.cs index 03c2db0a..ac668fc3 100644 --- a/Assets/GoogleARCore/SDK/Scripts/ARCoreBackgroundRenderer.cs +++ b/Assets/GoogleARCore/SDK/Scripts/ARCoreBackgroundRenderer.cs @@ -92,8 +92,11 @@ private void Update() BackgroundMaterial.SetVector(bottomLeftRightVar, new Vector4(uvQuad.BottomLeft.x, uvQuad.BottomLeft.y, uvQuad.BottomRight.x, uvQuad.BottomRight.y)); - m_Camera.projectionMatrix = Frame.CameraImage.GetCameraProjectionMatrix( + var prjMat = Frame.CameraImage.GetCameraProjectionMatrix( m_Camera.nearClipPlane, m_Camera.farClipPlane); + + //Set camera FOV instead of setting camera projection matrix so other visual effects such as Post-Processing stack won't break + m_Camera.fieldOfView = Mathf.Atan(1 / prjMat[5]) * 2f * Mathf.Rad2Deg; } private void Disable()