sebban

Untitled

Apr 16th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. HRESULT resultHelper;
  2.  
  3. D3D11_DEPTH_STENCIL_DESC enableDepth;
  4. enableDepth.DepthEnable = true;
  5. enableDepth.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL; // enables writes to the depth buffer
  6. enableDepth.DepthFunc = D3D11_COMPARISON_LESS; //usual depth test is preformed
  7.  
  8. //FrontFace indicates how the stencil buffer works for front facing triangles
  9. //Direct3D, Luna page 376
  10.  
  11. enableDepth.FrontFace.StencilFailOp         = D3D11_STENCIL_OP_KEEP;
  12. enableDepth.FrontFace.StencilDepthFailOp    = D3D11_STENCIL_OP_KEEP;
  13. enableDepth.FrontFace.StencilPassOp         = D3D11_STENCIL_OP_REPLACE;
  14. enableDepth.FrontFace.StencilFunc           = D3D11_COMPARISON_ALWAYS;
  15.  
  16. //BackFace indicates how the stencil buffer works for back facing triangles
  17. //Direct3D, Luna page 376
  18. enableDepth.BackFace.StencilFailOp = D3D11_STENCIL_OP_KEEP;
  19. enableDepth.BackFace.StencilDepthFailOp = D3D11_STENCIL_OP_KEEP;
  20. enableDepth.BackFace.StencilPassOp = D3D11_STENCIL_OP_REPLACE;
  21. enableDepth.BackFace.StencilFunc = D3D11_COMPARISON_ALWAYS;
Advertisement
Add Comment
Please, Sign In to add comment