mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-07 02:12:07 +03:00
Note about stage func/discard may be used in custom shader function
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user