Difference between revisions of "Sprite:setShaderConstant"

From GiderosMobile
Line 6: Line 6:
 
  Sprite:setShaderConstant(uniform name,data type,mult,data)
 
  Sprite:setShaderConstant(uniform name,data type,mult,data)
 
</source>
 
</source>
'''uniform name''': (string) The uniform name to change ''''''<br/>
+
=== Parameters ===
'''data type''': (int) The type if data to set (one of the Shader.Cxxx constants) ''''''<br/>
+
'''uniform name''': (string) The uniform name to change <br/>
'''mult''': (number) number of elements of the given type to set ''''''<br/>
+
'''data type''': (int) The type if data to set (one of the Shader.Cxxx constants) <br/>
'''data''': (varies) And the actual data to set, either as a table or as multiple arguments ''''''<br/>
+
'''mult''': (number) number of elements of the given type to set <br/>
 +
'''data''': (varies) And the actual data to set, either as a table or as multiple arguments <br/>

Revision as of 11:45, 23 August 2018

Available since: Gideros 2017.4

Description

To change the value of a uniform from lua

 Sprite:setShaderConstant(uniform name,data type,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