CompareMode

The method used to compare z values when deciding how to overlap rendered objects. This is called the "depth test", and it happens on a pixel-by-pixel basis every time new objects are drawn. If the depth test "passes" for a pixel, then the pixel color will be replaced by the new color and the depth value in the depth buffer will be updated. Otherwise, the pixel will not be changed and the depth value will not be updated.

ValueDescription
equalThe depth test passes when the depth values are equal.
notequalThe depth test passes when the depth values are not equal.
lessThe depth test passes when the new depth value is less than the existing one.
lequalThe depth test passes when the new depth value is less than or equal to the existing one.
gequalThe depth test passes when the new depth value is greater than or equal to the existing one.
greaterThe depth test passes when the new depth value is greater than the existing one.

See also