From 57314d888a62e2d4e90d6e5e4fe2a49c148d2ed2 Mon Sep 17 00:00:00 2001 From: Glatzemann Date: Sun, 4 Dec 2011 08:10:48 +0000 Subject: [PATCH] Fixed issue #472. The wrong default depth value was in DirectX10 depth buffer. --- .../ANX.Framework.Windows.DX10/GraphicsDeviceWindowsDX10.cs | 2 ++ Samples/VertexIndexBuffer/Game1.cs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/RenderSystems/ANX.Framework.Windows.DX10/GraphicsDeviceWindowsDX10.cs b/RenderSystems/ANX.Framework.Windows.DX10/GraphicsDeviceWindowsDX10.cs index 7fb26f0c..90319be4 100644 --- a/RenderSystems/ANX.Framework.Windows.DX10/GraphicsDeviceWindowsDX10.cs +++ b/RenderSystems/ANX.Framework.Windows.DX10/GraphicsDeviceWindowsDX10.cs @@ -176,6 +176,8 @@ namespace ANX.Framework.Windows.DX10 this.depthStencilBuffer = new SharpDX.Direct3D10.Texture2D(device, depthStencilTextureDesc); this.depthStencilView = new DepthStencilView(device, this.depthStencilBuffer); + + Clear(ClearOptions.DepthBuffer | ClearOptions.Stencil, Vector4.Zero, 1.0f, 0); //TODO: this workaround is working but maybe not the best solution to issue #472 } } diff --git a/Samples/VertexIndexBuffer/Game1.cs b/Samples/VertexIndexBuffer/Game1.cs index 6cf0a635..5746be80 100644 --- a/Samples/VertexIndexBuffer/Game1.cs +++ b/Samples/VertexIndexBuffer/Game1.cs @@ -119,8 +119,8 @@ namespace VertexIndexBuffer protected override void Draw(GameTime gameTime) { - //GraphicsDevice.Clear(Color.CornflowerBlue); - GraphicsDevice.Clear(ClearOptions.Target | ClearOptions.DepthBuffer | ClearOptions.Stencil, Color.CornflowerBlue, 1.0f, 0); + GraphicsDevice.Clear(Color.CornflowerBlue); + //GraphicsDevice.Clear(ClearOptions.Target | ClearOptions.DepthBuffer | ClearOptions.Stencil, Color.CornflowerBlue, 1.0f, 0); miniTriEffect.CurrentTechnique.Passes[0].Apply();