# SetObjectShaderConstantArrayByName

## Description

Sets a shader constant for an object by name, the constant must be marked as "uniform" in the shader source. The object will set the specified constant to this value for any shader that it is applied to it. Array indices start at 0, if the array index is out of bounds then it will be ignored and no changes will be made. All shader values have 1 to 4 components, this command accepts 4 values and discards any that are not used by the named variable.

## Definition

SetObjectShaderConstantArrayByName( objID, szName, arrayIndex, value1, value2, value3, value4 )

void agk::SetObjectShaderConstantArrayByName( unsigned int objID, const char *szName, UINT arrayIndex, float value1, float value2, float value3, float value4 )

## Parameters

- objID - The ID of the object to modify.
- szName - The name of the constant to change, as defined in the shader source file.
- arrayIndex - The index of the element within the array to modify.
- value1 - The X or R component of the new value, this value will always be used.
- value2 - The Y or G component of the new value, if the constant only uses 1 component this value is discarded.
- value3 - The Z or B component of the new value, if the constant only uses 2 components this value is discarded.
- value4 - The W or A component of the new value, if the constant only uses 3 components this value is discarded.