2
0
Эх сурвалжийг харах

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

Chaosus 9 сар өмнө
parent
commit
212ce6746d

+ 2 - 1
tutorials/shaders/shader_reference/canvas_item_shader.rst

@@ -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

+ 2 - 2
tutorials/shaders/shader_reference/shading_language.rst

@@ -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