Skip to content

Commit bd7eb30

Browse files
authored
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.
1 parent 4752803 commit bd7eb30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tutorials/shaders/shader_reference/spatial_shader.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ Below is an example of a custom light function using a Lambertian lighting model
401401
.. code-block:: glsl
402402
403403
void light() {
404-
DIFFUSE_LIGHT += clamp(dot(NORMAL, LIGHT), 0.0, 1.0) * ATTENUATION * ALBEDO;
404+
DIFFUSE_LIGHT += clamp(dot(NORMAL, LIGHT), 0.0, 1.0) * ATTENUATION * LIGHT_COLOR;
405405
}
406406
407407
If you want the lights to add together, add the light contribution to ``DIFFUSE_LIGHT`` using ``+=``, rather than overwriting it.

0 commit comments

Comments
 (0)