|
@@ -102,7 +102,7 @@ Most GLSL ES 3.0 datatypes are supported:
|
|
Comments
|
|
Comments
|
|
~~~~~~~~
|
|
~~~~~~~~
|
|
|
|
|
|
-The shading language supports the same comment syntax as used in C# and C++,
|
|
|
|
|
|
+The shading language supports the same comment syntax as used in C# and C++,
|
|
using ``//`` for single-line comments and ``/* */`` for multi-line comments:
|
|
using ``//`` for single-line comments and ``/* */`` for multi-line comments:
|
|
|
|
|
|
.. code-block:: glsl
|
|
.. code-block:: glsl
|
|
@@ -912,7 +912,7 @@ You can access ``int`` values as a readable dropdown widget using the ``hint_enu
|
|
You can assign explicit values to the ``hint_enum`` uniform using colon syntax similar to GDScript:
|
|
You can assign explicit values to the ``hint_enum`` uniform using colon syntax similar to GDScript:
|
|
|
|
|
|
.. code-block::
|
|
.. code-block::
|
|
-
|
|
|
|
|
|
+
|
|
uniform int character_speed: hint_enum("Slow:30", "Average:60", "Very Fast:200") = 60;
|
|
uniform int character_speed: hint_enum("Slow:30", "Average:60", "Very Fast:200") = 60;
|
|
|
|
|
|
The value will be stored as an integer, corresponding to the index of the selected
|
|
The value will be stored as an integer, corresponding to the index of the selected
|
|
@@ -1058,7 +1058,7 @@ Per-instance uniforms
|
|
|
|
|
|
.. note::
|
|
.. note::
|
|
|
|
|
|
- Per-instance uniforms are only available in ``spatial`` (3D) shaders.
|
|
|
|
|
|
+ Per-instance uniforms are available in both ``canvas_item`` (2D) and ``spatial`` (3D) shaders.
|
|
|
|
|
|
Sometimes, you want to modify a parameter on each node using the material. As an
|
|
Sometimes, you want to modify a parameter on each node using the material. As an
|
|
example, in a forest full of trees, when you want each tree to have a slightly
|
|
example, in a forest full of trees, when you want each tree to have a slightly
|