engineGetMaterialValue
Client
Reads a value the material sets: a parameter, a static switch or a TARGET_n output.
any engineGetMaterialValue(material material, string name)
Parameters
| Name | Type | Description |
|---|---|---|
| material | material | The material. |
| name | string | The parameter's, switch's or output's name. |
Returns
A number, a vector or an integer, by the parameter's type. A texture gives its name, or true when it is an image. A switch gives true or false (the shader's default when it was not set), and an output with a render target gives true. nil when the material does not set that name.
Example
local material = engineCreateMaterial("surface")
engineSetMaterialValue(material, "roughnessFactor", 0.2)
outputDebugString(tostring(engineGetMaterialValue(material, "roughnessFactor")))