Example #1
0
        public static ProjectorRenderer Attach(ProjectorBrain brain, DeviceOutput output)
        {
            ProjectorRenderer renderer = brain.GetComponent <ProjectorRenderer>();

            if (renderer != null)
            {
                GameObject.Destroy(renderer);
            }

            switch (output)
            {
            case DeviceOutput.Mono:
                renderer = brain.gameObject.AddComponent <ProjectorRendererMono>();
                break;

            case DeviceOutput.Stereo:
                renderer = brain.gameObject.AddComponent <ProjectorRendererStereo>();
                break;
            }

            return(renderer);
        }
Example #2
0
        private void LateInitialize()
        {
            this.eyes.SetEyeSeparation(this.settings.StereoSeparation);
            this.mount.AlignViewports(this.settings.ViewportAxis);

            for (int i = this.emitters.Length - 1; i >= 0; --i)
            {
                this.emitters[i].SetStereoEffect(this.settings.StereoConvergence, this.settings.StereoSeparation);

                if (this.settings.EqualizeImages)
                {
                    this.emitters[i].Equalize(this.settings.ReloadEqualization);
                }
                else
                {
                    this.emitters[i].DisableMask();
                }
            }

            this.renderer = ProjectorRenderer.Attach(this, this.settings.DeviceOutput);
            this.renderer.SetRenderTargets(this.eyes, this.emitters);
        }