private void InitializeAnaglyphVirtualRealityProvider()
        {
            DisposeCurrentVirtualRealityProvider();


            _anaglyphVirtualRealityProvider = new AnaglyphVirtualRealityProvider(eyeSeparation: 0.07f, // 70 mm
                                                                                 parallax: 0.6f,
                                                                                 anaglyphColorTransformation: AnaglyphVirtualRealityProvider.OptimizedAnaglyph);

            TitleTextBlock.Text = "Anaglyph stereoscopic rendering for red and cyan glasses";

            ProviderSettingsTextBlock.Text = "Anaglyph type:";

            // AnaglyphVirtualRealityProvider defines some predefined types of anaglyph rendering - so called ColorTransformations
            // Use reflection to read all possible types and fill the ColorTransformTypeComboBox with them
            FillAvailableColorTransformTypes(ProviderSettingsComboBox);


            _currentVirtualRealityProvider = _anaglyphVirtualRealityProvider;

            if (MainDXViewportView.DXScene != null && MainDXViewportView.UsedGraphicsProfile.DriverType != GraphicsProfile.DriverTypes.Wpf3D)
            {
                MainDXViewportView.DXScene.InitializeVirtualRealityRendering(_currentVirtualRealityProvider);
            }


            _providerSettingsChangedAction = delegate(ComboBoxItem selectedItem)
            {
                var anaglyphColorTransformation = selectedItem.Tag as AnaglyphVirtualRealityProvider.AnaglyphColorTransformation;

                if (anaglyphColorTransformation != null)
                {
                    _anaglyphVirtualRealityProvider.ColorTransformation = anaglyphColorTransformation;
                }
            };

            SeparationDistancePanel.Visibility = Visibility.Collapsed;
        }
        private void InitializeSplitScreenVirtualRealityProvider()
        {
            DisposeCurrentVirtualRealityProvider();


            _splitScreenVirtualRealityProvider = new SplitScreenVirtualRealityProvider(eyeSeparation: 0.07f, // 70 mm
                                                                                       parallax: 0.6f,
                                                                                       splitScreen: SplitScreenVirtualRealityProvider.SplitScreenType.SideBySide);

            _splitScreenVirtualRealityProvider.ImagesSeparationDistance = 42; // Based on observations, the 42 works best for 3D TV (this value might be different for your 3D TV; see comments in the (i) info icon)
            UpdateSeparationDistanceText();

            TitleTextBlock.Text = "Split screen stereoscopic rendering for 3D TV";

            ProviderSettingsTextBlock.Text = "Split type:";


            ProviderSettingsComboBox.Items.Clear();
            ProviderSettingsComboBox.Items.Add(new ComboBoxItem()
            {
                Content = "Side by side (vertical)",
                Tag     = SplitScreenVirtualRealityProvider.SplitScreenType.SideBySide
            });
            ProviderSettingsComboBox.Items.Add(new ComboBoxItem()
            {
                Content = "Top and bottom (horizontal)",
                Tag     = SplitScreenVirtualRealityProvider.SplitScreenType.TopAndBottom
            });

            ProviderSettingsComboBox.SelectedIndex = 0;

            _currentVirtualRealityProvider = _splitScreenVirtualRealityProvider;

            if (MainDXViewportView.DXScene != null && MainDXViewportView.UsedGraphicsProfile.DriverType != GraphicsProfile.DriverTypes.Wpf3D)
            {
                MainDXViewportView.DXScene.InitializeVirtualRealityRendering(_currentVirtualRealityProvider);
            }

            _providerSettingsChangedAction = delegate(ComboBoxItem selectedItem)
            {
                if (selectedItem.Tag is SplitScreenVirtualRealityProvider.SplitScreenType)
                {
                    var splitScreenType = (SplitScreenVirtualRealityProvider.SplitScreenType)selectedItem.Tag;
                    _splitScreenVirtualRealityProvider.SplitScreen = splitScreenType;

                    // When the split screen type is changed from SideBySide to TopAndBottom,
                    // we should divide the current ImagesSeparationDistance by two.
                    // Similarity, we need to duplicate the ImagesSeparationDistance when changed from TopAndBottom to SideBySide
                    if (splitScreenType == SplitScreenVirtualRealityProvider.SplitScreenType.TopAndBottom)
                    {
                        _splitScreenVirtualRealityProvider.ImagesSeparationDistance = (int)(_splitScreenVirtualRealityProvider.ImagesSeparationDistance / 2);
                    }
                    else
                    {
                        _splitScreenVirtualRealityProvider.ImagesSeparationDistance = 2 * _splitScreenVirtualRealityProvider.ImagesSeparationDistance;
                    }

                    UpdateSeparationDistanceText();
                }
            };

            SeparationDistancePanel.Visibility = Visibility.Visible;
        }