public void Shutdown()
 {
     ShaderResourceView?.Dispose();
     ShaderResourceView = null;
     RenderTargetView?.Dispose();
     RenderTargetView = null;
     RenderTargetTexture?.Dispose();
     RenderTargetTexture = null;
 }
Пример #2
0
 public void Shutdown()
 {
     DepthStencilView?.Dispose();
     DepthStencilView = null;
     DepthStencilBuffer?.Dispose();
     DepthStencilBuffer = null;
     ShaderResourceView?.Dispose();
     ShaderResourceView = null;
     RenderTargetView?.Dispose();
     RenderTargetView = null;
     RenderTargetTexture?.Dispose();
     RenderTargetTexture = null;
 }
Пример #3
0
        public void Shutdown()
        {
            if (ShaderResourceView != null)
            {
                ShaderResourceView.Dispose();
                ShaderResourceView = null;
            }

            if (RenderTargetView != null)
            {
                RenderTargetView.Dispose();
                RenderTargetView = null;
            }

            if (RenderTargetTexture != null)
            {
                RenderTargetTexture.Dispose();
                RenderTargetTexture = null;
            }
        }
Пример #4
0
        public void CaptureMegaShot(string filename, int width, int height)
        {

            megaHeight = height;
            megaWidth = width;
            megaFrameDump = true;

            RenderTargetTexture megaTextureAA = new RenderTargetTexture(width, height);
            RenderTargetTexture megaTexture = new RenderTargetTexture(width, height, 1);

            DepthBuffer megaZbuffer = new DepthBuffer(width, height);

            while (true)
            {

                if (RenderContext11.MultiSampleCount > 1)
                {
                    // When MSAA is enabled, we render each face to the same multisampled render target,
                    // then resolve to a different texture for each face. This saves memory and works around
                    // the fact that multisample textures are not permitted to have mipmaps.
                    RenderFrame(megaTextureAA.renderView, megaZbuffer.DepthView, RenderTypes.Normal, width, height);

                    RenderContext11.PrepDevice.ImmediateContext.ResolveSubresource(megaTextureAA.RenderTexture.Texture, 0,
                                                                                  megaTexture.RenderTexture.Texture, 0,
                                                                                  RenderContext11.DefaultColorFormat);
                }
                else
                {
                    RenderFrame(megaTexture.renderView, megaZbuffer.DepthView, RenderTypes.Normal, width, height);
                }

                if (TileCache.QueuePercent == 100)
                {
                    break;
                }

                Application.DoEvents();
            }
            SharpDX.Direct3D11.Texture2D.ToFile(RenderContext11.devContext, megaTexture.RenderTexture.Texture, SharpDX.Direct3D11.ImageFileFormat.Png, filename);
            megaFrameDump = false;
            megaTexture.Dispose();
            megaTextureAA.Dispose();
            megaZbuffer.Dispose();
        }