Note about stage func/discard may be used in custom shader function

This commit is contained in:
Chaosus
2024-10-24 10:05:26 +03:00
parent bcfaaaafd1
commit 212ce6746d
2 changed files with 4 additions and 3 deletions

View File

@@ -335,7 +335,8 @@ SDF functions
There are a few additional functions implemented to sample an automatically
generated Signed Distance Field texture. These functions available for the ``fragment()``
and ``light()`` functions of CanvasItem shaders.
and ``light()`` functions of CanvasItem shaders. Custom functions may also use them as long
as they called from supported functions.
The signed distance field is generated from :ref:`class_LightOccluder2D` nodes
present in the scene with the **SDF Collision** property enabled (which is the

View File

@@ -597,8 +597,8 @@ information.
Discarding
----------
Fragment and light functions can use the ``discard`` keyword. If used, the
fragment is discarded and nothing is written.
Fragment, light, and custom functions (called from fragment or light) can use the
``discard`` keyword. If used, the fragment is discarded and nothing is written.
Beware that ``discard`` has a performance cost when used, as it will prevent the
depth prepass from being effective on any surfaces using the shader. Also, a