fixed issue #467 (DepthStencilState not settable)

This commit is contained in:
Glatzemann 2011-11-29 14:32:33 +00:00
parent a2baf45eff
commit d4d48ee21b
4 changed files with 22 additions and 12 deletions

View File

@ -85,19 +85,24 @@ namespace ANX.Framework.Graphics
{
nativeDepthStencilState = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateDepthStencilState();
// BackFace
CounterClockwiseStencilDepthBufferFail = StencilOperation.Keep;
CounterClockwiseStencilFail = StencilOperation.Keep;
CounterClockwiseStencilFunction = CompareFunction.Always;
CounterClockwiseStencilPass = StencilOperation.Keep;
// FrontFace
StencilDepthBufferFail = StencilOperation.Keep;
StencilFail = StencilOperation.Keep;
StencilFunction = CompareFunction.Always;
StencilPass = StencilOperation.Keep;
DepthBufferEnable = true;
DepthBufferFunction = CompareFunction.LessEqual;
DepthBufferWriteEnable = true;
ReferenceStencil = 0;
StencilDepthBufferFail = StencilOperation.Keep;
StencilEnable = false;
StencilFunction = CompareFunction.Always;
StencilMask = int.MaxValue;
StencilPass = StencilOperation.Keep;
StencilWriteMask = int.MaxValue;
TwoSidedStencilMode = false;
}
@ -106,19 +111,24 @@ namespace ANX.Framework.Graphics
{
nativeDepthStencilState = AddInSystemFactory.Instance.GetDefaultCreator<IRenderSystemCreator>().CreateDepthStencilState();
// BackFace
CounterClockwiseStencilDepthBufferFail = StencilOperation.Keep;
CounterClockwiseStencilFail = StencilOperation.Keep;
CounterClockwiseStencilFunction = CompareFunction.Always;
CounterClockwiseStencilPass = StencilOperation.Keep;
// FrontFace
StencilDepthBufferFail = StencilOperation.Keep;
StencilFail = StencilOperation.Keep;
StencilFunction = CompareFunction.Always;
StencilPass = StencilOperation.Keep;
DepthBufferEnable = depthBufferEnabled;
DepthBufferFunction = CompareFunction.LessEqual;
DepthBufferWriteEnable = depthBufferWriteEnabled;
ReferenceStencil = 0;
StencilDepthBufferFail = StencilOperation.Keep;
StencilEnable = false;
StencilFunction = CompareFunction.Always;
StencilMask = int.MaxValue;
StencilPass = StencilOperation.Keep;
StencilWriteMask = int.MaxValue;
TwoSidedStencilMode = false;

View File

@ -299,7 +299,7 @@ namespace ANX.Framework.Windows.DX10
device.InputAssembler.PrimitiveTopology = FormatConverter.Translate(primitiveType);
device.Rasterizer.SetViewports(currentViewport);
device.OutputMerger.SetTargets(this.renderView);
device.OutputMerger.SetTargets(this.depthStencilView, this.renderView);
for (int i = 0; i < technique.Description.PassCount; ++i)
{
@ -318,7 +318,7 @@ namespace ANX.Framework.Windows.DX10
// Prepare All the stages
device.InputAssembler.PrimitiveTopology = FormatConverter.Translate(primitiveType);
device.Rasterizer.SetViewports(currentViewport);
device.OutputMerger.SetTargets(this.renderView);
device.OutputMerger.SetTargets(this.depthStencilView, this.renderView);
for (int i = 0; i < technique.Description.PassCount; ++i)
{

View File

@ -32,7 +32,7 @@ using System.Runtime.InteropServices;
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.7.8.0")]
[assembly: AssemblyFileVersion("0.7.8.0")]
[assembly: AssemblyVersion("0.7.9.0")]
[assembly: AssemblyFileVersion("0.7.9.0")]
[assembly: InternalsVisibleTo("ANX.Framework.ContentPipeline")]

View File

@ -81,7 +81,7 @@ namespace StencilBuffer
DepthBufferWriteEnable = true,
DepthBufferFunction = CompareFunction.Always,
ReferenceStencil = 2,
StencilEnable = false,
StencilEnable = true,
StencilPass = StencilOperation.Increment,
};
@ -91,7 +91,7 @@ namespace StencilBuffer
DepthBufferWriteEnable = true,
DepthBufferFunction = CompareFunction.LessEqual,
ReferenceStencil = 1,
StencilEnable = false,
StencilEnable = true,
StencilPass = StencilOperation.Keep,
};