From 843ce4056caef680f8bc610c62f9d9ab15097633 Mon Sep 17 00:00:00 2001 From: PoolloverNathan <24194027+PoolloverNathan@users.noreply.github.com> Date: Fri, 17 Mar 2023 21:32:42 -0400 Subject: [PATCH] doc_converting_glsl_to_godot_shaders/Macros: Replace text about migrating macros with a short list of supported macros --- .../shaders/converting_glsl_to_godot_shaders.rst | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tutorials/shaders/converting_glsl_to_godot_shaders.rst b/tutorials/shaders/converting_glsl_to_godot_shaders.rst index c812baf13f5..56fcf49c600 100644 --- a/tutorials/shaders/converting_glsl_to_godot_shaders.rst +++ b/tutorials/shaders/converting_glsl_to_godot_shaders.rst @@ -74,13 +74,11 @@ rename ``main`` to ``fragment``. Macros ^^^^^^ -In keeping with its similarity to C, GLSL lets you use macros. Commonly -``#define`` is used to define constants or small functions. There is no -straightforward way to translate defines to Godot's shading language. If it is a -function that is defined, then replace with a function, and if it is a constant, -then replace with a uniform. For other macros (``#if``, ``#ifdef``, etc.), there -is no equivalent because they run during the pre-processing stage of -compilation. +The :ref:`Godot shader preprocessor` supports the following macros: +* ``#define`` / ``#undef`` +* ``#if``, ``#elif``, ``#else``, ``#endif``, ``defined()``, ``#ifdef``, ``#ifndef`` +* ``#include`` (only ``.gdshaderinc`` files and with a maximum depth of 25) +* ``#pragma disable_preprocessor``, which disables preprocessing for the rest of the file Variables ^^^^^^^^^