mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
Merge branch 'master' into 3.2
This commit is contained in:
@@ -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
|
||||
^^^^
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user