bool IsProjectionReset()
        {
#if !UNITY_EDITOR
            return(false);
#else
            if (_effects.Count < 1)
            {
                return(false);
            }
            if (Mathf.Approximately(_leiaCamera.BaselineScaling, 0))
            {
                return(false);
            }

            if (LeiaDisplay.Instance.ActualLightfieldMode == LeiaDisplay.LightfieldMode.Off)
            {
                return(false);
            }

            for (int i = 0; i < _leiaCamera.GetViewCount(); i++)
            {
                //m02 only appears to be 0 when the projection matrix has been reset
                if (!Mathf.Approximately(_leiaCamera.GetView(i).Matrix.m02, 0))
                {
                    return(false);
                }
            }

            return(true);
#endif
        }
        /// <summary>
        /// Sets up
        ///     recording object(s),
        ///     recording framerate,
        ///     folders
        /// </summary>
        public void BeginRecording()
        {
            // only allow recording in edit mode
#if !UNITY_EDITOR
            return;
#endif

#pragma warning disable CS0162 // Suppress unreachable code warning

            // in all cases: regulate the passage of time
            // Time.captureFramerate fixes Update() calls such that Update() effectively only gets called
            // after enough simulated playback time has passed to warrant a new frame

            // forcing captureFramerate = 60 ensures that the correct video framerate AND duration are made
            // without Unity time at 60, 24 fps recordings are 2.5x longer than they should be
            Time.captureFramerate = frameRate;
            isActive = true;

            // in all cases, we will need RenderTextures from LeiaCamera
            if (leia_cam == null)
            {
                leia_cam = transform.GetComponent <LeiaCamera>();

                // if LeiaCamera has clear flag "Solid color" in PNG format with a weak alpha, background pixels will be dimmed by alpha
                if ((leia_cam.Camera.clearFlags == CameraClearFlags.Color || leia_cam.Camera.clearFlags == CameraClearFlags.SolidColor) &&
                    recordingFormat.ToString().Equals("png") &&
                    leia_cam.Camera.backgroundColor.a < 1.0f
                    )
                {
                    LogUtil.Log(LogLevel.Warning, "When recording in format {0} from {1} with clear flag {2} and background {3}:\n\tBackground pixels will be dimmed by alpha channel of color {3}", recordingFormat, leia_cam, leia_cam.Camera.clearFlags, leia_cam.Camera.backgroundColor);
                }
            }

            if (leia_cam != null && leia_cam.GetView(0) != null && leia_cam.GetView(0).TargetTexture != null)
            {
                RenderTexture view_prime = leia_cam.GetView(0).TargetTexture;
                cols     = Mathf.FloorToInt(Mathf.Sqrt(leia_cam.GetViewCount()));
                rows     = (cols == 0 ? 0 : leia_cam.GetViewCount() / cols);
                record_w = view_prime.width * cols;
                record_h = view_prime.height * rows;

                views = new RenderTexture[leia_cam.GetViewCount()];
                for (int i = 0; i < leia_cam.GetViewCount(); i++)
                {
                    views[i] = leia_cam.GetView(i).TargetTexture;
                }
            }

            System.DateTime currTime = System.DateTime.Now;
            folderPath = Path.Combine(Application.streamingAssetsPath, string.Format("{0:D3}_{1:D2}_{2:D2}_{3:D2}", currTime.DayOfYear, currTime.Hour, currTime.Minute, currTime.Second));
            Directory.CreateDirectory(folderPath);

            // if png/jpg
            // no additional behavior

            // if mp4
#if UNITY_EDITOR && UNITY_2017_3_OR_NEWER
            if (recordingFormat.ToString().Equals("mp4"))
            {
                VideoTrackAttributes videoAttr = new VideoTrackAttributes()
                {
                    frameRate    = new MediaRational(frameRate),
                    width        = (uint)record_w,
                    height       = (uint)record_h,
                    includeAlpha = false
                };

                string vid_name = string.Format("recording_{0}x{1}.{2}", cols, rows, recordingFormat.ToString());
                encoder = new MediaEncoder(Path.Combine(folderPath, vid_name), videoAttr);
            }
#endif

#pragma warning restore CS0162 // Suppress unreachable code warning
        }