From 0d6f2e87039c63b4c913be52cc8f248a76d04cce Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 13 Jun 2020 19:07:40 +0200 Subject: [PATCH] Document that `light()` functions aren't run if vertex shading is forced See https://github.com/godotengine/godot/issues/39513. --- tutorials/shading/shading_reference/spatial_shader.rst | 7 +++++++ tutorials/shading/your_first_shader/what_are_shaders.rst | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tutorials/shading/shading_reference/spatial_shader.rst b/tutorials/shading/shading_reference/spatial_shader.rst index 50b56545b..b859dfdec 100644 --- a/tutorials/shading/shading_reference/spatial_shader.rst +++ b/tutorials/shading/shading_reference/spatial_shader.rst @@ -298,6 +298,13 @@ Below is an example of a custom light function using a Lambertian lighting model If you want the lights to add together, add the light contribution to ``DIFFUSE_LIGHT`` using ``+=``, rather than overwriting it. +.. warning:: + + The ``light()`` function won't be run if the ``vertex_lighting`` render mode + is enabled, or if + **Rendering > Quality > Shading > Force Vertex Shading** is enabled in the + Project Settings. (It's enabled by default on mobile platforms.) + +-----------------------------------+-----------------------------------------------------+ | Built-in | Description | +===================================+=====================================================+ diff --git a/tutorials/shading/your_first_shader/what_are_shaders.rst b/tutorials/shading/your_first_shader/what_are_shaders.rst index 79756aff8..56ff4e044 100644 --- a/tutorials/shading/your_first_shader/what_are_shaders.rst +++ b/tutorials/shading/your_first_shader/what_are_shaders.rst @@ -90,7 +90,14 @@ between the vertices to provide the values for the ``fragment()`` function. The ``light()`` function runs for every pixel and for every light. It takes variables from the ``fragment()`` function and from previous runs of itself. -For more information about how shaders operate specifically in Godot see the :ref:`Shaders ` doc. +For more information about how shaders operate specifically in Godot, see the :ref:`Shaders ` doc. + +.. warning:: + + The ``light()`` function won't be run if the ``vertex_lighting`` render mode + is enabled, or if + **Rendering > Quality > Shading > Force Vertex Shading** is enabled in the + Project Settings. (It's enabled by default on mobile platforms.) Technical overview ------------------