Skip to content

Commit a766184

Browse files
authored
Merge pull request godotengine#8015 from thygrrr/shader-example-lighting-fix
Update spatial_shader.rst
2 parents 4b6e15d + bd7eb30 commit a766184

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)