mgeShaderHandle⚓︎
A loaded MGE shader.
Properties⚓︎
enabled
⚓︎
The enabled state of the shader.
Returns:
result
(boolean)
name
⚓︎
The shader name.
Returns:
result
(string)
orderPriority
⚓︎
The calculated ordering priority value of the shader, that allows auto-sorting of shaders. Changing this value will re-sort the shader list.
Returns:
result
(integer)
variables
⚓︎
Lists the shader's editable variables. The result table has the variable names as keys, and the variable types as values. To get and set the actual variable, use the expression shaderHandle.<variableName>
.
Variable types are:
- 'b' boolean
- 'i' integer
- 'f' float
- 's' string
- 'B' boolean array
- 'I' integer array
- 'F' float array (was 'a' for MGE v0.16.x and earlier)
- '2' vec2
- '3' vec3
- '4' vec4
- 'V' vec4 array
- 'm' matrix
Returns:
result
(table<string, string>)
Methods⚓︎
__tojson
⚓︎
Serializes the object to json.
local result = myObject:__tojson()
Returns:
result
(string)
__tostring
⚓︎
Serializes the object to string.
local result = myObject:__tostring()
Returns:
result
(string)
reload
⚓︎
Reloads and recompiles the shader. Returns if the reload was successful.
local success = myObject:reload()
Returns:
success
(boolean)