Shader:hasVariable
EditReturns whether the Shader has a variable.
exists = Shader:hasVariable(name)
Arguments
Name | Type | Description |
name | string | The name of the variable to check. |
Returns
Name | Type | Description |
exists | boolean | Whether the Shader has the variable. |
Notes
This will return true if the variable is a buffer, texture, sampler, or other uniform variable (anything that can be sent with Pass:send
).
Example
for key, texture in pairs(textures) do
if shader:hasVariable(key) then
pass:send(key, texture)
end
end