{{newin (日本語)|[[11.0 (日本語)|11.0]]|110|type=関数}}
Configures depth testing and writing to the depth buffer.

This is low-level functionality designed for use with custom [[love.graphics.newShader|vertex shaders]] and [[Mesh]]es with custom vertex attributes. No higher level APIs are provided to set the depth of 2D graphics such as shapes, lines, and Images.

{{notice|Depth testing and depth writes will have no effect unless the ''depth'' field is set to true in a table passed to [[love.graphics.setCanvas]], or a custom Canvas with a depth [[PixelFormat]] is set in the ''depthstencil'' field in a table passed to [[love.graphics.setCanvas|setCanvas]].}}

{{notice|Writing to the depth buffer is generally incompatible with rendering alpha-blended sprites / images. By default depth is determined by geometry (vertices) instead of texture alpha values, the depth buffer only stores a single depth value per pixel, and alpha blending '''requires''' back-to-front rendering for blending to be correct.}}

== 関数 ==
=== 概要 ===
<source lang="lua">
love.graphics.setDepthMode( comparemode, write  )
</source>
=== 引数 ===
{{param (日本語)|CompareMode|comparemode|Depth comparison mode used for depth testing.}}
{{param (日本語)|boolean|write|Whether to write update / write values to the depth buffer when rendering.}}
=== 返値 ===
ありません。

== 関数 ==
Disables depth testing and depth writes.
=== 概要 ===
<source lang="lua">
love.graphics.setDepthMode( )
</source>
=== 引数 ===
なし。
=== 返値 ===
ありません。

== 関連 ==
* [[parent::love.graphics (日本語)]]
* [[love.graphics.getDepthMode (日本語)]]
* [[love.graphics.setCanvas (日本語)]]
* [[love.graphics.clear (日本語)]]
* [[PixelFormat (日本語)]]
* [[Mesh (日本語)]]
[[Category:Functions (日本語)]]
{{#set:Description=Configures depth testing and writing to the depth buffer.}}
{{#set:Sub-Category=State (日本語)}}

== そのほかの言語 ==
{{i18n (日本語)|love.graphics.setDepthMode}}