Share via


DepthStencilState.DepthBufferWriteEnable Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets a value that indicates whether to enable writing to the depth buffer. The default is true.

Namespace:  Microsoft.Xna.Framework.Graphics
Assembly:  Microsoft.Xna.Framework.Graphics (in Microsoft.Xna.Framework.Graphics.dll)

Syntax

'Declaration
Public Property DepthBufferWriteEnable As Boolean
public bool DepthBufferWriteEnable { get; set; }

Property Value

Type: System.Boolean
true if writing to the depth buffer is enabled; otherwise, false.

Remarks

This property enables an application to prevent the system from updating the depth buffer with new depth values. If false, depth comparisons are still made according to the render state DepthBufferFunction, assuming that depth buffering is taking place, but depth values are not written to the buffer.

Version Information

Silverlight

Supported in: 5

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.