|
@@ -197,11 +197,18 @@ You can change uniforms from code using the function ``set_shader_parameter()``
|
|
|
which is called on the node's material resource. With a Sprite2D node, the
|
|
|
following code can be used to set the ``blue`` uniform.
|
|
|
|
|
|
-::
|
|
|
+.. tabs::
|
|
|
+
|
|
|
+ .. code-tab:: gdscript
|
|
|
|
|
|
var blue_value = 1.0
|
|
|
material.set_shader_parameter("blue", blue_value)
|
|
|
|
|
|
+ .. code-tab:: csharp
|
|
|
+
|
|
|
+ var blueValue = 1.0;
|
|
|
+ ((ShaderMaterial)Material).SetShaderParameter("blue", blueValue);
|
|
|
+
|
|
|
Note that the name of the uniform is a string. The string must match exactly
|
|
|
with how it is written in the shader, including spelling and case.
|
|
|
|