0

As you can see in the attached image, the game view in my Unity project has some issues. It looks like it is duplicating the view in increasing smaller slivers of the main view. Any fix for this?

I'm running Unity 5.6.0 beta with the Daydream VR asset.

UI Issue

1 Answers1

1

This will be fixed in the next update. In the meantime, please use the workaround posted below:

This looks to be an issue introduced in 5.6. I'm not sure if this was an intended change in Unity or a regression. Until we have a resolution the following changes will correct this for users of the SDK.

diff --git a/GoogleVR/Legacy/Scripts/Internal/GvrEye.cs b/GoogleVR/Legacy/Scripts/Internal/GvrEye.cs
index 06e3692..8ce0021 100644
--- a/GoogleVR/Legacy/Scripts/Internal/GvrEye.cs
+++ b/GoogleVR/Legacy/Scripts/Internal/GvrEye.cs
@@ -210,6 +210,7 @@ public class GvrEye : MonoBehaviour {
       stereoEffect = GetComponent<StereoRenderEffect>();
       if (stereoEffect == null) {
         stereoEffect = gameObject.AddComponent<StereoRenderEffect>();
+        stereoEffect.eye = eye;
       }
       stereoEffect.enabled = true;
     } else if (stereoEffect != null) {
diff --git a/GoogleVR/Legacy/Scripts/Internal/StereoRenderEffect.cs b/GoogleVR/Legacy/Scripts/Internal/StereoRenderEffect.cs
index d7020b1..cb18c00 100644
--- a/GoogleVR/Legacy/Scripts/Internal/StereoRenderEffect.cs
+++ b/GoogleVR/Legacy/Scripts/Internal/StereoRenderEffect.cs
@@ -26,7 +26,9 @@ public class StereoRenderEffect : MonoBehaviour {

   private Camera cam;

-  private static readonly Rect fullRect = new Rect(0, 0, 1, 1);
+  private Rect fullRect;
+
+  public GvrViewer.Eye eye;

   void Awake() {
     cam = GetComponent<Camera>();
@@ -34,6 +36,7 @@ public class StereoRenderEffect : MonoBehaviour {

   void Start() {
     material = new Material(Shader.Find("GoogleVR/UnlitTexture"));
+    fullRect = (eye == GvrViewer.Eye.Left ? new Rect (0, 0, 0.5f, 1) : new Rect (0.5f, 0, 0.5f, 1));
   }

   void OnRenderImage(RenderTexture source, RenderTexture dest) {
Nimantha
  • 6,405
  • 6
  • 28
  • 69
Mira
  • 11
  • 1
  • Welcome to StackOverflow. Please indicate what is in the link in order for the answer to be useful. Best – Løiten Feb 21 '17 at 18:05