RasterizerState.SlopeScaleDepthBias Property

Gets or sets a bias value that takes into account the slope of a polygon. This bias value is applied to coplanar primitives to reduce aliasing and other rendering artifacts caused by z-fighting. The default is 0.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Syntax

public float SlopeScaleDepthBias { get; set; }

Property Value

The sloped scale bias value.

Remarks

An application can help ensure that coplanar polygons are rendered properly by adding a bias to the z-values that the system uses when rendering sets of coplanar polygons. The following formula shows how to calculate the bias to be applied to coplanar primitives.

bias = (m × SlopeScaleDepthBias) + DepthBias

Where m is the maximum depth slope of the triangle being rendered, defined as:

m = max( abs(delta z / delta x), abs(delta z / delta y) )

See Also

Reference

RasterizerState Class
RasterizerState Members
Microsoft.Xna.Framework.Graphics Namespace

Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP