Difference between revisions of "Sprite:setShaderConstant"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
m (Text replacement - "</source>" to "</syntaxhighlight>")
Line 7: Line 7:
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
 
Sprite:setShaderConstant(uniformName,dataType,mult,data,programType,programVariant)
 
Sprite:setShaderConstant(uniformName,dataType,mult,data,programType,programVariant)
</source>
+
</syntaxhighlight>
  
 
=== Parameters ===
 
=== Parameters ===

Revision as of 14:33, 13 July 2023

Available since: Gideros 2017.4
Class: Sprite

Description

Changes the value of a uniform from lua.

Sprite:setShaderConstant(uniformName,dataType,mult,data,programType,programVariant)

Parameters

uniform name: (string) the uniform name to change
data type: (int) the type of 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
program type: (int) the type of program this constant applies to optional
program variant: (int) the variant of program this constant applies to optional