Browse Source

Merge pull request #10315 from tetrapod00/shader-global-clarify

Explain difference between global shader uniforms and global scope in shaders
Max Hilbrunner 6 months ago
parent
commit
0ebcd118d2
1 changed files with 6 additions and 0 deletions
  1. 6 0
      tutorials/shaders/shader_reference/shading_language.rst

+ 6 - 0
tutorials/shaders/shader_reference/shading_language.rst

@@ -1084,6 +1084,12 @@ Global uniforms are especially useful for environmental effects that affect many
 objects in a scene, like having foliage bend when the player is nearby, or having
 objects in a scene, like having foliage bend when the player is nearby, or having
 objects move with the wind.
 objects move with the wind.
 
 
+.. note:: *Global uniforms* are not the same as *global scope* for an individual
+    shader. While regular uniforms are defined outside of shader functions and are
+    therefore the global scope of the shader, global uniforms are global to all
+    shaders in the entire project (but within each shader, are also in the global
+    scope).
+
 To create a global uniform, open the **Project Settings** then go to the
 To create a global uniform, open the **Project Settings** then go to the
 **Shader Globals** tab. Specify a name for the uniform (case-sensitive) and a
 **Shader Globals** tab. Specify a name for the uniform (case-sensitive) and a
 type, then click **Add** in the top-right corner of the dialog. You can then
 type, then click **Add** in the top-right corner of the dialog. You can then