Beispiel #1
0
        public void LinearizeDepth(RenderTargetSurface dst, ShaderResource src)
        {
            throw new NotImplementedException();
                #if false
            Debug.Assert(Game.IsServiceExist <Camera>());

            var camera = Game.GetService <Camera>();

            bufLinearizeDepth.Data.linearizeDepthA = 1.0f / camera.FrustumZFar - 1.0f / camera.FrustumZNear;
            bufLinearizeDepth.Data.linearizeDepthB = 1.0f / camera.FrustumZNear;
            bufLinearizeDepth.UpdateCBuffer();


            var isDepthMSAA = (src.SampleCount > 1);
            var depthShader = (int)(isDepthMSAA ? ShaderFlags.RESOLVE_AND_LINEARIZE_DEPTH_MSAA : ShaderFlags.LINEARIZE_DEPTH);

            string signature;

            SetDefaultRenderStates();

            using (new PixEvent()) {
                bufLinearizeDepth.SetCBufferPS(0);

                shaders.SetPixelShader(depthShader);
                shaders.SetVertexShader(depthShader);

                dst.SetViewport();
                device.SetRenderTargets(dst);
                src.SetPS(0);

                device.Draw(Primitive.TriangleList, 3, 0);
            }
            device.ResetStates();
                #endif
        }