mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-15 15:06:16 +08:00
Reversed depth buffer
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user