Skip to content

Commit

Permalink
Material: document disabling depth test disables depth write caveat. (#…
Browse files Browse the repository at this point in the history
…27000)

When setting the `depthTest` flag of a material to false, this will also implicitly disable the depth write, because `glDisable(GL_DEPTH_TEST)` is called internally. 

See: https://www.khronos.org/opengl/wiki/Depth_Test
> When depth testing is disabled, writes to the depth buffer are also disabled. 

While the behavior makes sense I think (`depthFunc` can be used to achieve the desired behavior), it caught me off guard, so I thought it would make sense to document it.
  • Loading branch information
fleroviux committed Oct 18, 2023
1 parent 41ec501 commit b9081bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/api/en/materials/Material.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ <h3>[property:Integer depthFunc]</h3>
<h3>[property:Boolean depthTest]</h3>
<p>
Whether to have depth test enabled when rendering this material. Default
is `true`.
is `true`. When the depth test is disabled, the depth write will also be
implicitly disabled.
</p>

<h3>[property:Boolean depthWrite]</h3>
Expand Down

0 comments on commit b9081bb

Please sign in to comment.