mirror of
https://github.com/stan220/godot-docs.git
synced 2026-09-08 17:28:58 +00:00
Merge pull request #8015 from thygrrr/shader-example-lighting-fix
Update spatial_shader.rst
This commit is contained in:
@@ -401,7 +401,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.
|
||||
|
||||
Reference in New Issue
Block a user