void CreateViewport()
            {
                int index = instance.views.IndexOf(this);

                DestroyViewport();

                Vec2I textureSize = GetNeededTextureSize();

                string textureName = TextureManager.Instance.GetUniqueName(
                    string.Format("MultiViewRendering{0}", index));
                PixelFormat format = PixelFormat.R8G8B8;

                int fsaa;

                if (!int.TryParse(RendererWorld.InitializationOptions.FullSceneAntialiasing, out fsaa))
                {
                    fsaa = 0;
                }

                texture = TextureManager.Instance.Create(textureName, Texture.Type.Type2D,
                                                         textureSize, 1, 0, format, Texture.Usage.RenderTarget, false, fsaa);
                if (texture == null)
                {
                    Log.Fatal("MultiViewRenderingManager: Unable to create texture.");
                    return;
                }

                RenderTarget renderTarget = texture.GetBuffer().GetRenderTarget();

                renderTarget.AutoUpdate          = true;
                renderTarget.AllowAdditionalMRTs = true;

                //create camera
                camera = SceneManager.Instance.CreateCamera(
                    SceneManager.Instance.GetUniqueCameraName(string.Format("MultiViewRendering{0}", index)));
                camera.Purpose = Camera.Purposes.MainCamera;

                //add viewport
                viewport = renderTarget.AddViewport(camera, 0);
                viewport.ShadowsEnabled = true;

                //Create compositor for HDR render technique
                bool hdrCompositor =
                    RendererWorld.Instance.DefaultViewport.GetCompositorInstance("HDR") != null;

                if (hdrCompositor)
                {
                    viewport.AddCompositor("HDR");
                    viewport.SetCompositorEnabled("HDR", true);
                }

                //FXAA antialiasing post effect
                bool fxaaCompositor =
                    RendererWorld.Instance.DefaultViewport.GetCompositorInstance("FXAA") != null;

                if (fxaaCompositor)
                {
                    viewport.AddCompositor("FXAA");
                    viewport.SetCompositorEnabled("FXAA", true);
                }

                //add listener
                renderTargetListener = new ViewRenderTargetListener(this);
                renderTarget.AddListener(renderTargetListener);

                initializedTextureSize = textureSize;
            }