예제 #1
0
            // Get a DisplayConfig object from the server via ClientKit.
            // Setup stereo rendering with DisplayConfig data.
            void SetupDisplay()
            {
                //get the DisplayConfig object from ClientKit
                if (_clientKit.context == null)
                {
                    Debug.LogError("ClientContext is null. Can't setup display.");
                    return;
                }
                _displayConfig = _clientKit.context.GetDisplayConfig();
                if (_displayConfig == null)
                {
                    return;
                }
                _displayConfigInitialized = true;

                SetupRenderManager();

                //get the number of viewers, bail if there isn't exactly one viewer for now
                _viewerCount = _displayConfig.GetNumViewers();
                if (_viewerCount != 1)
                {
                    Debug.LogError(_viewerCount + " viewers found, but this implementation requires exactly one viewer.");
                    return;
                }

                //Set Unity player resolution
                SetResolution();

                //create scene objects
                CreateHeadAndEyes();
                SetRenderParams();
            }
예제 #2
0
            // Get a DisplayConfig object from the server via ClientKit.
            // Setup stereo rendering with DisplayConfig data.
            void Init()
            {
                //get the DisplayConfig object from ClientKit
                if (_clientKit == null || _clientKit.context == null)
                {
                    if (!_osvrClientKitError)
                    {
                        Debug.LogError("[OSVR-Unity] ClientContext is null. Can't setup display.");
                        _osvrClientKitError = true;
                    }
                    return;
                }
                SetVRAppSettings();

                _displayConfig = _clientKit.context.GetDisplayConfig();
                if (_displayConfig == null)
                {
                    return;
                }
                _displayConfigInitialized = true;

                InitRenderManager();
                if (!_renderManagerConfigFound || RenderManager == null)
                {
                    return;
                }
                SetupStereoCamerarig();
                SetResolution();
                CreateRenderTextures();

                //create RenderBuffers in RenderManager
                if (_renderManagerConfigFound && RenderManager != null)
                {
                    RenderManager.ConstructBuffers();
                }
                SetRenderParams();
            }
            //Get a DisplayConfig object from the server via ClientKit.
            //Setup stereo rendering with DisplayConfig data.
            void SetupDisplay()
            {
                //get the DisplayConfig object from ClientKit
                if(_clientKit.context == null)
                {
                    Debug.LogError("ClientContext is null. Can't setup display.");
                    return;
                }
                _displayConfig = _clientKit.context.GetDisplayConfig();
                if (_displayConfig == null)
                {
                    return;
                }
                _displayConfigInitialized = true;

                //get the number of viewers, bail if there isn't exactly one viewer for now
                _viewerCount = _displayConfig.GetNumViewers();
                if(_viewerCount != 1)
                {
                    Debug.LogError(_viewerCount + " viewers found, but this implementation requires exactly one viewer.");
                    return;
                }
                //create scene objects
                CreateHeadAndEyes();
            }