Difference between revisions of "Shader:setConstant"

From GiderosMobile
Line 6: Line 6:
 
<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">
 
<source lang="lua">
  Shader:setConstant(uniform name,data type,mult,data)
+
  Shader:setConstant(uniformName,dataType,mult,data)
 
</source>
 
</source>
 +
 
=== <translate>Parameters</translate> ===
 
=== <translate>Parameters</translate> ===
 
'''uniform name''': (string) <translate>The uniform name to change</translate> <br/>
 
'''uniform name''': (string) <translate>The uniform name to change</translate> <br/>

Revision as of 05:25, 31 December 2020


Available since: Gideros 2015.06.30
Class: Shader

Description

To change the value of a uniform from lua

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

Parameters

uniform name: (string) The uniform name to change
data type: (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