Merge branch 'master' into 3.2

This commit is contained in:
Rémi Verschelde
2020-07-06 14:23:58 +02:00
18 changed files with 103 additions and 37 deletions

View File

@@ -70,8 +70,8 @@ fragment shader, rename ``main`` to ``fragment``.
Constants
^^^^^^^^^
Godot currently does not support constants. You can fake the functionality by using a uniform initialized
to the value, but you will not benefit from the increased speed from using a constant.
Global array constants are not supported in Godot 3.2.x. You can fake the functionality by using a uniform
initialized to the value, but you will not benefit from the increased speed from using a constant.
Macros
^^^^^^
@@ -133,7 +133,7 @@ Types
^^^^^
Shadertoy uses the webgl spec, so it runs a slightly different version of GLSL. However, it still
has the regular types, including `Constants`_ and macros.
has the regular types, including constants and macros.
mainImage
^^^^^^^^^
@@ -200,7 +200,7 @@ Types
^^^^^
The Book of Shaders uses the webgl spec, so it runs a slightly different version of GLSL. However, it still
has the regular types, including `Constants`_ and macros.
has the regular types, including constants and macros.
Main
^^^^

View File

@@ -293,7 +293,7 @@ Below is an example of a custom light function using a Lambertian lighting model
.. code-block:: glsl
void light() {
DIFFUSE_LIGHT += dot(NORMAL, LIGHT) * ATTENUATION * ALBEDO;
DIFFUSE_LIGHT += clamp(dot(NORMAL, LIGHT), 0.0, 1.0) * ATTENUATION * ALBEDO;
}
If you want the lights to add together, add the light contribution to ``DIFFUSE_LIGHT`` using ``+=``, rather than overwriting it.