From 9b823a2275bb3efa3da02672ce67d9862ddc27d9 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 6 Mar 2025 02:43:26 +0100 Subject: [PATCH 1/2] Document support for 2D per-instance uniforms in Shading language --- tutorials/shaders/shader_reference/shading_language.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tutorials/shaders/shader_reference/shading_language.rst b/tutorials/shaders/shader_reference/shading_language.rst index 97f91d19865..30409339f50 100644 --- a/tutorials/shaders/shader_reference/shading_language.rst +++ b/tutorials/shaders/shader_reference/shading_language.rst @@ -102,7 +102,7 @@ Most GLSL ES 3.0 datatypes are supported: 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: .. 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: .. code-block:: - + 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 @@ -1058,7 +1058,9 @@ Per-instance uniforms .. note:: - Per-instance uniforms are only available in ``spatial`` (3D) shaders. + Since Godot 4.4, per-instance uniforms are available in ``canvas_item`` (2D) + and ``spatial`` (3D) shaders. Prior to Godot 4.4, per-instance uniforms are + only available in ``spatial`` shaders. 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 From 273206f0ac74fd328424e20836e9655352e15430 Mon Sep 17 00:00:00 2001 From: Matthew Date: Sat, 5 Apr 2025 13:19:24 -0400 Subject: [PATCH 2/2] Update tutorials/shaders/shader_reference/shading_language.rst Co-authored-by: tetrapod <145553014+tetrapod00@users.noreply.github.com> --- tutorials/shaders/shader_reference/shading_language.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tutorials/shaders/shader_reference/shading_language.rst b/tutorials/shaders/shader_reference/shading_language.rst index 30409339f50..00debc8e00b 100644 --- a/tutorials/shaders/shader_reference/shading_language.rst +++ b/tutorials/shaders/shader_reference/shading_language.rst @@ -1058,9 +1058,7 @@ Per-instance uniforms .. note:: - Since Godot 4.4, per-instance uniforms are available in ``canvas_item`` (2D) - and ``spatial`` (3D) shaders. Prior to Godot 4.4, per-instance uniforms are - only available in ``spatial`` 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 example, in a forest full of trees, when you want each tree to have a slightly