Skip to content

Commit 2de3798

Browse files
authored
Merge pull request godotengine#7007 from PoolloverNathan/issue/godotengine/7006
2 parents 0b41170 + 843ce40 commit 2de3798

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

tutorials/shaders/converting_glsl_to_godot_shaders.rst

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,11 @@ rename ``main`` to ``fragment``.
7474
Macros
7575
^^^^^^
7676

77-
In keeping with its similarity to C, GLSL lets you use macros. Commonly
78-
``#define`` is used to define constants or small functions. There is no
79-
straightforward way to translate defines to Godot's shading language. If it is a
80-
function that is defined, then replace with a function, and if it is a constant,
81-
then replace with a uniform. For other macros (``#if``, ``#ifdef``, etc.), there
82-
is no equivalent because they run during the pre-processing stage of
83-
compilation.
77+
The :ref:`Godot shader preprocessor<doc_shader_preprocessor>` supports the following macros:
78+
* ``#define`` / ``#undef``
79+
* ``#if``, ``#elif``, ``#else``, ``#endif``, ``defined()``, ``#ifdef``, ``#ifndef``
80+
* ``#include`` (only ``.gdshaderinc`` files and with a maximum depth of 25)
81+
* ``#pragma disable_preprocessor``, which disables preprocessing for the rest of the file
8482

8583
Variables
8684
^^^^^^^^^

0 commit comments

Comments
 (0)