Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document support for 2D per-instance uniforms in Shading language #10749

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions tutorials/shaders/shader_reference/shading_language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Comment on lines +1061 to +1063
Copy link
Contributor

@tetrapod00 tetrapod00 Mar 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
Since Godot 4.4, per-instance uniforms are available in both ``canvas_item`` (2D)
and ``spatial`` (3D) shaders.

I don't think we should explicitly mention older versions like this?
Or just drop the first version if the wording is ambiguous:

Suggested change
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
Expand Down