瀏覽代碼

Merge pull request #10499 from bmolyneaux/patch-1

Divide pi out of light color
A Thousand Ships 8 月之前
父節點
當前提交
6176ad53e6
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      tutorials/shaders/shader_reference/spatial_shader.rst

+ 1 - 1
tutorials/shaders/shader_reference/spatial_shader.rst

@@ -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.