@@ -54,6 +54,17 @@ used for rendering things like heads-up displays, which have no relation to the
5454 nodePath.set_depth_test(false); // Disable
5555 nodePath.set_depth_test(true); // Enable
5656
57+ .. note ::
58+
59+ Disabling the depth-test with ``setDepthTest(False) `` also implicitly
60+ disables depth-writes, regardless of the current depth-write setting. This
61+ is because the graphics hardware ties both behaviors to the same comparison
62+ function: turning the comparison off disables writes as a side effect. If
63+ you want geometry to continue writing to the depth buffer while ignoring
64+ the existing depth values, leave depth-test enabled and instead use
65+ ``DepthTestAttrib `` with ``M_always `` (see below), which always passes the
66+ test but still allows depth-writes to occur.
67+
5768One can remove these settings using :meth: `~.NodePath.clear_depth_test() ` and
5869:meth: `~.NodePath.clear_depth_write() `.
5970
@@ -96,6 +107,12 @@ the following variants:
96107 nodePath.set_attrib(DepthTestAttrib::make(RenderAttrib::M_not_equal));
97108 nodePath.set_attrib(DepthTestAttrib::make(RenderAttrib::M_always));
98109
110+ The ``M_none `` mode is equivalent to calling ``setDepthTest(False) `` and, as
111+ noted above, disables depth-writes as well. To keep depth-writes active while
112+ having the depth test unconditionally pass, use ``M_always `` instead: this
113+ configures the comparison to succeed for every fragment, so the depth buffer
114+ will still be updated if depth-write is enabled.
115+
99116Depth Sorting
100117-------------
101118
0 commit comments