Example #1
0
            //this function copies the distortion shader from the original Shader attached to VRHead
            private void CopyDistortionShader(OsvrDistortion original, GameObject destination)
            {
                OsvrDistortion d = destination.AddComponent <OsvrDistortion>();

                d.distortionShader = original.distortionShader;
                d.k1Red            = original.k1Red;
                d.k1Blue           = original.k1Blue;
                d.k1Green          = original.k1Green;
                d.leftCenter       = original.leftCenter;
                d.rightCenter      = original.rightCenter;
                d.fullCenter       = original.fullCenter;
                d.enabled          = true;
            }
Example #2
0
 //this function copies the distortion shader from the original Shader attached to VRHead
 private void CopyDistortionShader(OsvrDistortion original, GameObject destination)
 {
     //if there is no distortion, don't bother
     if (original.k1Red == 0 && original.k1Green == 0 && original.k1Blue == 0)
     {
         return;
     }
     OsvrDistortion d = destination.AddComponent<OsvrDistortion>();
     d.distortionShader = original.distortionShader;
     d.k1Red = original.k1Red;
     d.k1Blue = original.k1Blue;
     d.k1Green = original.k1Green;
     d.leftCenter = original.leftCenter;
     d.rightCenter = original.rightCenter;
     d.fullCenter = original.fullCenter;
     d.enabled = true;
 }
Example #3
0
 void Start()
 {
     Init();
     CatalogEyes();
     _distortionEffect = GetComponent <OsvrDistortion>();
     if (_distortionEffect != null)
     {
         _distortionEffect.enabled = (viewMode == ViewMode.mono);
     }
     GetDeviceDescription();
     MatchEyes(); //copy camera properties to each eye
     //rotate each eye based on overlap percent, must do this after match eyes
     if (_deviceDescriptor != null)
     {
         SetEyeRotation(_deviceDescriptor.OverlapPercent, _deviceDescriptor.MonocularHorizontal);
         SetEyeRoll(_deviceDescriptor.LeftRoll, _deviceDescriptor.RightRoll);
     }
 }
Example #4
0
            void Start()
            {
                Init();
                CatalogEyes();
                _distortionEffect = GetComponent<OsvrDistortion>();
                if (_distortionEffect != null)
                {
                    _distortionEffect.enabled = (viewMode == ViewMode.mono);
                }

                //update VRHead with info from the display interface if it has been initialized
                //it might not be initialized if it is still loading/parsing a display json file
                //in that case, we will try to initialize asap in the update function
                if (GetComponent<DisplayInterface>().Initialized)
                {
                    UpdateDisplayInterface();
                }
            }
Example #5
0
            //this function copies the distortion shader from the original Shader attached to VRHead
            private void CopyDistortionShader(OsvrDistortion original, GameObject destination)
            {
                //if there is no distortion, don't bother
                if (original.k1Red == 0 && original.k1Green == 0 && original.k1Blue == 0)
                {
                    return;
                }
                OsvrDistortion d = destination.AddComponent <OsvrDistortion>();

                d.distortionShader = original.distortionShader;
                d.k1Red            = original.k1Red;
                d.k1Blue           = original.k1Blue;
                d.k1Green          = original.k1Green;
                d.leftCenter       = original.leftCenter;
                d.rightCenter      = original.rightCenter;
                d.fullCenter       = original.fullCenter;
                d.enabled          = true;
            }
Example #6
0
            void Start()
            {
                Init();
                CatalogEyes();
                _distortionEffect = GetComponent <OsvrDistortion>();
                if (_distortionEffect != null)
                {
                    _distortionEffect.enabled = (viewMode == ViewMode.mono);
                }

                //update VRHead with info from the display interface if it has been initialized
                //it might not be initialized if it is still parsing a display json file
                //in that case, we will try to initialize asap in the update function
                if (GetComponent <DisplayInterface>().Initialized)
                {
                    UpdateDisplayInterface();
                }
            }