natiny_material_set_constant

C
void natiny_material_set_constant(NatinyMaterial material, const char* name,
                                  float x, float y, float z, float w);

Sets a scalar or vector constant by its shader member name.

Parameters

Name Type Description
material NatinyMaterial Material handle
name const char* Member name inside one of the shader's uniform blocks
x, y, z, w float Components; anything past the member's size is dropped

Example

C
natiny_material_set_constant(material, "tint", 1.0f, 0.5f, 0.5f, 1.0f);

Notes