From d251fe844293635f1a4097b29279e1cacfb0da55 Mon Sep 17 00:00:00 2001 From: Ben Date: Sun, 12 Jan 2025 20:13:49 -0800 Subject: [PATCH] Divide pi out of light color This should have been updated in https://github.com/godotengine/godot-docs/pull/7568 --- tutorials/shaders/shader_reference/spatial_shader.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/shaders/shader_reference/spatial_shader.rst b/tutorials/shaders/shader_reference/spatial_shader.rst index 9bb37e4da94..4886ade0546 100644 --- a/tutorials/shaders/shader_reference/spatial_shader.rst +++ b/tutorials/shaders/shader_reference/spatial_shader.rst @@ -434,7 +434,7 @@ Below is an example of a custom ``light()`` function using a Lambertian lighting .. code-block:: glsl void light() { - DIFFUSE_LIGHT += clamp(dot(NORMAL, LIGHT), 0.0, 1.0) * ATTENUATION * LIGHT_COLOR; + DIFFUSE_LIGHT += clamp(dot(NORMAL, LIGHT), 0.0, 1.0) * ATTENUATION * LIGHT_COLOR / PI; } If you want the lights to add together, add the light contribution to ``DIFFUSE_LIGHT`` using ``+=``, rather than overwriting it.