Difference between revisions of "ShaderUniform"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "==shaderUniform== <div class="command-min-version-info">Available since: <span class="command-min-version">v4.0</span></div> <div class="command-doc">Set uniforms for shader...")
 
(Redirected page to Global Command: shaderUniform)
 
Line 1: Line 1:
==shaderUniform==
+
#REDIRECT [[Global Command: shaderUniform]]
 
 
<div class="command-min-version-info">Available since: <span class="command-min-version">v4.0</span></div>
 
 
 
<div class="command-doc">Set uniforms for shader</div>
 
 
 
Lua Syntax:
 
<pre class="command-syntax">shaderUniform(shader_number, name, value)</pre>
 
===Arguments===
 
====shader_number====
 
:'''int''' -
 
====name====
 
:'''"string"''' - option name, use _i_ prefix to set integer values as lua has only numbers
 
====value====
 
:'''VARIANT''' - value, supports integer, float, vec2, vec3, vec4, mat4
 
===Flags===
 
===Return Values===
 
None.
 
===Examples===
 
Example 1: set uniforms
 
<syntaxhighlight>
 
shaderUniform("iTime",shader_iTime*0.1)
 
shaderUniform("shader_coeff",{shader_coeff0,shader_coeff1,shader_coeff2,shader_coeff3})
 
 
 
</syntaxhighlight>
 

Latest revision as of 13:33, 19 May 2023