lovr.graphics.setDepthTest

Sets the current depth test. The depth test controls how overlapping objects are rendered.

lovr.graphics.setDepthTest(compareMode, write)

Arguments

NameTypeDefaultDescription
compareModeCompareModenilThe new depth test. Use nil to disable the depth test.
writebooleantrueWhether pixels will have their z value updated when rendered to.

Returns

Nothing

Notes

The depth test is an advanced technique to control how 3D objects overlap each other when they are rendered. It works as follows:

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