Shader:hasAttribute
EditReturns whether the Shader has a vertex attribute, by name or location.
Arguments
Name | Type | Description |
name | string | The name of an attribute. |
Returns
Name | Type | Description |
exists | boolean | Whether the Shader has the attribute. |
Arguments
Name | Type | Description |
location | number | The location of an attribute. |
Returns
Name | Type | Description |
exists | boolean | Whether the Shader has the attribute. |
Example
function lovr.load()
shader = lovr.graphics.newShader([[
in uint coolAttribute;
vec4 lovrmain() {
return DefaultPosition;
}
]], [[
vec4 lovrmain() {
return DefaultColor;
}
]])
print(shader:hasAttribute('coolAttribute')) --> true
end