Skip to content

Commit f8403f4

Browse files
committed
Note about stage func/discard may be used in custom shader function
1 parent bcfaaaa commit f8403f4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tutorials/shaders/shader_reference/canvas_item_shader.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,8 @@ SDF functions
335335

336336
There are a few additional functions implemented to sample an automatically
337337
generated Signed Distance Field texture. These functions available for the ``fragment()``
338-
and ``light()`` functions of CanvasItem shaders.
338+
and ``light()`` functions of CanvasItem shaders. Custom functions may also use them as long
339+
as they called from supported functions.
339340

340341
The signed distance field is generated from :ref:`class_LightOccluder2D` nodes
341342
present in the scene with the **SDF Collision** property enabled (which is the

tutorials/shaders/shader_reference/shading_language.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,8 @@ information.
597597
Discarding
598598
----------
599599

600-
Fragment and light functions can use the ``discard`` keyword. If used, the
601-
fragment is discarded and nothing is written.
600+
Fragment, light and custom functions (called from fragment or light) can use the
601+
``discard`` keyword. If used, the fragment is discarded and nothing is written.
602602

603603
Beware that ``discard`` has a performance cost when used, as it will prevent the
604604
depth prepass from being effective on any surfaces using the shader. Also, a

0 commit comments

Comments
 (0)