@@ -36,6 +36,11 @@ For visual examples of these render modes, see :ref:`Standard Material 3D and OR
3636+-------------------------------+------------------------------------------------------------------------------------------------------+
3737| **depth_test_disabled ** | Disable depth testing. |
3838+-------------------------------+------------------------------------------------------------------------------------------------------+
39+ | **depth_test_default ** | Depth test will discard the pixel if it is behind other pixels. |
40+ | | In Forward+ only, the pixel is also discarded if it's at the exact same depth as another pixel. |
41+ +-------------------------------+------------------------------------------------------------------------------------------------------+
42+ | **depth_test_inverted ** | Depth test will discard the pixel if it is in front of other pixels. Useful for stencil effects. |
43+ +-------------------------------+------------------------------------------------------------------------------------------------------+
3944| **sss_mode_skin ** | Subsurface Scattering mode for skin (optimizes visuals for human skin, e.g. boosted red channel). |
4045+-------------------------------+------------------------------------------------------------------------------------------------------+
4146| **cull_back ** | Cull back-faces (default). |
@@ -91,6 +96,58 @@ For visual examples of these render modes, see :ref:`Standard Material 3D and OR
9196| **fog_disabled ** | Disable receiving depth-based or volumetric fog. Useful for ``blend_add `` materials like particles. |
9297+-------------------------------+------------------------------------------------------------------------------------------------------+
9398
99+ Stencil modes
100+ -------------
101+
102+ .. note ::
103+
104+ Stencil support is experimental, use at your own risk.
105+ We will try to not break compatibility as much as possible,
106+ but if significant flaws are found in the API, it may change
107+ in the next minor version.
108+
109+ Stencil operations are a set of operations that allow writing to
110+ an efficient buffer in an hardware-accelerated manner.
111+ This is generally used to mask in or out parts of the scene.
112+
113+ Some of the most well-known uses are:
114+
115+ - Outlines: Mask out the inner mesh that is being outlined to avoid inner outlines.
116+ - X-Ray: Display a mesh behind other objects.
117+ - Portals: Draw geometry that is normally "impossible" (non-Euclidian) by masking objects.
118+
119+ .. note ::
120+
121+ You can only read from the stencil buffer in the transparent pass.
122+ Any attempt to read in the opaque pass will fail, as it's currently not supported behavior.
123+
124+ Note that for compositor effects, the main renderer's stencil buffer can't be copied
125+ to a custom texture.
126+
127+ +-------------------------------+------------------------------------------------------------------------------------------------------+
128+ | Stencil mode | Description |
129+ +===============================+======================================================================================================+
130+ | **read ** | Read from the stencil buffer. |
131+ +-------------------------------+------------------------------------------------------------------------------------------------------+
132+ | **write ** | Write reference value to the stencil buffer. |
133+ +-------------------------------+------------------------------------------------------------------------------------------------------+
134+ | **write_if_depth_fail ** | Write reference value to the stencil buffer if the depth test fails. |
135+ +-------------------------------+------------------------------------------------------------------------------------------------------+
136+ | **compare_always ** | Always pass stencil test. |
137+ +-------------------------------+------------------------------------------------------------------------------------------------------+
138+ | **compare_equal ** | Pass stencil test if the reference value is equal to the stencil buffer value. |
139+ +-------------------------------+------------------------------------------------------------------------------------------------------+
140+ | **compare_not_equal ** | Pass stencil test if the reference value is not equal to the stencil buffer value. |
141+ +-------------------------------+------------------------------------------------------------------------------------------------------+
142+ | **compare_less ** | Pass stencil test if the reference value is less than the stencil buffer value. |
143+ +-------------------------------+------------------------------------------------------------------------------------------------------+
144+ | **compare_less_or_equal ** | Pass stencil test if the reference value is less than or equal to the stencil buffer value. |
145+ +-------------------------------+------------------------------------------------------------------------------------------------------+
146+ | **compare_greater ** | Pass stencil test if the reference value is greater than the stencil buffer value. |
147+ +-------------------------------+------------------------------------------------------------------------------------------------------+
148+ | **compare_greater_or_equal ** | Pass stencil test if the reference value is greater than or equal to the stencil buffer value. |
149+ +-------------------------------+------------------------------------------------------------------------------------------------------+
150+
94151Built-ins
95152---------
96153
0 commit comments