From ae2bdfd44eb1439cf2656f058a81671dcfc152df Mon Sep 17 00:00:00 2001 From: Thygrrr Date: Sat, 23 Sep 2023 13:00:40 +0200 Subject: [PATCH] Update spatial_shader.rst The reference page suggests a very unfortunate lighting function that modulades the color values in ALBEDO again. This does not seem representative of the shading model. Also, it omitted LIGHT_COLOR; repalcing the ALBEDO term with LIGHT_COLOR gives a much more expected diffuse lighting example. --- 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 0a2b747fb..fed59da0b 100644 --- a/tutorials/shaders/shader_reference/spatial_shader.rst +++ b/tutorials/shaders/shader_reference/spatial_shader.rst @@ -399,7 +399,7 @@ Below is an example of a custom light function using a Lambertian lighting model .. code-block:: glsl void light() { - DIFFUSE_LIGHT += clamp(dot(NORMAL, LIGHT), 0.0, 1.0) * ATTENUATION * ALBEDO; + DIFFUSE_LIGHT += clamp(dot(NORMAL, LIGHT), 0.0, 1.0) * ATTENUATION * LIGHT_COLOR; } If you want the lights to add together, add the light contribution to ``DIFFUSE_LIGHT`` using ``+=``, rather than overwriting it.