Skip to content

Commit 37a96ba

Browse files
Close godotengine#7690 (add info for shader hints and default values) (godotengine#8117)
* add comment for default values * Add a line telling where the default value goes --------- Co-authored-by: A Thousand Ships <[email protected]>
1 parent b03034b commit 37a96ba

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tutorials/shaders/shader_reference/shading_language.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ used, and how the editor should allow users to modify it.
757757
758758
uniform vec4 color : source_color;
759759
uniform float amount : hint_range(0, 1);
760-
uniform vec4 other_color : source_color = vec4(1.0);
760+
uniform vec4 other_color : source_color = vec4(1.0); // Default values go after the hint.
761761
uniform sampler2D image : source_color;
762762
763763
It's important to understand that textures that are supplied as color require
@@ -899,6 +899,8 @@ Uniforms can also be assigned default values:
899899
uniform vec4 some_vector = vec4(0.0);
900900
uniform vec4 some_color : source_color = vec4(1.0);
901901
902+
Note that when adding a default value and a hint, the default value goes after the hint.
903+
902904
If you need to make multiple uniforms to be grouped in the specific category of an inspector, you can use a `group_uniform` keyword like:
903905

904906
.. code-block:: glsl

0 commit comments

Comments
 (0)