Reversed depth buffer

This commit is contained in:
dexy
2019-12-01 20:17:14 +11:00
Unverified
parent 7fb07e1a27
commit 442d623302
9 changed files with 43 additions and 49 deletions
+2 -2
View File
@@ -322,11 +322,11 @@ namespace CodeWalker.Rendering
public void ClearRenderTarget(DeviceContext ctx)
{
ctx.ClearRenderTargetView(targetview, clearcolour);
ctx.ClearDepthStencilView(depthview, DepthStencilClearFlags.Depth, 1.0f, 0);
ctx.ClearDepthStencilView(depthview, DepthStencilClearFlags.Depth, 0.0f, 0);
}
public void ClearDepth(DeviceContext ctx)
{
ctx.ClearDepthStencilView(depthview, DepthStencilClearFlags.Depth, 1.0f, 0);
ctx.ClearDepthStencilView(depthview, DepthStencilClearFlags.Depth, 0.0f, 0);
}
public void SetDefaultRenderTarget(DeviceContext ctx)
{
+3 -3
View File
@@ -176,16 +176,16 @@ namespace CodeWalker.Rendering
{
BackFace = new DepthStencilOperationDescription()
{
Comparison = Comparison.LessEqual,
Comparison = Comparison.GreaterEqual,
DepthFailOperation = StencilOperation.Zero,
FailOperation = StencilOperation.Zero,
PassOperation = StencilOperation.Zero,
},
DepthComparison = Comparison.LessEqual,
DepthComparison = Comparison.GreaterEqual,
DepthWriteMask = DepthWriteMask.All,
FrontFace = new DepthStencilOperationDescription()
{
Comparison = Comparison.LessEqual,
Comparison = Comparison.GreaterEqual,
DepthFailOperation = StencilOperation.Zero,
FailOperation = StencilOperation.Zero,
PassOperation = StencilOperation.Zero
+4 -4
View File
@@ -380,7 +380,7 @@ namespace CodeWalker.Rendering
context.ClearRenderTargetView(MSRTV, colour);
if (UseDepth)
{
context.ClearDepthStencilView(MSDSV, DepthStencilClearFlags.Depth, 1.0f, 0);
context.ClearDepthStencilView(MSDSV, DepthStencilClearFlags.Depth, 0.0f, 0);
}
}
else
@@ -388,7 +388,7 @@ namespace CodeWalker.Rendering
context.ClearRenderTargetView(RTV, colour);
if (UseDepth)
{
context.ClearDepthStencilView(DSV, DepthStencilClearFlags.Depth, 1.0f, 0);
context.ClearDepthStencilView(DSV, DepthStencilClearFlags.Depth, 0.0f, 0);
}
}
}
@@ -398,11 +398,11 @@ namespace CodeWalker.Rendering
if (!UseDepth) return;
if (Multisampled)
{
context.ClearDepthStencilView(MSDSV, DepthStencilClearFlags.Depth, 1.0f, 0);
context.ClearDepthStencilView(MSDSV, DepthStencilClearFlags.Depth, 0.0f, 0);
}
else
{
context.ClearDepthStencilView(DSV, DepthStencilClearFlags.Depth, 1.0f, 0);
context.ClearDepthStencilView(DSV, DepthStencilClearFlags.Depth, 0.0f, 0);
}
}