private void InitializeEyes() { eyes.Clear(); if (monoCamera != null && monoCamera.gameObject.activeSelf) { Debug.Log("add eyes mono"); AddEyes(monoCamera, LarEye.eSide.BOTH); } if (leftCamera != null && leftCamera.gameObject.activeSelf) { Debug.Log("add eyes left"); AddEyes(leftCamera, LarEye.eSide.LEFT); } if (rightCamera != null && rightCamera.gameObject.activeSelf) { Debug.Log("add eyes right"); AddEyes(rightCamera, LarEye.eSide.RIGHT); } if (settings.eyeHdr && settings.eyeAntiAliasing != LarSettings.eAntiAliasing.K1) { Debug.LogWarning("Antialiasing not supported when HDR is enabled. Disabling antiAliasing..."); settings.eyeAntiAliasing = LarSettings.eAntiAliasing.K1; } LarPlugin.DeviceInfo info = plugin.deviceInfo; foreach (LarEye eye in eyes) { if (eye == null) { continue; } Vector3 eyePos; eye.Format = settings.eyeHdr ? RenderTextureFormat.DefaultHDR : RenderTextureFormat.Default; eye.Resolution = new Vector2(info.displayWidthPixels / 2, info.displayHeightPixels); eye.Depth = (int)settings.eyeDepth; eye.AntiAliasing = (int)settings.eyeAntiAliasing; // hdr not supported with antialiasing eye.OnPostRenderListener = OnPostRenderListener; eye.Initialize(); } }
void InitializeOverlays() { overlays.Clear(); if (leftOverlay != null && leftOverlay.gameObject.activeSelf) { AddOverlays(leftOverlay, LarOverlay.eSide.LEFT); } if (rightOverlay != null && rightOverlay.gameObject.activeSelf) { AddOverlays(rightOverlay, LarOverlay.eSide.RIGHT); } if (monoOverlay != null && monoOverlay.gameObject.activeSelf) { AddOverlays(monoOverlay, LarOverlay.eSide.BOTH); } if (settings.overlayHdr && settings.overlayAntiAliasing != LarSettings.eAntiAliasing.K1) { Debug.LogWarning("Antialiasing not supported when HDR is enabled. Disabling antiAliasing..."); settings.overlayAntiAliasing = LarSettings.eAntiAliasing.K1; } LarPlugin.DeviceInfo info = plugin.deviceInfo; foreach (LarOverlay overlay in overlays) { if (overlay == null) { continue; } Vector3 eyePos; overlay.Format = settings.overlayHdr ? RenderTextureFormat.DefaultHDR : RenderTextureFormat.Default; overlay.Resolution = new Vector2(rightOverlay.pixelWidth / 2, rightOverlay.pixelHeight); overlay.Depth = (int)settings.overlayDepth; overlay.AntiAliasing = (int)settings.overlayAntiAliasing; // hdr not supported with antialiasing overlay.OnPostRenderListener = OnPostRenderListener; overlay.Initialize(); } }