Difference between revisions of "Shader:setConstant"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 5: Line 5:
 
=== <translate>Description</translate> ===
 
=== <translate>Description</translate> ===
 
<translate>To change the value of a uniform from lua</translate>
 
<translate>To change the value of a uniform from lua</translate>
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
  Shader:setConstant(uniformName,dataType,mult,data)
 
  Shader:setConstant(uniformName,dataType,mult,data)
 
</source>
 
</source>

Revision as of 14:30, 13 July 2023


Available since: Gideros 2015.06.30
Class: Shader

Description

To change the value of a uniform from lua <syntaxhighlight lang="lua">

Shader:setConstant(uniformName,dataType,mult,data)

</source>

Parameters

uniformName: (string) The uniform name to change
dataType: (int) The type if data to set (one of the Shader.Cxxx constants)
mult: (number) number of elements of the given type to set
data: (varies) And the actual data to set, either as a table or as multiple arguments