Skip to content

Commit 6176ad5

Browse files
Merge pull request #10499 from bmolyneaux/patch-1
Divide pi out of light color
2 parents 7207b49 + d251fe8 commit 6176ad5

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
@@ -434,7 +434,7 @@ Below is an example of a custom ``light()`` function using a Lambertian lighting
434434
.. code-block:: glsl
435435
436436
void light() {
437-
DIFFUSE_LIGHT += clamp(dot(NORMAL, LIGHT), 0.0, 1.0) * ATTENUATION * LIGHT_COLOR;
437+
DIFFUSE_LIGHT += clamp(dot(NORMAL, LIGHT), 0.0, 1.0) * ATTENUATION * LIGHT_COLOR / PI;
438438
}
439439
440440
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)