13 public Texture front, back, left, right, top, bottom;
17 x1024, x64, x32, x16, x8
19 public CellSize StereoCellSize = CellSize.x32;
21 public float StereoIpdMm = 64.0f;
23 public void SetTextureByIndex(
int i, Texture t)
48 public Texture GetTextureByIndex(
int i)
68 static public void SetOverride(
74 Texture bottom = null )
76 var compositor = OpenVR.Compositor;
77 if (compositor != null)
79 var handles =
new Texture[] { front, back, left, right, top, bottom };
81 for (
int i = 0; i < 6; i++)
83 textures[i].handle = (handles[i] != null) ? handles[i].GetNativeTexturePtr() : System.IntPtr.Zero;
84 textures[i].eType = SteamVR.instance.textureType;
85 textures[i].eColorSpace = EColorSpace.Auto;
87 var error = compositor.SetSkyboxOverride(textures);
88 if (error != EVRCompositorError.None)
90 Debug.LogError(
"Failed to set skybox override with error: " + error);
91 if (error == EVRCompositorError.TextureIsOnWrongDevice)
92 Debug.Log(
"Set your graphics driver to use the same video card as the headset is plugged into for Unity.");
93 else if (error == EVRCompositorError.TextureUsesUnsupportedFormat)
94 Debug.Log(
"Ensure skybox textures are not compressed and have no mipmaps.");
99 static public void ClearOverride()
101 var compositor = OpenVR.Compositor;
102 if (compositor != null)
103 compositor.ClearSkyboxOverride();
108 SetOverride(front, back, left, right, top, bottom);