Пример #1
0
        public static D3D.DepthStencilState CreateDepthStencilState(this D3D.Device device, D3D.Comparison comparison, D3D.StencilOperation failOperation, D3D.StencilOperation passOperation)
        {
            var operationDesc = new D3D.DepthStencilOperationDescription()
            {
                Comparison         = comparison,
                DepthFailOperation = D3D.StencilOperation.Keep,
                FailOperation      = failOperation,
                PassOperation      = passOperation,
            };
            var depthStencilDesc = new D3D.DepthStencilStateDescription()
            {
                IsDepthEnabled   = false,
                IsStencilEnabled = true,
                StencilReadMask  = byte.MaxValue,
                StencilWriteMask = byte.MaxValue,
                FrontFace        = operationDesc,
                BackFace         = operationDesc,
            };

            return(new D3D.DepthStencilState(device, depthStencilDesc));
        }
Пример #2
0
 public static D3D.DepthStencilState CreateDepthStencilState(this D3D.Device device, D3D.Comparison comparison, D3D.StencilOperation failOperation, D3D.StencilOperation passOperation)
 {
     var operationDesc = new D3D.DepthStencilOperationDescription()
     {
         Comparison = comparison,
         DepthFailOperation = D3D.StencilOperation.Keep,
         FailOperation = failOperation,
         PassOperation = passOperation,
     };
     var depthStencilDesc = new D3D.DepthStencilStateDescription()
     {
         IsDepthEnabled = false,
         IsStencilEnabled = true,
         StencilReadMask = byte.MaxValue,
         StencilWriteMask = byte.MaxValue,
         FrontFace = operationDesc,
         BackFace = operationDesc,
     };
     return new D3D.DepthStencilState(device, depthStencilDesc);
 }