lovr.graphics.getDepthTest
Returns the current depth test settings.
compareMode, write = lovr.graphics.getDepthTest()
Arguments
None
Returns
Name | Type | Description |
compareMode | CompareMode | The current comparison method for depth testing. |
write | boolean | Whether pixels will have their z value updated when rendered to. |
Notes
The depth test is an advanced technique to control how 3D objects overlap each other when they are rendered. It works as follows:
- Each pixel keeps track of its z value as well as its color.
- If
write
is enabled when something is drawn, then any pixels that are drawn will have their z values updated. - Additionally, anything drawn will first compare the existing z value of a pixel with the new z
value. The
compareMode
setting determines how this comparison is performed. If the comparison succeeds, the new pixel will overwrite the previous one, otherwise that pixel won't be rendered to.
Smaller z values are closer to the camera.
The default compare mode is lequal
, which usually gives good results for normal 3D rendering.
See also
lovr.graphics.setDepthTest
lovr.graphics