mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
Divide pi out of light color
This should have been updated in https://github.com/godotengine/godot-docs/pull/7568
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user