private void setDisplayConfiguration()
 {
     //only setDisplayConfiguration if we are running from EXE.
     if (!Application.isEditor && ClusterManager.Instance.hadArgs)
     {
         int toShow = ClusterManager.Instance.NumSlavesToShow;
         if (toShow == 1)
         {
             this._displayConfiguration = DisplayConfigurations.LEFT_RIGHT;
         }
         else if (toShow == 2)
         {
             this._displayConfiguration = DisplayConfigurations.DOUBLE_IG;
         }
         else if (toShow == 3)
         {
             this._displayConfiguration = DisplayConfigurations.TRIPLE_IG;
         }
     }
 }
	// Update is called once per frame
	void Update()
	{
    	
		if (this.InputEnabled) {
			if (Input.GetKeyDown (KeyCode.L)) {
				showLeftEye = !showLeftEye;
			} else if (Input.GetKeyDown (KeyCode.G)) {
				this.setGrid (!this.showGrid);            
			} else if (Input.GetKeyDown (KeyCode.Alpha1)) {
				eyeWidth -= 0.01f;
			} else if (Input.GetKeyDown (KeyCode.Alpha2)) {
				eyeWidth += 0.01f;
			} else if (Input.GetKeyDown (KeyCode.Alpha3)) {
				this.ShutdownRenderSystem ();
			} else if (Input.GetKeyDown (KeyCode.Alpha4)) {
				this.StartRenderSystem ();
			}
	
			////////////////////////////
			// Display Configurations //
			////////////////////////////
			if (Input.GetKeyDown (KeyCode.F5)) {
				this._displayConfiguration = DisplayConfigurations.MASTER;
			} else if (Input.GetKeyDown (KeyCode.F6)) {
	
			} else if (Input.GetKeyDown (KeyCode.F7)) {
	
			} else if (Input.GetKeyDown (KeyCode.F8)) {
	
			} else if (Input.GetKeyDown (KeyCode.F9)) {
	
			}
		}

		///////////////////////////////////////////////////
		// Update the display configuration if necessary //
		///////////////////////////////////////////////////
		if (_displayConfiguration != _internalDisplayConfiguration) {
			// Restart the render system
			_internalDisplayConfiguration = _displayConfiguration;
			this.StartRenderSystem (); 
		}

		/////////////////////////////////
		// Per Frame Parameter Updates //
		/////////////////////////////////
		foreach (ProjectorDescription projector in _projectors) {
			foreach (SliceCameraDescription camera in projector.sliceCameras) {
				if (camera.cameraObject != null) {
					camera.EyeWidth = eyeWidth;
					camera.cameraObject.camera.depthTextureMode = DepthTextureMode.Depth;
					camera.cameraObject.camera.Render();
					
					if (this.SlicePostRenderCallback != null)
						this.SlicePostRenderCallback(camera);
				}
			}
			if (this.AllPostRenderCallback != null)
				this.AllPostRenderCallback(projector);
		}

		////////////////////////////////////
		// Track the follow camera object //
		////////////////////////////////////
		if (_sliceCameraParent) {
			if (_followCamera) {
				Vector3 p = _followCamera.transform.position;
				p.y += 5.0f; 
				_sliceCameraParent.transform.position = p;
				_sliceCameraParent.transform.eulerAngles = _followCamera.transform.eulerAngles;
			} else {
				_sliceCameraParent.transform.position = _masterCamera.transform.position;
				_sliceCameraParent.transform.eulerAngles = _masterCamera.transform.eulerAngles;
			}
		}
	}
	private void setDisplayConfiguration() {
		//only setDisplayConfiguration if we are running from EXE.		
		if (!Application.isEditor && ClusterManager.Instance.hadArgs)
		{
			int toShow = ClusterManager.Instance.NumSlavesToShow;
			if (toShow == 1) {
				this._displayConfiguration = DisplayConfigurations.LEFT_RIGHT;
			} else if (toShow == 2) {
				this._displayConfiguration = DisplayConfigurations.DOUBLE_IG;
			} else if (toShow == 3) {
				this._displayConfiguration = DisplayConfigurations.TRIPLE_IG;
			}
		}
		
		
	}
    // Update is called once per frame
    void Update()
    {
        if (this.InputEnabled)
        {
            if (Input.GetKeyDown(KeyCode.L))
            {
                showLeftEye = !showLeftEye;
            }
            else if (Input.GetKeyDown(KeyCode.G))
            {
                this.setGrid(!this.showGrid);
            }
            else if (Input.GetKeyDown(KeyCode.Alpha1))
            {
                eyeWidth -= 0.01f;
            }
            else if (Input.GetKeyDown(KeyCode.Alpha2))
            {
                eyeWidth += 0.01f;
            }
            else if (Input.GetKeyDown(KeyCode.Alpha3))
            {
                this.ShutdownRenderSystem();
            }
            else if (Input.GetKeyDown(KeyCode.Alpha4))
            {
                this.StartRenderSystem();
            }

            ////////////////////////////
            // Display Configurations //
            ////////////////////////////
            if (Input.GetKeyDown(KeyCode.F5))
            {
                this._displayConfiguration = DisplayConfigurations.MASTER;
            }
            else if (Input.GetKeyDown(KeyCode.F6))
            {
            }
            else if (Input.GetKeyDown(KeyCode.F7))
            {
            }
            else if (Input.GetKeyDown(KeyCode.F8))
            {
            }
            else if (Input.GetKeyDown(KeyCode.F9))
            {
            }
        }

        ///////////////////////////////////////////////////
        // Update the display configuration if necessary //
        ///////////////////////////////////////////////////
        if (_displayConfiguration != _internalDisplayConfiguration)
        {
            // Restart the render system
            _internalDisplayConfiguration = _displayConfiguration;
            this.StartRenderSystem();
        }

        /////////////////////////////////
        // Per Frame Parameter Updates //
        /////////////////////////////////
        foreach (ProjectorDescription projector in _projectors)
        {
            foreach (SliceCameraDescription camera in projector.sliceCameras)
            {
                if (camera.cameraObject != null)
                {
                    camera.EyeWidth = eyeWidth;
                    camera.cameraObject.camera.depthTextureMode = DepthTextureMode.Depth;
                    camera.cameraObject.camera.Render();

                    if (this.SlicePostRenderCallback != null)
                    {
                        this.SlicePostRenderCallback(camera);
                    }
                }
            }
            if (this.AllPostRenderCallback != null)
            {
                this.AllPostRenderCallback(projector);
            }
        }

        ////////////////////////////////////
        // Track the follow camera object //
        ////////////////////////////////////
        if (_sliceCameraParent)
        {
            if (_followCamera)
            {
                Vector3 p = _followCamera.transform.position;
                p.y += 5.0f;
                _sliceCameraParent.transform.position    = p;
                _sliceCameraParent.transform.eulerAngles = _followCamera.transform.eulerAngles;
            }
            else
            {
                _sliceCameraParent.transform.position    = _masterCamera.transform.position;
                _sliceCameraParent.transform.eulerAngles = _masterCamera.transform.eulerAngles;
            }
        }
    }